Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Side navigation #1349

Open
wants to merge 47 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
b9fdac2
SNI and SNL first attempt
louismaximepiton Jun 30, 2022
14a888d
Strongly WIP but collapsing content seems to work
louismaximepiton Jul 4, 2022
41cdcdc
Working sample without js
louismaximepiton Aug 3, 2022
5f10df1
Adding focus + resolving much bugs + CSS var
louismaximepiton Aug 3, 2022
8d31d11
Fix pa11y
louismaximepiton Aug 3, 2022
a60f1c1
Fix some bugs
louismaximepiton Aug 4, 2022
b610a45
CSS trim + fix some known issues
louismaximepiton Aug 11, 2022
11adbcf
Perfect config but with focus issues on the last one
louismaximepiton Aug 12, 2022
0ec309e
.
louismaximepiton Aug 12, 2022
b39a02d
Fix issues + add static side navigation
louismaximepiton Aug 16, 2022
d30d9fb
Adding example in collapsible with content + handle overflow
louismaximepiton Aug 16, 2022
dd4fb61
Fix from reviews
louismaximepiton Aug 22, 2022
222d9c8
Handle scrollbar
louismaximepiton Aug 22, 2022
ad4b8ce
Changing the doc + handle some minor bugs
louismaximepiton Aug 23, 2022
840a88c
Fix CI
louismaximepiton Aug 23, 2022
a418627
Merge branch 'main' into main-lmp-side-navigation
louismaximepiton Dec 14, 2022
9479542
Implementing design things
louismaximepiton Dec 14, 2022
8d5997e
Merge branch 'main' into main-lmp-side-navigation
louismaximepiton Jan 23, 2023
8bd27b3
Refactoring of side-nav to allow a better scrollable region + unlink …
louismaximepiton Jan 30, 2023
8be1c39
.
louismaximepiton Jan 30, 2023
7c724d9
Enhance doc + bundlewatch + cspell + envariable the component + small…
louismaximepiton Feb 1, 2023
5100a3d
Add references + migration guide
louismaximepiton Feb 1, 2023
b57f58b
.
louismaximepiton Feb 1, 2023
898d32a
Merge branch 'main' into main-lmp-side-navigation
louismaximepiton Feb 21, 2023
af141d2
.
louismaximepiton Feb 21, 2023
cace4c9
Merge branch 'main' into main-lmp-side-navigation
louismaximepiton Mar 1, 2023
5801612
A11y fixes
louismaximepiton Mar 2, 2023
68972e5
Merge branch 'main' into main-lmp-side-navigation
louismaximepiton Mar 2, 2023
fdeeb6d
.
louismaximepiton Mar 2, 2023
cd00944
fix(review)
louismaximepiton Mar 8, 2023
29c88c0
Merge branch 'main' into main-lmp-side-navigation
louismaximepiton Mar 8, 2023
edf03ee
Merge branch 'main' into main-lmp-side-navigation
MewenLeHo Mar 24, 2023
3047eb8
fix(review)
louismaximepiton Mar 27, 2023
a9534a5
Adding StoryBook stories
louismaximepiton Apr 4, 2023
5098e64
Merge branch 'main' into main-lmp-side-navigation
louismaximepiton Apr 4, 2023
665161c
Merge branch 'main' into main-lmp-side-navigation
louismaximepiton Jul 25, 2023
0469c09
Remove multiline comments
louismaximepiton Jul 25, 2023
3d97717
Remove with drawer variant to ease the reviews.
louismaximepiton Jul 27, 2023
416816b
Remove with drawer variant to ease the reviews.
louismaximepiton Jul 27, 2023
f144d9f
.
louismaximepiton Jul 27, 2023
8f5c0f7
Fix CI jobs
louismaximepiton Jul 27, 2023
9fe52be
fix(review)
louismaximepiton Aug 4, 2023
fe7d066
Merge branch 'main' into main-lmp-side-navigation
louismaximepiton Aug 28, 2023
121721c
Merge branch 'main' into main-lmp-side-navigation
louismaximepiton Jan 4, 2024
51f326f
Fix after dark mode
louismaximepiton Jan 4, 2024
3d08750
.
louismaximepiton Jan 4, 2024
2fb3373
.
louismaximepiton Jan 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .bundlewatch.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@
},
{
"path": "./dist/css/boosted.css",
"maxSize": "44.5 kB"
"maxSize": "45.5 kB"
},
{
"path": "./dist/css/boosted.min.css",
"maxSize": "41.5 kB"
"maxSize": "42.25 kB"
},
{
"path": "./dist/js/boosted.bundle.js",
Expand Down
6 changes: 6 additions & 0 deletions scss/_offcanvas.scss
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,9 @@
overflow-y: auto;
color: var(--#{$prefix}offcanvas-color); // Boosted mod
}

.offcanvas-dark {
louismaximepiton marked this conversation as resolved.
Show resolved Hide resolved
--#{$prefix}offcanvas-color: #{$white};
--#{$prefix}offcanvas-bg: #{$gray-900};
--#{$prefix}offcanvas-border-color: #{$gray-700};
}
218 changes: 218 additions & 0 deletions scss/_side-navigation.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,218 @@
.side-nav {
// scss-docs-start side-nav-css-vars
--#{$prefix}side-nav-min-width: #{$side-nav-min-width};
--#{$prefix}side-nav-max-width: #{$side-nav-max-width};
--#{$prefix}side-nav-bg: #{$side-nav-bg};
--#{$prefix}side-nav-border-width: #{$side-nav-border-width};
--#{$prefix}side-nav-border-color: #{$side-nav-border-color};
--#{$prefix}side-nav-item-min-height: #{$side-nav-item-min-height};
--#{$prefix}side-nav-item-icon-size: #{$side-nav-item-icon-size};
--#{$prefix}side-nav-item-spacing: #{$side-nav-item-spacing};
--#{$prefix}side-nav-item-padding-top: #{$side-nav-item-padding-top};
--#{$prefix}side-nav-item-padding-end: #{$side-nav-item-padding-end};
--#{$prefix}side-nav-item-padding-bottom: #{$side-nav-item-padding-bottom};
--#{$prefix}side-nav-item-padding-start: #{$side-nav-item-padding-start};
--#{$prefix}side-nav-item-color: #{$side-nav-item-color};
--#{$prefix}side-nav-item-hover-bg: #{$side-nav-item-hover-bg};
--#{$prefix}side-nav-item-active-bg: #{$side-nav-item-active-bg};
--#{$prefix}side-nav-item-active-border: #{$side-nav-item-active-border};
// scss-docs-end side-nav-css-vars

position: relative;
flex-shrink: 0;
min-width: add(var(--#{$prefix}side-nav-min-width), var(--#{$prefix}side-nav-border-width));
height: 100%;
MewenLeHo marked this conversation as resolved.
Show resolved Hide resolved

:focus {
&[data-focus-visible-added] {
outline-offset: -$focus-visible-outer-width;
box-shadow: inset 0 0 0 add($focus-visible-inner-width, $focus-visible-outer-width) var(--#{$prefix}focus-visible-inner-color);
MewenLeHo marked this conversation as resolved.
Show resolved Hide resolved
}
}

.accordion {
--#{$prefix}accordion-bg: transparent;
--#{$prefix}accordion-border-width: 0;
--#{$prefix}accordion-body-padding-top: 0;
--#{$prefix}accordion-body-padding-end: 0;
--#{$prefix}accordion-body-padding-bottom: 0;
--#{$prefix}accordion-body-padding-start: 0;
MewenLeHo marked this conversation as resolved.
Show resolved Hide resolved

.accordion-button::after {
margin-right: var(--#{$prefix}side-nav-item-spacing);
}

.accordion-body {
--#{$prefix}side-nav-item-padding-start: calc(var(--#{$prefix}side-nav-item-icon-size) + var(--#{$prefix}side-nav-item-spacing) * 2 - var(--#{$prefix}side-nav-border-width)); // stylelint-disable-line function-disallowed-list

.accordion-body {
--#{$prefix}side-nav-item-padding-start: calc(var(--#{$prefix}side-nav-item-icon-size) * 2 + var(--#{$prefix}side-nav-item-spacing) * 3 - var(--#{$prefix}side-nav-border-width) * 2); // stylelint-disable-line function-disallowed-list
}
}
}

> * {
overflow: hidden;
background: var(--#{$prefix}side-nav-bg);
}

// Small trick to remove `.h-100` inside the markup
MewenLeHo marked this conversation as resolved.
Show resolved Hide resolved
> div {
position: absolute;
height: 100%;
border-right: var(--#{$prefix}side-nav-border-width) solid var(--#{$prefix}side-nav-border-color);
}

&.side-nav-static > div {
position: relative;
}

.side-nav-item {
position: relative;
display: flex;
align-items: center;
min-width: var(--#{$prefix}side-nav-min-width);
min-height: var(--#{$prefix}side-nav-item-min-height);
padding: var(--#{$prefix}side-nav-item-padding-top) var(--#{$prefix}side-nav-item-padding-end) var(--#{$prefix}side-nav-item-padding-bottom) var(--#{$prefix}side-nav-item-padding-start);
margin: 0;
font-size: $font-size-base;
line-height: $line-height-base;
color: var(--#{$prefix}side-nav-item-color);
text-decoration: none;
background-color: transparent;
MewenLeHo marked this conversation as resolved.
Show resolved Hide resolved
border: 0;

&.active,
&.active-parent,
&:active {
background-color: var(--#{$prefix}side-nav-item-active-bg);
MewenLeHo marked this conversation as resolved.
Show resolved Hide resolved
}

&:hover {
background-color: var(--#{$prefix}side-nav-item-hover-bg);
}

&.active,
&.active-parent.collapsed {
&::before {
position: absolute;
top: 0;
left: 0;
width: 4px;
height: 100%;
content: "";
background-color: var(--#{$prefix}side-nav-item-active-border);
}
}

svg,
img {
width: var(--#{$prefix}side-nav-item-icon-size);
min-width: var(--#{$prefix}side-nav-item-icon-size);
height: var(--#{$prefix}side-nav-item-icon-size);
margin: calc(-1 * var(--#{$prefix}side-nav-item-padding-top)) subtract(var(--#{$prefix}side-nav-item-spacing), var(--#{$prefix}side-nav-border-width)) calc(-1 * var(--#{$prefix}side-nav-item-padding-bottom)) 0; // stylelint-disable-line function-disallowed-list
}
}
}

.side-nav-toggle {
display: flex;
align-items: center;
justify-content: center;
width: var(--#{$prefix}side-nav-min-width);
height: var(--#{$prefix}side-nav-item-min-height);
margin-left: auto;
background-color: transparent;
border: 0;

&::before {
position: absolute;
top: 0;
right: 0;
left: 0;
height: var(--#{$prefix}side-nav-item-min-height);
content: "";
}

&::after {
margin-right: 1px;
content: "";
border: $caret-width solid transparent;
border-right-color: var(--#{$prefix}side-nav-item-color);
border-left: 0;
}

&.collapsed::after {
margin-left: 3px;
transform: rotate(180deg);
}
}

.side-nav-content {
display: flex;
height: subtract(100%, var(--#{$prefix}side-nav-item-min-height));
}

.side-nav-scrollable {
height: subtract(100%, var(--#{$prefix}side-nav-item-min-height));
overflow: hidden auto;
scrollbar-width: thin;
MewenLeHo marked this conversation as resolved.
Show resolved Hide resolved

&::-webkit-scrollbar {
width: 8px;
background-color: rgba($black, .1);
}

&::-webkit-scrollbar-thumb {
background-color: rgba(192, 192, 192, .5);

&:hover {
background-color: rgba(128, 128, 128, .6);
}
}
}

@each $breakpoint in map-keys($grid-breakpoints) {
$next: breakpoint-next($breakpoint, $grid-breakpoints);
$infix: breakpoint-infix($next, $grid-breakpoints);

.offcanvas#{$infix} {
@include media-breakpoint-down($next) {
.side-nav > * {
border: 0;
}

.side-nav-toggle {
display: none;
}

.side-nav-content {
height: 100%;
}
}
}
}

// Themes
.side-nav-accordion {
> * {
width: subtract(var(--#{$prefix}side-nav-max-width), var(--#{$prefix}side-nav-border-width));
}
}

.side-nav-collapsible {
.collapse-horizontal {
margin-left: var(--#{$prefix}side-nav-min-width);

> * {
width: subtract(subtract(var(--#{$prefix}side-nav-max-width), var(--#{$prefix}side-nav-min-width)), var(--#{$prefix}side-nav-border-width));
height: 0;
}
}

.side-nav-content {
position: absolute;
flex-direction: column;
width: 100%;
}
}
25 changes: 23 additions & 2 deletions scss/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2240,11 +2240,11 @@ $btn-close-white-disabled-color: $gray-700 !default; // Boosted mod
// scss-docs-start offcanvas-variables
$offcanvas-padding-y: $modal-inner-padding !default;
$offcanvas-padding-x: $modal-inner-padding !default;
$offcanvas-horizontal-width: 400px !default;
$offcanvas-horizontal-width: 300px !default; // Boosted mod: instead of `400px`
$offcanvas-vertical-height: 30vh !default;
$offcanvas-transition-duration: .3s !default;
$offcanvas-border-color: $modal-content-border-color !default;
$offcanvas-border-width: $modal-content-border-width !default;
$offcanvas-border-width: 1px !default; // Boosted mod: instead of `$modal-content-border-width`
$offcanvas-title-line-height: $modal-title-line-height !default;
MewenLeHo marked this conversation as resolved.
Show resolved Hide resolved
$offcanvas-bg-color: $modal-content-bg !default; // Boosted mod: instead of `var(--#{$prefix}body-bg)`
$offcanvas-color: $modal-content-color !default; // Boosted mod: instead of `var(--#{$prefix}body-color)`
Expand Down Expand Up @@ -2422,6 +2422,27 @@ $footer-gap: $spacer * .75 !default;
$footer-gap-xl: $spacer * 1.7 !default;
// scss-docs-end footer

//// Side navigation
// scss-docs-start side-nav-variables
$side-nav-min-width: calc(var(--#{$prefix}side-nav-item-icon-size) + var(--#{$prefix}side-nav-item-spacing) * 2 - var(--#{$prefix}side-nav-border-width)) !default; // stylelint-disable-line function-disallowed-list
$side-nav-max-width: $offcanvas-horizontal-width !default;
$side-nav-bg: $offcanvas-bg-color !default;
$side-nav-border-width: 1px !default;
$side-nav-border-color: $offcanvas-border-color !default;

$side-nav-item-min-height: $spacer * 2 !default;
$side-nav-item-icon-size: $spacer * 1.25 !default;
$side-nav-item-spacing: 15px !default;
$side-nav-item-padding-top: 8px !default;
$side-nav-item-padding-end: 0 !default;
$side-nav-item-padding-bottom: 10px !default;
$side-nav-item-padding-start: 15px !default;
MewenLeHo marked this conversation as resolved.
Show resolved Hide resolved
$side-nav-item-color: var(--#{$prefix}body-color) !default;
$side-nav-item-hover-bg: var(--#{$prefix}secondary-bg) !default;
$side-nav-item-active-bg: var(--#{$prefix}tertiary-active-bg) !default;
$side-nav-item-active-border: var(--#{$prefix}primary) !default;
// scss-docs-end side-nav-variables
// End mod

// Tags

Expand Down
1 change: 1 addition & 0 deletions scss/boosted.scss
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
@import "footer";
@import "local-navigation";
@import "orange-navbar";
@import "side-navigation";
@import "stepped-process";
@import "sticker";
@import "title-bars";
Expand Down
9 changes: 9 additions & 0 deletions site/assets/scss/_component-examples.scss
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,15 @@
}

// Boosted mod
.side-nav-example {
overflow: auto;
resize: vertical;

@include media-breakpoint-up(lg) {
height: 21.875rem;
}
}

.simple-list-example-scrollspy .active {
color: var(--bs-primary);
}
Expand Down
1 change: 1 addition & 0 deletions site/content/docs/5.3/about/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Boosted ships with custom accessible components to suit specific needs:
- [Local navigation]({{< docsref "/components/local-navigation" >}})
- [Orange navbar]({{< docsref "/components/orange-navbar" >}})
- [Quantity selector]({{< docsref "/forms/quantity-selector" >}})
- [Side navigation]({{< docsref "/components/side-navigation" >}})
- [Star rating]({{< docsref "/forms/checks-radios#star-rating" >}})
- [Stepped process]({{< docsref "/components/stepped-process" >}})
- [Sticker]({{< docsref "/components/sticker" >}})
Expand Down
Loading