-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add semantic layer token machinery #3349
Merged
gfellerph
merged 29 commits into
main
from
3310-tokens-set-up-semantic-layer-for-channels
Aug 12, 2024
Merged
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
8800cad
feat: add device tokens
gfellerph 1d4ac31
feat: add color mode styles
gfellerph 8c98caa
feat: add the rest of the semantic layer
gfellerph e84b51e
feat: add semantic layer token machinery
gfellerph 4798c4a
Revert "feat: add semantic layer token machinery"
gfellerph 310e044
feat: add token only output targets
gfellerph 305ff06
feat: add missing core tokens
gfellerph 684693c
chore: add changeset
gfellerph 21b2718
fix: use more specific media queries
gfellerph f2621eb
hoist token definitions
gfellerph ef0b1c1
add temporary copy workaround
gfellerph bb19961
import tokens into docs
gfellerph cbafb2e
set button primary fore- and background with tokens
gfellerph 1d7ba3a
implement light-dark (with a workaround)
gfellerph 8b9c454
rename mode placeholders
gfellerph aba68d5
Revert light-dark experiment
gfellerph ffea852
Revert "set button primary fore- and background with tokens"
gfellerph 783ab0f
Merge branch 'main' into 3310-tokens-set-up-semantic-layer-for-channels
gfellerph b836913
Update packages/documentation/.storybook/styles/preview.scss
gfellerph 97ffe7f
Update packages/styles/gulpfile.js
gfellerph fcf60fc
Update packages/styles/gulpfile.js
gfellerph a047516
Update packages/styles/gulpfile.js
gfellerph 0c86132
Update .changeset/large-weeks-tap.md
gfellerph b2e6462
Update packages/styles/src/mixins/_media.scss
gfellerph c3acc68
Update packages/styles/src/mixins/_media.scss
gfellerph 2afbe7f
Update packages/styles/src/mixins/_tokens.scss
gfellerph f0ed82a
Update packages/styles/src/mixins/_tokens.scss
gfellerph 68fdfd1
chore: add comment to gulpfile about temporary fix
gfellerph 11dac21
Merge branch '3310-tokens-set-up-semantic-layer-for-channels' of http…
gfellerph File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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': minor | ||
--- | ||
|
||
Added four new entry files that enable working with Design Tokens: | ||
|
||
- post-external.(s)css: For portal and other external pages | ||
- post-internal.(s)css: For applications and other internal pages | ||
- post-tokens-external.(s)css: External tokens only | ||
- post-tokens-internal.(s)css: Internal tokens only |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,6 @@ storybook-static | |
# Mac OSX Finder files. | ||
**/.DS_Store | ||
.DS_Store | ||
|
||
# Temporary files | ||
src/tokens/temp/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
@mixin min($device-size) { | ||
@media screen and (min-width: $device-size) { | ||
@content; | ||
} | ||
} | ||
|
||
@mixin max($device-size) { | ||
@media screen and (max-width: ($device-size - 0.01)) { | ||
@content; | ||
} | ||
} | ||
|
||
@mixin between($min-size, $max-size) { | ||
@media screen and (min-width: $min-size) and (max-width: ($max-size - 0.01)) { | ||
@content; | ||
} | ||
} |
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 @@ | ||
@mixin from($map) { | ||
@each $key, $value in $map { | ||
--#{$key}: #{$value}; | ||
} | ||
} |
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 @@ | ||
@use '../tokens/temp/mode' as mode; | ||
@use './../mixins/tokens'; | ||
|
||
%color-mode-light { | ||
@include tokens.from(mode.$post-light); | ||
} | ||
|
||
%color-mode-dark { | ||
@include tokens.from(mode.$post-dark); | ||
} |
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,2 @@ | ||
@use './post-tokens-external'; | ||
@use './components'; |
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,2 @@ | ||
@use './post-tokens-internal'; | ||
@use './components'; |
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,4 @@ | ||
@use './tokens/modes'; | ||
@use './tokens/device'; | ||
@use './tokens/external'; | ||
@use './tokens/post-theme'; |
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,4 @@ | ||
@use './tokens/modes'; | ||
@use './tokens/device'; | ||
@use './tokens/internal'; | ||
@use './tokens/post-theme'; |
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 @@ | ||
@use './temp/core'; |
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,19 @@ | ||
@use './temp/device' as device; | ||
|
||
@use './core'; | ||
@use './../mixins/tokens'; | ||
@use './../mixins/media'; | ||
|
||
:root { | ||
@include media.max(600px) { | ||
@include tokens.from(device.$post-mobile); | ||
} | ||
oliverschuerch marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
@include media.between(600px, 1024px) { | ||
@include tokens.from(device.$post-tablet); | ||
} | ||
|
||
@include media.min(1024px) { | ||
@include tokens.from(device.$post-desktop); | ||
} | ||
} |
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 @@ | ||
@use './temp/channel' as channel; | ||
|
||
@use './core'; | ||
@use './../mixins/tokens'; | ||
|
||
:root { | ||
oliverschuerch marked this conversation as resolved.
Show resolved
Hide resolved
|
||
@include tokens.from(channel.$post-edk); | ||
} |
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 @@ | ||
@use './temp/channel' as channel; | ||
|
||
@use './core'; | ||
@use './../mixins/tokens'; | ||
|
||
:root { | ||
@include tokens.from(channel.$post-idk); | ||
} |
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,11 @@ | ||
@use './core'; | ||
@use './../placeholders/modes'; | ||
|
||
:root, | ||
[data-color-mode='light'] { | ||
@extend %color-mode-light; | ||
} | ||
|
||
[data-color-mode='dark'] { | ||
@extend %color-mode-dark; | ||
} |
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 @@ | ||
@use './temp/theme' as themes; | ||
|
||
@use './core'; | ||
@use './../mixins/tokens'; | ||
|
||
:root { | ||
@include tokens.from(themes.$post-theme); | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the breakpoints be tokenized too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we were talking about this. We'll update this once they are (also, there might be two more).