Skip to content

Commit

Permalink
chore: use layers for token entry files
Browse files Browse the repository at this point in the history
Wrapping tokens into a layer allows consuming projects to easily define the cascade order of the tokens, no matter at what position they get imported.
  • Loading branch information
gfellerph committed Oct 10, 2024
1 parent e4c188f commit 692d10d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .changeset/lovely-mirrors-travel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@swisspost/design-system-styles': patch
---

Wrapped new token only entry files in a CSS layer called 'design-system'. The two files affected are 'post-tokens-external.scss' and 'post-tokens-internal.scss' as well as their compiled CSS counterparts.
12 changes: 8 additions & 4 deletions packages/styles/src/post-tokens-external.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
@use './tokens/modes';
@use './tokens/device';
@use './tokens/external';
@use './tokens/post-theme';
@use 'sass:meta';

@layer design-system {
@include meta.load-css('./tokens/modes');
@include meta.load-css('./tokens/device');
@include meta.load-css('./tokens/external');
@include meta.load-css('./tokens/post-theme');
}
12 changes: 8 additions & 4 deletions packages/styles/src/post-tokens-internal.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
@use './tokens/modes';
@use './tokens/device';
@use './tokens/internal';
@use './tokens/post-theme';
@use 'sass:meta';

@layer design-system {
@include meta.load-css('./tokens/modes');
@include meta.load-css('./tokens/device');
@include meta.load-css('./tokens/internal');
@include meta.load-css('./tokens/post-theme');
}

0 comments on commit 692d10d

Please sign in to comment.