@swisspost/design-system-styles 10.6.0 → 10.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/README.md +28 -23
  2. package/_svg-icon-map.scss +8 -4
  3. package/basics.css +1 -1
  4. package/cargo-compact.css +1 -1
  5. package/cargo-condensed.css +1 -0
  6. package/cargo-condensed.scss +12 -0
  7. package/cargo-default.css +1 -1
  8. package/cargo-tokens-compact.css +1 -1
  9. package/cargo-tokens-condensed.css +1 -0
  10. package/cargo-tokens-condensed.scss +8 -0
  11. package/cargo-tokens-default.css +1 -1
  12. package/components/avatar.css +1 -1
  13. package/components/blockquote.css +1 -1
  14. package/components/blockquote.scss +4 -1
  15. package/components/button-group.css +1 -1
  16. package/components/button.css +1 -1
  17. package/components/button.scss +5 -0
  18. package/components/card.css +1 -1
  19. package/components/checkbox.css +1 -1
  20. package/components/chip.css +1 -1
  21. package/components/dialog.css +1 -1
  22. package/components/dialog.scss +21 -6
  23. package/components/form-input.css +1 -1
  24. package/components/form-input.scss +3 -1
  25. package/components/form-search-input.css +1 -1
  26. package/components/form-select.css +1 -1
  27. package/components/form-select.scss +3 -2
  28. package/components/form-textarea.css +1 -1
  29. package/components/form-textarea.scss +3 -1
  30. package/components/header/index.css +1 -1
  31. package/components/inline-notification.css +1 -1
  32. package/components/inline-notification.scss +32 -15
  33. package/components/list-check.css +1 -1
  34. package/components/list-check.scss +18 -53
  35. package/components/list-interactive.css +1 -1
  36. package/components/palette.css +1 -1
  37. package/components/radio-button.css +1 -1
  38. package/components/segmented-button.css +1 -1
  39. package/components/selection-card.css +1 -1
  40. package/components/selection-card.scss +2 -1
  41. package/components/skiplinks.css +1 -1
  42. package/components/switch.css +1 -1
  43. package/components/tabs/index.css +1 -1
  44. package/components/tag.css +1 -1
  45. package/components/tag.scss +2 -1
  46. package/components/toast.css +1 -1
  47. package/components/toast.scss +2 -1
  48. package/elements/anchor.css +1 -1
  49. package/functions/_env.scss +12 -0
  50. package/functions/_icons.scss +4 -3
  51. package/functions/_index.scss +1 -0
  52. package/helpers/focus-ring.css +1 -1
  53. package/mixins/_button.scss +12 -1
  54. package/mixins/_color-scheme.scss +48 -17
  55. package/mixins/_notification.scss +2 -1
  56. package/mixins/_utilities.scss +22 -29
  57. package/package.json +5 -5
  58. package/placeholders/_button.scss +1 -0
  59. package/post-compact.css +1 -1
  60. package/post-condensed.css +1 -0
  61. package/post-condensed.scss +12 -0
  62. package/post-default.css +1 -1
  63. package/post-tokens-compact.css +1 -1
  64. package/post-tokens-condensed.css +1 -0
  65. package/post-tokens-condensed.scss +8 -0
  66. package/post-tokens-default.css +1 -1
  67. package/tokens/_appearance-condensed.scss +11 -0
  68. package/tokens/_device-condensed.scss +10 -0
  69. package/tokens/_schemes.scss +2 -8
  70. package/utilities/_env-variables.scss +1 -1
@@ -72,6 +72,26 @@
72
72
  }
73
73
  }
74
74
 
75
+ @mixin focus-visible($additional-selector: '') {
76
+ // These selectors are deliberately kept separate and are not grouped in a single :is() selector,
77
+ // because Stencil's CSS minifier corrupts selector lists that repeat an :is() group containing :has().
78
+ // See https://github.com/stenciljs/core/issues/6894.
79
+ @each $focus-selector in ':focus-visible', '.pretend-focus', ':has(:focus-visible)' {
80
+ &#{$focus-selector}#{$additional-selector} {
81
+ @content;
82
+ }
83
+ }
84
+
85
+ // When a browser doesn't support :has, use focus-within as a fallback.
86
+ // This means that focus state is displayed on focus and not on focus-visible only (except some browsers like Safari).
87
+ // This list contains no nested parentheses, so it is safe to group it in a single :is() selector.
88
+ @supports not selector(:has(:focus-visible)) {
89
+ &:is(:focus-visible, :focus-within, .pretend-focus)#{$additional-selector} {
90
+ @content;
91
+ }
92
+ }
93
+ }
94
+
75
95
  @mixin focus-style-none {
76
96
  outline: none !important;
77
97
  }
@@ -86,8 +106,7 @@
86
106
  tokens.get('focus-outline-width', helpers.$post-focus) !important;
87
107
  }
88
108
 
89
- // :has(:focus-visible) mimic a focus-visible-within pseudo-class
90
- &:is(:focus-visible, :has(:focus-visible), .pretend-focus)#{$additional-selector} {
109
+ @include focus-visible($additional-selector) {
91
110
  outline-style: tokens.get('focus-border-style', helpers.$post-focus) !important;
92
111
  // In case rules need to be slightly adjusted
93
112
  @content;
@@ -96,19 +115,6 @@
96
115
  outline-color: Highlight !important;
97
116
  }
98
117
  }
99
-
100
- // When a browser doesn't support :has, use focus-within as a fallback. This means that focus state is displayed on focus and not on focus-visible only (except some browsers like Safari).
101
- @supports not selector(:has(:focus-visible)) {
102
- &:is(:focus-visible, :focus-within, .pretend-focus)#{$additional-selector} {
103
- outline-style: tokens.get('focus-border-style', helpers.$post-focus) !important;
104
- // In case rules need to be slightly adjusted
105
- @content;
106
-
107
- @include high-contrast-mode() {
108
- outline-color: Highlight !important;
109
- }
110
- }
111
- }
112
118
  }
113
119
 
114
120
  // this mixin should only be used if the default focus ring is not fully visible
@@ -128,8 +134,7 @@
128
134
  outline: $outline-color none tokens.get('focus-outline-width', helpers.$post-focus) !important;
129
135
  }
130
136
 
131
- // :has(:focus-visible) mimic a focus-visible-within pseudo-class
132
- &:is(:focus-visible, :has(:focus-visible), .pretend-focus)#{$additional-selector} {
137
+ @include focus-visible($additional-selector) {
133
138
  outline-style: tokens.get('focus-border-style', helpers.$post-focus) !important;
134
139
  @content;
135
140
 
@@ -137,18 +142,6 @@
137
142
  outline-color: Highlight !important;
138
143
  }
139
144
  }
140
-
141
- // When a browser doesn't support :has, use focus-within as a fallback. This means that focus state is displayed on focus and not on focus-visible only (except some browsers like Safari).
142
- @supports not selector(:has(:focus-visible)) {
143
- &:is(:focus-visible, :focus-within, .pretend-focus)#{$additional-selector} {
144
- outline-style: tokens.get('focus-border-style', helpers.$post-focus) !important;
145
- @content;
146
-
147
- @include high-contrast-mode() {
148
- outline-color: Highlight !important;
149
- }
150
- }
151
- }
152
145
  }
153
146
 
154
147
  @mixin focus-hover-style-custom($additional-selector: '') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swisspost/design-system-styles",
3
- "version": "10.6.0",
3
+ "version": "10.8.0",
4
4
  "description": "Design System Styles for the Swiss Post web platform.",
5
5
  "author": "Swiss Post <design-system@post.ch>",
6
6
  "license": "Apache-2.0",
@@ -19,12 +19,12 @@
19
19
  "linkDirectory": true
20
20
  },
21
21
  "dependencies": {
22
- "@swisspost/design-system-icons": "10.6.0",
23
- "@swisspost/design-system-tokens": "10.6.0"
22
+ "@swisspost/design-system-icons": "10.8.0",
23
+ "@swisspost/design-system-tokens": "10.8.0"
24
24
  },
25
25
  "devDependencies": {
26
- "@swisspost/design-system-prettier-config": "10.5.0",
27
- "@swisspost/design-system-stylelint-config": "10.5.0",
26
+ "@swisspost/design-system-prettier-config": "10.8.0",
27
+ "@swisspost/design-system-stylelint-config": "10.8.0",
28
28
  "@types/node": "24.0.0",
29
29
  "autoprefixer": "10.5.0",
30
30
  "copyfiles": "2.4.1",
@@ -21,5 +21,6 @@ tokens.$default-map: components.$post-button;
21
21
 
22
22
  %btn {
23
23
  @include button-mx.button-base;
24
+ @include button-mx.button-label-wrap;
24
25
  @include button-mx.button-size;
25
26
  }