-
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: update color variables (#2861)
- Loading branch information
1 parent
3c1c7de
commit df3a936
Showing
56 changed files
with
452 additions
and
294 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,10 @@ | ||
--- | ||
'@swisspost/design-system-styles': major | ||
'@swisspost/internet-header': patch | ||
'@swisspost/design-system-documentation': patch | ||
'@swisspost/design-system-demo': patch | ||
--- | ||
|
||
Refactored brand colors. Renamed `$gray-background` SCSS variable to `$gray` and removed `$gray-background-light` variable because it is a duplication of the already existing variable `$light`. | ||
|
||
Updated the usage of said variables in dependant packages accordingly. |
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,8 @@ | ||
--- | ||
'@swisspost/design-system-styles': minor | ||
'@swisspost/design-system-documentation': minor | ||
'@swisspost/design-system-components': patch | ||
--- | ||
|
||
Added new black and white alpha colors. | ||
Replaced hardcoded alpha colors with the new color definitions in `card-control` component. |
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,13 @@ | ||
--- | ||
'@swisspost/design-system-styles': major | ||
'@swisspost/design-system-documentation': patch | ||
'@swisspost/design-system-components': patch | ||
'@swisspost/design-system-demo': patch | ||
--- | ||
|
||
- Removed variables `$success-green`, `$error-red`, `$warning-orange`, `$success-text`, `$error-text`, `$danger` as well as the Sass map `$contextual-colors`. | ||
Instead use the variables `$success`, `$error`, `$warning`, `$error` and the Sass map `$signal-colors`. | ||
- Updated the Sass map `$signal-colors` keys and added a new Sass map `$signal-background-colors`. | ||
- Updated the Sass map `$background-colors` and all the dependant packages accordingly. | ||
|
||
With the exception of the components `notification`, `toast` and `tag`, there is no component providing a `danger` variant anymore. Instead use the `error` variant. |
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-styles': minor | ||
--- | ||
|
||
Added new focus color variables. |
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,3 +1,3 @@ | ||
export const ALERT_TYPES = ['primary', 'success', 'danger', 'warning', 'info', 'gray'] as const; | ||
export const ALERT_TYPES = ['primary', 'success', 'warning', 'danger', 'info', 'gray'] as const; | ||
|
||
export type AlertType = typeof ALERT_TYPES[number]; | ||
export type AlertType = (typeof ALERT_TYPES)[number]; |
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
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
33 changes: 0 additions & 33 deletions
33
packages/documentation/src/stories/components/subnavigation/background.module.scss
This file was deleted.
Oops, something went wrong.
13 changes: 13 additions & 0 deletions
13
packages/documentation/src/stories/components/subnavigation/subnavigation.module.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,13 @@ | ||
@use 'sass:list'; | ||
@use 'sass:map'; | ||
@use '@swisspost/design-system-styles/core' as post; | ||
|
||
$background-classes: (); | ||
|
||
@each $key in map.keys(post.$background-colors) { | ||
$background-classes: list.append($background-classes, 'bg-#{$key}', $separator: comma); | ||
} | ||
|
||
:export { | ||
bg-classes: [$background-classes]; | ||
} |
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
6 changes: 6 additions & 0 deletions
6
packages/documentation/src/stories/components/tag/tag.module.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,6 @@ | ||
@use 'sass:map'; | ||
@use '@swisspost/design-system-styles/core' as post; | ||
|
||
:export { | ||
tag-backgrounds: [map.keys(post.$tag-backgrounds)]; | ||
} |
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
2 changes: 1 addition & 1 deletion
2
packages/documentation/src/stories/foundation/color/color-use-css.sample.css
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,3 +1,3 @@ | ||
.my-element { | ||
property: var(--post-dark); | ||
color: var(--post-gray-80); | ||
} |
6 changes: 5 additions & 1 deletion
6
packages/documentation/src/stories/foundation/color/color-use-scss.sample.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,5 +1,9 @@ | ||
@use 'sass:map'; | ||
@use '@swisspost/design-system-styles/core' as post; | ||
|
||
.my-element { | ||
property: post.$dark; | ||
// direct usage | ||
color: post.$gray-80; | ||
// map usage | ||
color: map.get(post.$post-grays, 'gray-80'); | ||
} |
Oops, something went wrong.