diff options
Diffstat (limited to 'site')
-rw-r--r-- | site/assets/scss/_navbar.scss | 6 | ||||
-rw-r--r-- | site/assets/scss/_search.scss | 21 | ||||
-rw-r--r-- | site/layouts/partials/docs-navbar.html | 22 |
3 files changed, 38 insertions, 11 deletions
diff --git a/site/assets/scss/_navbar.scss b/site/assets/scss/_navbar.scss index 4805a3c471..0cff3e2a8f 100644 --- a/site/assets/scss/_navbar.scss +++ b/site/assets/scss/_navbar.scss @@ -4,6 +4,12 @@ background-image: linear-gradient(to bottom, rgba(var(--bd-violet-rgb), 1), rgba(var(--bd-violet-rgb), .95)); box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15), inset 0 -1px 0 rgba(0, 0, 0, .15); + .bd-navbar-toggle { + @include media-breakpoint-down(lg) { + width: 4.25rem; + } + } + .navbar-toggler { padding: 0; margin-right: -.5rem; diff --git a/site/assets/scss/_search.scss b/site/assets/scss/_search.scss index 24c0e2dc8a..bce04c9d2b 100644 --- a/site/assets/scss/_search.scss +++ b/site/assets/scss/_search.scss @@ -2,7 +2,6 @@ .bd-search { position: relative; - width: 100%; @include media-breakpoint-up(lg) { position: absolute; @@ -57,6 +56,26 @@ opacity: 1; } } + + @include media-breakpoint-down(lg) { + &, + &:hover, + &:focus { + background: transparent; + border: 0; + box-shadow: none; + } + &:focus { + box-shadow: var(--docsearch-searchbox-shadow); + } + } +} + +.DocSearch-Button-Keys, +.DocSearch-Button-Placeholder { + @include media-breakpoint-down(lg) { + display: none; + } } .DocSearch-Button-Keys { diff --git a/site/layouts/partials/docs-navbar.html b/site/layouts/partials/docs-navbar.html index 1b9a45ff7f..68a086e89b 100644 --- a/site/layouts/partials/docs-navbar.html +++ b/site/layouts/partials/docs-navbar.html @@ -1,21 +1,29 @@ <header class="navbar navbar-expand-lg navbar-dark bd-navbar sticky-top"> <nav class="container-xxl bd-gutter flex-wrap flex-lg-nowrap" aria-label="Main navigation"> {{- if eq .Layout "docs" }} + <div class="bd-navbar-toggle"> <button class="navbar-toggler p-2" type="button" data-bs-toggle="offcanvas" data-bs-target="#bdSidebar" aria-controls="bdSidebar" aria-label="Toggle docs navigation"> {{ partial "icons/hamburger.svg" (dict "class" "bi" "width" "24" "height" "24") }} <span class="d-none fs-6 pe-1">Browse</span> </button> + </div> {{- else }} - <div class="d-lg-none" style="width: 2.25rem;"></div> + <div class="d-lg-none" style="width: 1.5rem;"></div> {{- end }} <a class="navbar-brand p-0 me-0 me-lg-2" href="/" aria-label="Bootstrap"> {{ partial "icons/bootstrap-white-fill.svg" (dict "class" "d-block my-1" "width" "40" "height" "32") }} </a> - <button class="navbar-toggler d-flex d-lg-none order-3 p-2" type="button" data-bs-toggle="offcanvas" data-bs-target="#bdNavbar" aria-controls="bdNavbar" aria-label="Toggle navigation"> - <svg class="bi" aria-hidden="true"><use xlink:href="#three-dots"></use></svg> - </button> + <div class="d-flex"> + {{ if eq .Layout "docs" }} + <div class="bd-search" id="docsearch" data-bd-docs-version="{{ .Site.Params.docs_version }}"></div> + {{ end }} + + <button class="navbar-toggler d-flex d-lg-none order-3 p-2" type="button" data-bs-toggle="offcanvas" data-bs-target="#bdNavbar" aria-controls="bdNavbar" aria-label="Toggle navigation"> + <svg class="bi" aria-hidden="true"><use xlink:href="#three-dots"></use></svg> + </button> + </div> <div class="offcanvas-lg offcanvas-end flex-grow-1" tabindex="-1" id="bdNavbar" aria-labelledby="bdNavbarOffcanvasLabel" data-bs-scroll="true"> <div class="offcanvas-header px-4 pb-0"> @@ -45,12 +53,6 @@ <hr class="d-lg-none text-white-50"> - {{ if eq .Layout "docs" }} - <div class="bd-search" id="docsearch" data-bd-docs-version="{{ .Site.Params.docs_version }}"></div> - - <hr class="d-lg-none text-white-50"> - {{ end }} - <ul class="navbar-nav flex-row flex-wrap ms-md-auto"> <li class="nav-item col-6 col-lg-auto"> <a class="nav-link py-2 px-0 px-lg-2" href="{{ .Site.Params.github_org }}" target="_blank" rel="noopener"> |