-
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 version switch active state to v6 (#3049)
Co-authored-by: Philipp Gfeller <[email protected]> Co-authored-by: Oliver Schürch <[email protected]>
- Loading branch information
1 parent
b3e9ac2
commit fcff18e
Showing
4 changed files
with
118 additions
and
97 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,5 @@ | ||
--- | ||
'@swisspost/design-system-documentation': patch | ||
--- | ||
|
||
Fixed version-switcher to show the same way like on design-system.post.ch. |
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
71 changes: 45 additions & 26 deletions
71
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,46 +1,65 @@ | ||
@use '../../../node_modules/@swisspost/design-system-styles/variables/type'; | ||
@use '../../../node_modules/@swisspost/design-system-styles/variables/spacing'; | ||
@use '@swisspost/design-system-styles/core' as post; | ||
|
||
.version-switcher-dropdown { | ||
.version-switcher__loading { | ||
display: flex; | ||
align-items: center; | ||
font-size: post.$font-size-14; | ||
} | ||
|
||
.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 { | ||
white-space: nowrap; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.