-
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.
feat(documentation): add active state to version switch (#3050)
Co-authored-by: Oliver Schürch <[email protected]>
- Loading branch information
1 parent
8bc46eb
commit 12e475e
Showing
3 changed files
with
108 additions
and
93 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
68 changes: 40 additions & 28 deletions
68
packages/documentation/.storybook/addons/version-switcher/version-switcher.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 |
---|---|---|
@@ -1,52 +1,64 @@ | ||
@use '@swisspost/design-system-styles/variables/type'; | ||
@use '@swisspost/design-system-styles/variables/spacing'; | ||
@use '@swisspost/design-system-styles/core' as post; | ||
|
||
.version-switcher-loading { | ||
.version-switcher__loading { | ||
display: flex; | ||
align-items: center; | ||
font-size: type.$font-size-14; | ||
font-size: post.$font-size-14; | ||
} | ||
|
||
.version-switcher-dropdown { | ||
.version_switcher__sizing_placeholder { | ||
visibility: hidden !important; | ||
} | ||
|
||
.version-switcher__dropdown { | ||
display: flex; | ||
flex-flow: column nowrap; | ||
gap: post.$size-line; | ||
position: absolute; | ||
top: -5px; | ||
right: 0; | ||
padding: post.$size-mini; | ||
background-color: var(--post-light); | ||
font-size: type.$font-size-14; | ||
border: post.$border-width solid post.$border-color; | ||
border-radius: post.$border-radius; | ||
font-size: post.$font-size-sm; | ||
|
||
.version-switcher-dropdown-item { | ||
padding: spacing.$size-mini spacing.$size-small-regular; | ||
.dropdown__item { | ||
display: block; | ||
padding: post.$size-mini post.$size-small-regular; | ||
border-radius: post.$border-radius-sm; | ||
text-decoration: none; | ||
color: inherit; | ||
|
||
& + .version-switcher-dropdown-item { | ||
border-top: 1px solid var(--post-black); | ||
&:hover { | ||
background-color: post.$gray-10; | ||
} | ||
|
||
&:hover { | ||
background-color: var(--post-gray-10); | ||
&.active { | ||
background-color: post.$yellow; | ||
} | ||
} | ||
} | ||
|
||
.version-switcher-dependencies { | ||
margin-top: spacing.$size-micro; | ||
font-size: type.$font-size-12; | ||
border-spacing: 0; | ||
.item__title { | ||
display: block; | ||
} | ||
|
||
td { | ||
width: 12ch; | ||
& + td { | ||
padding: spacing.$size-micro; | ||
} | ||
.item__deps { | ||
display: flex; | ||
gap: post.$size-small-regular; | ||
} | ||
|
||
span { | ||
.deps_dep { | ||
display: flex; | ||
align-items: center; | ||
gap: spacing.$size-micro; | ||
gap: post.$size-line; | ||
font-size: 85%; | ||
} | ||
|
||
img { | ||
max-width: 1.5em; | ||
} | ||
.dep__icon { | ||
display: block; | ||
height: 1.1em; | ||
} | ||
|
||
.dep__version { | ||
} | ||
} |
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