From 83f209ca8c5939428c223f3600269cb34b706ede Mon Sep 17 00:00:00 2001 From: denisahearn Date: Thu, 19 Dec 2024 11:09:34 -0600 Subject: [PATCH 1/2] Add search filter to sidebar --- CONTRIBUTING.md | 2 +- .../layouts/assets/_sass/_sidebar.scss | 32 +++++++++++ .../layouts/assets/images/search.svg | 3 ++ lib/graphql-docs/layouts/default.html | 54 ++++++++++++++++++- .../layouts/includes/sidebar.html | 4 ++ 5 files changed, 93 insertions(+), 2 deletions(-) create mode 100644 lib/graphql-docs/layouts/assets/images/search.svg diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3a436d70..49124e0b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,4 +1,4 @@ -# Contribuing Guide +# Contributing Guide Contributions to this project are welcome. If you have an idea for a bigger change, [open an issue first](https://github.com/brettchalupa/graphql-docs/issues/new/choose) and we can discuss it. diff --git a/lib/graphql-docs/layouts/assets/_sass/_sidebar.scss b/lib/graphql-docs/layouts/assets/_sass/_sidebar.scss index 5afe1b45..9d82a365 100644 --- a/lib/graphql-docs/layouts/assets/_sass/_sidebar.scss +++ b/lib/graphql-docs/layouts/assets/_sass/_sidebar.scss @@ -69,6 +69,38 @@ } } } + #search-filter { + display: flex; + position: relative; + align-items: center; + border: 1px solid #ddd; + border-radius: 5px; + padding: 0.01em 16px; + margin-bottom: 20px; + + img { + position: absolute; + left: 10px; + height: 16px; + width: 16px; + } + + input { + height: 24px; + line-height: 1.5; + width: 100%; + padding-left: 15px; + background-color: transparent; + color: #444; + border: none; + font-size: 14px; + font-family: 'ProximaNova-Semibold'; + } + + input:focus { + outline: none; + } + } } #sidebar-mobile { diff --git a/lib/graphql-docs/layouts/assets/images/search.svg b/lib/graphql-docs/layouts/assets/images/search.svg new file mode 100644 index 00000000..eee8ff56 --- /dev/null +++ b/lib/graphql-docs/layouts/assets/images/search.svg @@ -0,0 +1,3 @@ + + + diff --git a/lib/graphql-docs/layouts/default.html b/lib/graphql-docs/layouts/default.html index 00ee54ff..2b3e964a 100644 --- a/lib/graphql-docs/layouts/default.html +++ b/lib/graphql-docs/layouts/default.html @@ -9,16 +9,68 @@ diff --git a/lib/graphql-docs/layouts/includes/sidebar.html b/lib/graphql-docs/layouts/includes/sidebar.html index 23d67808..a8979e7e 100644 --- a/lib/graphql-docs/layouts/includes/sidebar.html +++ b/lib/graphql-docs/layouts/includes/sidebar.html @@ -1,3 +1,7 @@ +
+ + +