From 2d9ffbf9a8c4c2793d87a21dba9597e46de717df Mon Sep 17 00:00:00 2001 From: "louismaxime.piton" Date: Wed, 3 Aug 2022 10:17:27 +0200 Subject: [PATCH] Working sample without js --- scss/_side-navigation.scss | 62 ++++++++++++++----- .../docs/5.2/components/side-navigation.md | 17 +++-- 2 files changed, 58 insertions(+), 21 deletions(-) diff --git a/scss/_side-navigation.scss b/scss/_side-navigation.scss index 7c2238aadd..a573412513 100644 --- a/scss/_side-navigation.scss +++ b/scss/_side-navigation.scss @@ -15,6 +15,7 @@ width: var(--#{$prefix}side-nav-width); height: 100%; + overflow: auto; border: 0 !important; // stylelint-disable-line declaration-no-important svg, @@ -72,6 +73,7 @@ overflow: hidden; color: var(--#{$prefix}side-nav-color); text-decoration: none; + white-space: nowrap; background-color: var(--#{$prefix}side-nav-bg-color); border: 0; @@ -85,29 +87,55 @@ } } +[class*="side-nav-collapsible"] [data-bs-toggle="collapse"] { + align-self: flex-end; + width: 54px; + height: 40px; + margin-left: auto; + @include transition(transform .3s ease); + @include caret(start); + + &::before { + border-right-color: #000; + } + + &.collapsed { + transform: rotateZ(180deg); + } +} + .side-nav-collapsible { - --#{$prefix}side-nav-width: 3.5rem; - --#{$prefix}offcanvas-width: 326px; + display: inline-flex; + --#{$prefix}side-nav-width: 54px; + --#{$prefix}offcanvas-width: 300px; + + .offcanvas-body { + display: inline-flex; + width: auto; + min-width: 54px; + border-right: #ccc solid 1px; - [data-bs-toggle="collapse"] { - align-self: flex-end; - width: 55px; - height: 40px; - @include transition(transform .3s ease); - @include caret(start); + @include media-breakpoint-up(lg) { + position: absolute; + } - &::before { - border-right-color: #000; + > * { + border: 0; } + } - &.collapsed { - transform: rotateZ(180deg); + .collapse-horizontal { + margin-left: 54px; - &::before { - border-right-color: #fff; - } + .fake { + width: 245px; } } +} + +.side-nav-collapsible-content { + --#{$prefix}side-nav-width: 3.5rem; + --#{$prefix}offcanvas-width: 326px; .offcanvas-header, .offcanvas-body > * { @@ -117,6 +145,10 @@ .side-nav-collapse { width: 270px; } + + [data-bs-toggle="collapse"].collapsed::before { + border-right-color: #fff; + } } .side-nav-dark { diff --git a/site/content/docs/5.2/components/side-navigation.md b/site/content/docs/5.2/components/side-navigation.md index 321f60c351..be967cd4a2 100644 --- a/site/content/docs/5.2/components/side-navigation.md +++ b/site/content/docs/5.2/components/side-navigation.md @@ -142,17 +142,20 @@ Side navigation may need the Javascript from Accordions, Collapse, Tabs or Toolt ## Collapsible with title -{{< example class="p-0 scrollspy-example-2" >}} +{{< example class="p-0 scrollspy-example-2 d-flex" >}}
-
-
+
+
+
 
+
+
-
    +
+
test
{{< /example >}} ## Collapsible with content Strongly WIP, onclick functions are a test without extra JS. But fully working example atm. -{{< example class="p-0 scrollspy-example-2" >}} +{{< example class="p-0 scrollspy-example-2 d-flex" >}} -
+
@@ -238,6 +242,7 @@ Strongly WIP, onclick functions are a test without extra JS. But fully working e
+
test
{{< /example >}} ## Dark variant