Skip to content

Commit

Permalink
Fix #1241 (comment), subnav in header + css
Browse files Browse the repository at this point in the history
  • Loading branch information
louismaximepiton committed May 18, 2022
1 parent 6331beb commit 883a456
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 39 deletions.
28 changes: 2 additions & 26 deletions site/assets/scss/_subnav.scss
@@ -1,32 +1,8 @@
// Boosted mod: doesn't exist anymore in Bootstrap

.bd-subnavbar {
--bs-gutter-x: $bd-gutter-x;
--bs-gutter-y: $bd-gutter-x;
--bs-navbar-toggler-icon-bg: #{escape-svg($navbar-light-toggler-icon-bg-small)};

// The position and z-index are needed for the dropdown to stay on top of the content
position: sticky;
top: 3.125rem;
z-index: $zindex-dropdown; // goes under the navbar + dropdown.

// The z-index is needed for the dropdown to stay on top of the content
z-index: $zindex-dropdown - 1; // goes under the navbar + dropdown.
background-color: rgba($white, .95);
box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .05), inset 0 -1px 0 rgba(0, 0, 0, .15);

.dropdown-menu {
@include font-size(.875rem);
box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .05);
}

.dropdown-item.current {
font-weight: 600;
background-image: escape-svg($dropdown-active-icon);
background-repeat: no-repeat;
background-position: right $dropdown-item-padding-x top .6rem;
background-size: .75rem .75rem;
}

@include media-breakpoint-up(md) {
top: 3.75rem;
}
}
3 changes: 0 additions & 3 deletions site/layouts/_default/docs.html
@@ -1,7 +1,4 @@
{{ define "main" }}
<!--Boosted mod: docs-subnav doesn't exist anymore in Bootstrap-->
{{ partial "docs-subnav" }}

<div class="container-xxl bd-gutter mt-3 my-md-4 bd-layout">
<aside class="bd-sidebar">
<div class="offcanvas-lg offcanvas-start" id="bdSidebar" aria-labelledby="bdSidebarOffcanvasLabel">
Expand Down
5 changes: 5 additions & 0 deletions site/layouts/partials/docs-navbar.html
Expand Up @@ -47,4 +47,9 @@
</div>
</div>
</nav>

{{- if eq .Layout "docs" }}
<!--Boosted mod: docs-subnav doesn't exist anymore in Bootstrap-->
{{ partial "docs-subnav" }}
{{- end }}
</header>
11 changes: 1 addition & 10 deletions site/layouts/partials/docs-subnav.html
@@ -1,14 +1,5 @@
<!--Boosted mod: doesn't exist anymore in Bootstrap-->

<!--------------------------------------------------------------->
<!--------------------------------------------------------------->
<!--------------------------------------------------------------->
<!-- TODO: clean up and remove useless tags -->
<!-- TODO: this should be sticky top -->
<!--------------------------------------------------------------->
<!--------------------------------------------------------------->
<!--------------------------------------------------------------->

<nav class="bd-subnavbar py-2 d-lg-none" aria-label="Secondary navigation">
<div class="container-xxl d-flex justify-content-end">
<button class="btn btn-secondary btn-icon p-2" type="button" data-bs-toggle="offcanvas" data-bs-target="#bdSidebar" aria-controls="bdSidebar" aria-expanded="false" aria-label="Toggle docs navigation">
Expand All @@ -19,7 +10,7 @@
<!--------------------------------------------------------------->
<!--------------------------------------------------------------->
<!--------------------------------------------------------------->
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" class="bi bi-expand" fill="currentColor" viewBox="0 0 16 16">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" class="bi" fill="currentColor" viewBox="0 0 16 16">
<title>Expand</title>
<path fill-rule="evenodd" d="M1 8a.5.5 0 0 1 .5-.5h13a.5.5 0 0 1 0 1h-13A.5.5 0 0 1 1 8zM7.646.146a.5.5 0 0 1 .708 0l2 2a.5.5 0 0 1-.708.708L8.5 1.707V5.5a.5.5 0 0 1-1 0V1.707L6.354 2.854a.5.5 0 1 1-.708-.708l2-2zM8 10a.5.5 0 0 1 .5.5v3.793l1.146-1.147a.5.5 0 0 1 .708.708l-2 2a.5.5 0 0 1-.708 0l-2-2a.5.5 0 0 1 .708-.708L7.5 14.293V10.5A.5.5 0 0 1 8 10z"></path>
</svg>
Expand Down

0 comments on commit 883a456

Please sign in to comment.