-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(component): breadcrumb was refactored and renamed
- Loading branch information
1 parent
6841892
commit d22d45b
Showing
2 changed files
with
170 additions
and
6 deletions.
There are no files selected for viewing
144 changes: 144 additions & 0 deletions
144
packages/components/src/components/post-breadcrumb/post-breadcrumb.scss
This file contains 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,144 @@ | ||
@use '@swisspost/design-system-styles/placeholders/color' as color-ph; | ||
@use '@swisspost/design-system-styles/components/button'; | ||
@use '@swisspost/design-system-styles/components/grid'; | ||
@use '@swisspost/design-system-styles/components/spinner'; | ||
@use '@swisspost/design-system-styles/variables/color'; | ||
@use '@swisspost/design-system-styles/functions'; | ||
@use '@swisspost/design-system-styles/mixins/utilities'; | ||
@use '@swisspost/design-system-styles/variables/components/button' as button-var; | ||
:host { | ||
@extend %color-background-light-variables; | ||
|
||
display: block; | ||
position: relative; | ||
} | ||
|
||
.breadcrumbs { | ||
display: flex; | ||
align-items: center; | ||
justify-content: start; | ||
} | ||
|
||
.breadcrumbs-nav { | ||
white-space: nowrap; | ||
// Make the nav take all the available space, used for concatenation calculation | ||
flex-grow: 1; | ||
flex-shrink: 1; | ||
min-width: 0; | ||
} | ||
|
||
.breadcrumbs-list, | ||
.nav-link { | ||
display: flex; | ||
align-items: center; | ||
} | ||
|
||
.home-icon { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
|
||
.breadcrumbs-list { | ||
li { | ||
display: flex; | ||
// First and middle breadcrumbs should never shrink. If there's not enough space -> collapse | ||
flex-shrink: 0; | ||
|
||
&:last-child { | ||
// Ellipsis for very small viewports or very long last item paths | ||
flex-shrink: 2; | ||
min-width: 0; | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
} | ||
} | ||
} | ||
|
||
.nav-link { | ||
gap: 0; | ||
color: rgba(color.$black, 0.6); | ||
font-weight: 400; | ||
} | ||
|
||
.middle-dropdown-container { | ||
position: relative; | ||
display: flex; | ||
align-items: center; | ||
} | ||
|
||
.middle-dropdown { | ||
position: absolute; | ||
top: 100%; | ||
left: 0; | ||
background: white; | ||
border: 1px solid color.$gray-10; | ||
padding: 0.5rem 0; | ||
z-index: 1; | ||
} | ||
|
||
.visually-hidden { | ||
@include utilities.visuallyhidden(); | ||
} | ||
|
||
.middle-dropdown-button { | ||
cursor: pointer; | ||
display: flex; | ||
align-items: center; | ||
gap: 0.25rem; | ||
width: 1.5em; | ||
height: 1.5em; | ||
min-height: 0; | ||
font-size: inherit; | ||
color: inherit; | ||
|
||
span { | ||
margin: 0; | ||
} | ||
} | ||
|
||
.overlay { | ||
display: flex; | ||
align-items: center; | ||
position: fixed; | ||
top: 0; | ||
left: 0; | ||
width: 100%; | ||
height: 100%; | ||
background: rgba(0, 0, 0, 0.6); | ||
z-index: calc(var(--header-z-index, 10) + 1); | ||
opacity: 0; | ||
visibility: hidden; | ||
transition: opacity 500ms, visibility 0s 500ms; | ||
|
||
&.open { | ||
visibility: visible; | ||
opacity: 1; | ||
transition: opacity 500ms, visibility 0s 0s; | ||
} | ||
} | ||
|
||
.loader-wrapper { | ||
position: absolute; | ||
display: grid; | ||
place-items: center; | ||
width: 100%; | ||
height: 100%; | ||
top: 0; | ||
left: 0; | ||
} | ||
|
||
.loaded .loader-wrapper { | ||
display: none; | ||
} | ||
|
||
.hidden-control-breadcrumbs { | ||
position: absolute; | ||
opacity: 0; | ||
pointer-events: none; | ||
z-index: -1; | ||
|
||
.breadcrumbs-nav { | ||
flex-shrink: 0; | ||
} | ||
} |
This file contains 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