-
Notifications
You must be signed in to change notification settings - Fork 57
Side navigation #1349
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
Open
louismaximepiton
wants to merge
47
commits into
main
Choose a base branch
from
main-lmp-side-navigation
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Side navigation #1349
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 14a888d
Strongly WIP but collapsing content seems to work
louismaximepiton 41cdcdc
Working sample without js
louismaximepiton 5f10df1
Adding focus + resolving much bugs + CSS var
louismaximepiton 8d31d11
Fix pa11y
louismaximepiton a60f1c1
Fix some bugs
louismaximepiton b610a45
CSS trim + fix some known issues
louismaximepiton 11adbcf
Perfect config but with focus issues on the last one
louismaximepiton 0ec309e
.
louismaximepiton b39a02d
Fix issues + add static side navigation
louismaximepiton d30d9fb
Adding example in collapsible with content + handle overflow
louismaximepiton dd4fb61
Fix from reviews
louismaximepiton 222d9c8
Handle scrollbar
louismaximepiton ad4b8ce
Changing the doc + handle some minor bugs
louismaximepiton 840a88c
Fix CI
louismaximepiton a418627
Merge branch 'main' into main-lmp-side-navigation
louismaximepiton 9479542
Implementing design things
louismaximepiton 8d5997e
Merge branch 'main' into main-lmp-side-navigation
louismaximepiton 8bd27b3
Refactoring of side-nav to allow a better scrollable region + unlink …
louismaximepiton 8be1c39
.
louismaximepiton 7c724d9
Enhance doc + bundlewatch + cspell + envariable the component + small…
louismaximepiton 5100a3d
Add references + migration guide
louismaximepiton b57f58b
.
louismaximepiton 898d32a
Merge branch 'main' into main-lmp-side-navigation
louismaximepiton af141d2
.
louismaximepiton cace4c9
Merge branch 'main' into main-lmp-side-navigation
louismaximepiton 5801612
A11y fixes
louismaximepiton 68972e5
Merge branch 'main' into main-lmp-side-navigation
louismaximepiton fdeeb6d
.
louismaximepiton cd00944
fix(review)
louismaximepiton 29c88c0
Merge branch 'main' into main-lmp-side-navigation
louismaximepiton edf03ee
Merge branch 'main' into main-lmp-side-navigation
MewenLeHo 3047eb8
fix(review)
louismaximepiton a9534a5
Adding StoryBook stories
louismaximepiton 5098e64
Merge branch 'main' into main-lmp-side-navigation
louismaximepiton 665161c
Merge branch 'main' into main-lmp-side-navigation
louismaximepiton 0469c09
Remove multiline comments
louismaximepiton 3d97717
Remove with drawer variant to ease the reviews.
louismaximepiton 416816b
Remove with drawer variant to ease the reviews.
louismaximepiton f144d9f
.
louismaximepiton 8f5c0f7
Fix CI jobs
louismaximepiton 9fe52be
fix(review)
louismaximepiton fe7d066
Merge branch 'main' into main-lmp-side-navigation
louismaximepiton 121721c
Merge branch 'main' into main-lmp-side-navigation
louismaximepiton 51f326f
Fix after dark mode
louismaximepiton 3d08750
.
louismaximepiton 2fb3373
.
louismaximepiton File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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%; | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.