From 60050da00b58038d4fe9d908985141d0fe27bbdd Mon Sep 17 00:00:00 2001 From: Vahagn Aharonian Date: Thu, 9 Feb 2023 20:20:19 +0500 Subject: [PATCH] Fix search input styles on mobile --- docusaurus.config.js | 4 ++++ src/css/custom.css | 27 +++++++++++++++++++++++---- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/docusaurus.config.js b/docusaurus.config.js index 8d41de08..79c3100c 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -120,6 +120,10 @@ const config = { className: "nav-github-stars", position: "right", }, + { + type: "search", + position: "right", + }, { href: "https://github.com/dragonflydb/dragonfly/blob/main/docs/quick-start/README.md", label: "Get Started", diff --git a/src/css/custom.css b/src/css/custom.css index d7125343..fd9e214e 100644 --- a/src/css/custom.css +++ b/src/css/custom.css @@ -161,7 +161,7 @@ a > svg[class*="ExternalLink"] { } .nav-cta { - padding: 8px 20px; + padding: 8px 20px !important; margin-left: 8px; font-family: var(--ifm-heading-font-family); font-weight: 700; @@ -186,11 +186,30 @@ a > svg[class*="ExternalLink"] { /* Search */ .navbar__search { margin: 0 !important; + + --ifm-navbar-search-input-icon: url('data:image/svg+xml;utf8,'); } .navbar__search-input { - padding-top: 12px; - padding-bottom: 12px; - height: auto !important; + --ifm-navbar-search-input-background-color: rgba(255, 255, 255, 0.1); + + padding-top: 13px; + padding-bottom: 13px; border-radius: 6px; + height: auto !important; + transition: 0.2s; + font-family: inherit; +} + +@media (max-width: 576px) { + .navbar__search-input:focus { + --ifm-navbar-search-input-background-color: var(--ifm-color-emphasis-200); + } + + .navbar__search-input:not(:focus) { + border-radius: 50%; + padding-right: 0.2rem; + padding-top: 10px; + padding-bottom: 10px; + } }