-
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.
Co-authored-by: Philipp Gfeller <[email protected]>
- Loading branch information
1 parent
2cebad2
commit 8d4a5aa
Showing
18 changed files
with
731 additions
and
16 deletions.
There are no files selected for viewing
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,6 @@ | ||
--- | ||
'@swisspost/design-system-documentation': minor | ||
'@swisspost/design-system-components': minor | ||
--- | ||
|
||
Added the `post-breadcrumb` component to provide a standalone breadcrumb navigation solution. |
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
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
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
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
203 changes: 203 additions & 0 deletions
203
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,203 @@ | ||
@use 'sass:map'; | ||
@use '@swisspost/design-system-styles/mixins/media'; | ||
@use '@swisspost/design-system-styles/functions/tokens'; | ||
@use '@swisspost/design-system-styles/tokens/components'; | ||
@use '@swisspost/design-system-styles/tokens/elements'; | ||
@use '@swisspost/design-system-styles/mixins/utilities'; | ||
@use '@swisspost/design-system-styles/core' as post; | ||
@use '@swisspost/design-system-styles/tokens/helpers'; | ||
|
||
tokens.$default-map: components.$post-breadcrumb; | ||
|
||
:host { | ||
display: flex; | ||
align-items: center; | ||
} | ||
|
||
.breadcrumbs-nav { | ||
display: flex; | ||
align-items: center; | ||
|
||
} | ||
|
||
.hidden-items { | ||
gap: tokens.get('breadcrumb-gap-inline-outer'); | ||
position: absolute; | ||
height: 0; | ||
overflow: hidden; | ||
white-space: nowrap; | ||
} | ||
|
||
.breadcrumbs-list { | ||
display: flex; | ||
flex-wrap: nowrap; | ||
position: relative; | ||
margin: 0; | ||
padding: 0; | ||
list-style: none; | ||
align-items: center; | ||
height: 100%; | ||
gap: tokens.get('breadcrumb-gap-inline-outer'); | ||
} | ||
|
||
post-icon { | ||
display: inline-block; | ||
box-sizing: border-box; | ||
color: tokens.get('breadcrumb-enabled-fg'); | ||
height: tokens.get('breadcrumb-icon-size'); | ||
width: tokens.get('breadcrumb-icon-size'); | ||
} | ||
|
||
.breadcrumb-item-icon { | ||
padding-block: tokens.get('breadcrumb-padding-block-icon-link'); | ||
padding-inline: tokens.get('breadcrumb-padding-inline-icon-link'); | ||
} | ||
|
||
li { | ||
a { | ||
display: flex; | ||
align-items: center; | ||
@include utilities.focus-style; | ||
|
||
&:focus { | ||
border-radius: tokens.get('focus-border-radius', helpers.$post-focus); | ||
} | ||
|
||
.home-icon { | ||
padding-block: tokens.get('breadcrumb-padding-block-icon-home'); | ||
padding-inline: tokens.get('breadcrumb-padding-inline-icon-home'); | ||
|
||
&:hover { | ||
color: tokens.get('breadcrumb-hover-fg'); | ||
} | ||
|
||
@include utilities.high-contrast-mode() { | ||
a, | ||
&:focus, | ||
&:hover { | ||
color: CanvasText !important; | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
.menu-trigger-wrapper { | ||
display: flex; | ||
align-items: center; | ||
gap: tokens.get('breadcrumb-gap-inline-inner'); | ||
} | ||
|
||
.actual-menu { | ||
display: flex; | ||
align-items: center; | ||
} | ||
|
||
post-menu-trigger { | ||
display: flex; | ||
align-items: center; | ||
padding-block: tokens.get('breadcrumb-padding-block-text'); | ||
@include utilities.focus-style; | ||
|
||
&:focus { | ||
border-radius: tokens.get('focus-border-radius', helpers.$post-focus); | ||
} | ||
|
||
button { | ||
background: none; | ||
border: none; | ||
line-height: 150%; | ||
font-size: tokens.get('body-font-size', elements.$post-body); | ||
cursor: pointer; | ||
padding: 0; | ||
color: tokens.get('breadcrumb-enabled-fg'); | ||
|
||
&:hover { | ||
color: tokens.get('breadcrumb-hover-fg'); | ||
} | ||
|
||
@include utilities.high-contrast-mode() { | ||
a, | ||
&:focus, | ||
&:hover { | ||
color: LinkText !important; | ||
} | ||
} | ||
} | ||
} | ||
|
||
post-menu::part(popover-container) { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: start; | ||
padding: 0.6rem; | ||
gap: tokens.get('breadcrumb-gap-inline-outer'); | ||
|
||
::slotted(post-menu-item:not(:last-child)) { | ||
margin-bottom: tokens.get('breadcrumb-gap-inline-outer'); | ||
} | ||
} | ||
|
||
.breadcrumb-item { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
gap: tokens.get('breadcrumb-gap-inline-inner'); | ||
|
||
a { | ||
text-decoration: none; | ||
color: inherit; | ||
line-height: 150%; | ||
padding-block: tokens.get('breadcrumb-padding-block-text'); | ||
font-size: tokens.get('body-font-size', elements.$post-body); | ||
@include utilities.focus-style; | ||
|
||
&:hover { | ||
color: tokens.get('breadcrumb-hover-fg'); | ||
text-decoration: tokens.get('breadcrumb-link-hover-text-decoration'); | ||
} | ||
|
||
&:focus-visible { | ||
border-radius: tokens.get('focus-border-radius', helpers.$post-focus); | ||
} | ||
} | ||
|
||
span { | ||
&:hover { | ||
color: tokens.get('breadcrumb-hover-fg'); | ||
text-decoration: tokens.get('breadcrumb-link-hover-text-decoration'); | ||
} | ||
|
||
&:focus-visible { | ||
border-radius: tokens.get('focus-border-radius', helpers.$post-focus); | ||
} | ||
} | ||
|
||
@include utilities.high-contrast-mode() { | ||
a, | ||
&:focus, | ||
&:hover { | ||
color: LinkText !important; | ||
} | ||
|
||
&:visited { | ||
color: VisitedText !important; | ||
} | ||
} | ||
} | ||
|
||
post-breadcrumb-item:last-of-type { | ||
pointer-events: none; | ||
color: tokens.get('breadcrumb-selected-fg'); | ||
font-weight: tokens.get('breadcrumb-selected-font-weight'); | ||
text-decoration: tokens.get('breadcrumb-link-selected-text-decoration'); | ||
|
||
&:hover { | ||
color: tokens.get('breadcrumb-selected-fg'); | ||
text-decoration: none; | ||
} | ||
} | ||
|
||
.visually-hidden { | ||
@include post.visually-hidden(); | ||
} |
Oops, something went wrong.