@swisspost/design-system-styles 9.0.0-next.2 → 9.0.0-next.21

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 (321) hide show
  1. package/_svg-icon-map.scss +85 -23
  2. package/basics.css +1 -1
  3. package/basics.scss +2 -6
  4. package/cargo-external.css +7 -0
  5. package/cargo-external.scss +10 -0
  6. package/cargo-internal.css +7 -0
  7. package/cargo-internal.scss +10 -0
  8. package/cargo-tokens-external.css +1 -0
  9. package/cargo-tokens-external.scss +8 -0
  10. package/cargo-tokens-internal.css +1 -0
  11. package/cargo-tokens-internal.scss +8 -0
  12. package/components/_form-check.scss +166 -0
  13. package/components/_index.scss +21 -13
  14. package/components/appstore-badge.css +1 -0
  15. package/components/appstore-badge.scss +18 -0
  16. package/components/avatar.css +1 -0
  17. package/components/avatar.scss +41 -0
  18. package/components/badge.css +1 -1
  19. package/components/badge.scss +8 -2
  20. package/components/banner.css +1 -0
  21. package/components/banner.scss +105 -0
  22. package/components/blockquote.css +1 -0
  23. package/components/blockquote.scss +46 -0
  24. package/components/breadcrumb.css +1 -1
  25. package/components/breadcrumb.scss +4 -24
  26. package/components/breakpoints.css +1 -0
  27. package/components/breakpoints.scss +17 -0
  28. package/components/button-group.css +1 -1
  29. package/components/button-group.scss +7 -6
  30. package/components/button.css +1 -1
  31. package/components/button.scss +41 -228
  32. package/components/card-control.css +1 -1
  33. package/components/card-control.scss +33 -24
  34. package/components/card.css +1 -1
  35. package/components/card.scss +72 -68
  36. package/components/checkbox.css +1 -0
  37. package/components/checkbox.scss +127 -0
  38. package/components/chip.css +1 -1
  39. package/components/chip.scss +9 -8
  40. package/components/close.css +1 -1
  41. package/components/close.scss +0 -2
  42. package/components/datatable.css +1 -3
  43. package/components/datatable.scss +22 -17
  44. package/components/datepicker.css +1 -1
  45. package/components/datepicker.scss +6 -22
  46. package/components/dialog.css +1 -1
  47. package/components/dialog.scss +26 -38
  48. package/components/dropdown.css +1 -1
  49. package/components/dropdown.scss +9 -6
  50. package/components/fonts.css +1 -1
  51. package/components/fonts.scss +7 -45
  52. package/components/form-footer.css +1 -0
  53. package/components/form-footer.scss +18 -0
  54. package/components/form-hint.css +1 -0
  55. package/components/form-hint.scss +15 -0
  56. package/components/form-input.css +1 -0
  57. package/components/form-input.scss +301 -0
  58. package/components/form-range.css +1 -1
  59. package/components/form-range.scss +9 -9
  60. package/components/form-search-input.css +1 -0
  61. package/components/form-search-input.scss +97 -0
  62. package/components/form-select.css +1 -1
  63. package/components/form-select.scss +266 -55
  64. package/components/form-textarea.css +1 -1
  65. package/components/form-textarea.scss +172 -9
  66. package/components/globals/_index.scss +1 -0
  67. package/components/globals/post-footer.css +1 -0
  68. package/components/globals/post-footer.scss +113 -0
  69. package/components/header/_mixins.scss +48 -0
  70. package/components/header/index.css +1 -0
  71. package/components/header/index.scss +131 -0
  72. package/components/icon-button.css +1 -0
  73. package/components/icon-button.scss +19 -0
  74. package/components/icon-close-button.css +1 -0
  75. package/components/icon-close-button.scss +29 -0
  76. package/components/intranet-header/_icon.scss +1 -1
  77. package/components/intranet-header/_index.scss +0 -2
  78. package/components/intranet-header/_language-chooser.scss +3 -2
  79. package/components/intranet-header/_nav-overflow.scss +2 -2
  80. package/components/intranet-header/_scaffolding.scss +1 -1
  81. package/components/intranet-header/_searchbox.scss +1 -1
  82. package/components/intranet-header/_sidebar.scss +11 -11
  83. package/components/intranet-header/_top-navigation.scss +1 -1
  84. package/components/list-check.css +1 -0
  85. package/components/list-check.scss +79 -0
  86. package/components/list-group.css +1 -1
  87. package/components/list-group.scss +72 -127
  88. package/components/modal.css +2 -2
  89. package/components/modal.scss +2 -4
  90. package/components/offcanvas.css +1 -1
  91. package/components/offcanvas.scss +0 -2
  92. package/components/pagination.css +1 -1
  93. package/components/pagination.scss +10 -9
  94. package/components/popover.css +1 -1
  95. package/components/popover.scss +0 -2
  96. package/components/product-card.css +1 -1
  97. package/components/product-card.scss +11 -5
  98. package/components/progress.scss +0 -2
  99. package/components/radio-button.css +1 -0
  100. package/components/radio-button.scss +125 -0
  101. package/components/segmented-button.css +3 -0
  102. package/components/segmented-button.scss +207 -0
  103. package/components/skiplinks.css +1 -0
  104. package/components/skiplinks.scss +20 -0
  105. package/components/spinner.scss +0 -1
  106. package/components/stepper.css +1 -1
  107. package/components/stepper.scss +40 -33
  108. package/components/subnavigation.css +1 -1
  109. package/components/subnavigation.scss +17 -14
  110. package/components/switch.css +1 -0
  111. package/components/switch.scss +212 -0
  112. package/components/tables.css +1 -1
  113. package/components/tables.scss +0 -1
  114. package/components/tabs/_tab-title.scss +16 -55
  115. package/components/tabs/_tabs-wrapper.scss +3 -13
  116. package/components/tabs/index.css +1 -1
  117. package/components/tabs/index.scss +0 -2
  118. package/components/tag.css +1 -1
  119. package/components/tag.scss +1 -2
  120. package/components/teaser.css +1 -0
  121. package/components/teaser.scss +83 -0
  122. package/components/text-highlight.css +1 -1
  123. package/components/timepicker.css +1 -1
  124. package/components/timepicker.scss +13 -16
  125. package/components/toast.css +1 -1
  126. package/components/toast.scss +19 -16
  127. package/components/tooltip.css +1 -1
  128. package/components/tooltip.scss +0 -2
  129. package/components/transitions.scss +0 -2
  130. package/components/validation.css +1 -0
  131. package/components/validation.scss +120 -0
  132. package/elements/_index.scss +7 -1
  133. package/elements/anchor.css +1 -0
  134. package/elements/anchor.scss +33 -0
  135. package/elements/body.css +1 -1
  136. package/elements/body.scss +5 -1
  137. package/elements/fieldset-legend.css +1 -1
  138. package/elements/fieldset-legend.scss +7 -3
  139. package/elements/heading.css +1 -1
  140. package/elements/heading.scss +10 -12
  141. package/elements/list-bullet.css +1 -0
  142. package/elements/list-bullet.scss +43 -0
  143. package/elements/list-description.css +1 -0
  144. package/elements/list-description.scss +5 -0
  145. package/elements/list-number.css +1 -0
  146. package/elements/list-number.scss +33 -0
  147. package/elements/paragraph.css +1 -0
  148. package/elements/paragraph.scss +17 -0
  149. package/elements/reset.css +1 -1
  150. package/elements/reset.scss +16 -7
  151. package/elements.css +1 -0
  152. package/elements.scss +1 -0
  153. package/fonts.css +1 -1
  154. package/functions/_breakpoint.scss +26 -0
  155. package/functions/_forms.scss +46 -3
  156. package/functions/_icons.scss +2 -14
  157. package/helpers/_index.scss +4 -0
  158. package/helpers/clearfix.css +1 -0
  159. package/helpers/clearfix.scss +5 -0
  160. package/helpers/focus-ring.css +1 -0
  161. package/helpers/focus-ring.scss +5 -0
  162. package/helpers/text-truncation.css +1 -0
  163. package/helpers/text-truncation.scss +5 -0
  164. package/helpers/visually-hidden.css +1 -0
  165. package/helpers/visually-hidden.scss +5 -0
  166. package/index.css +3 -3
  167. package/index.scss +2 -5
  168. package/intranet.css +3 -3
  169. package/intranet.scss +2 -2
  170. package/layout/_containers.scss +32 -0
  171. package/layout/_section.scss +133 -0
  172. package/layout/grid/_index.scss +11 -0
  173. package/layout/grid/_mixins.scss +104 -0
  174. package/layout/grid/_variables.scss +2 -0
  175. package/layout/index.css +1 -0
  176. package/layout/index.scss +3 -0
  177. package/mixins/_button.scss +19 -15
  178. package/mixins/_form-checks.scss +1 -1
  179. package/mixins/_forms.scss +42 -33
  180. package/mixins/_icon-button.scss +27 -0
  181. package/mixins/_icons.scss +22 -32
  182. package/mixins/_index.scss +3 -2
  183. package/mixins/_layout.scss +26 -0
  184. package/mixins/_list.scss +112 -0
  185. package/mixins/_media.scss +58 -2
  186. package/mixins/_notification.scss +59 -53
  187. package/mixins/_utilities.scss +46 -25
  188. package/package.json +16 -16
  189. package/palettes/_mixins.scss +74 -0
  190. package/palettes/_utilities.scss +3 -0
  191. package/palettes/_variables.scss +2 -0
  192. package/palettes/cargo-palettes.css +1 -0
  193. package/palettes/cargo-palettes.scss +3 -0
  194. package/palettes/post-palettes.css +1 -0
  195. package/palettes/post-palettes.scss +3 -0
  196. package/placeholders/_button.scss +3 -6
  197. package/placeholders/_close.scss +2 -5
  198. package/placeholders/_schemes.scss +10 -0
  199. package/post-external.css +3 -3
  200. package/post-external.scss +7 -1
  201. package/post-internal.css +3 -3
  202. package/post-internal.scss +7 -1
  203. package/post-tokens-external.css +1 -1
  204. package/post-tokens-external.scss +1 -1
  205. package/post-tokens-internal.css +1 -1
  206. package/post-tokens-internal.scss +1 -1
  207. package/themes/bootstrap/_core.scss +0 -2
  208. package/themes/bootstrap/_forms.scss +0 -4
  209. package/themes/bootstrap/_overrides-variables.scss +0 -6
  210. package/themes/bootstrap/_utilities.scss +45 -1
  211. package/tokens/_cargo-theme.scss +8 -0
  212. package/tokens/_helpers.scss +1 -0
  213. package/tokens/_palettes.scss +9 -0
  214. package/tokens/_schemes.scss +11 -0
  215. package/tokens/_utilities_formatted.scss +1 -0
  216. package/tokens/temp/_channel.scss +4 -3
  217. package/tokens/temp/_components.scss +594 -503
  218. package/tokens/temp/_core.scss +49 -37
  219. package/tokens/temp/_device.scss +210 -239
  220. package/tokens/temp/_elements.scss +11 -11
  221. package/tokens/temp/_helpers.scss +13 -0
  222. package/tokens/temp/_index.scss +6 -4
  223. package/tokens/temp/_palettes.scss +19 -0
  224. package/tokens/temp/_scheme.scss +334 -0
  225. package/tokens/temp/_theme.scss +28 -9
  226. package/tokens/temp/_utilities-formatted.scss +128 -0
  227. package/tokens/temp/_utilities.scss +34 -58
  228. package/tokens/temp/palettes/_cargo-dark.scss +19 -0
  229. package/tokens/temp/palettes/_cargo-light.scss +19 -0
  230. package/tokens/temp/palettes/_post-dark.scss +19 -0
  231. package/tokens/temp/palettes/_post-light.scss +19 -0
  232. package/utilities/_not-defined.scss +44 -0
  233. package/utilities/_variables.scss +304 -22
  234. package/utilities/index.css +1 -0
  235. package/utilities/{_index.scss → index.scss} +1 -2
  236. package/variables/_animation.scss +10 -6
  237. package/variables/_breakpoints.scss +9 -5
  238. package/variables/_color.scss +0 -61
  239. package/variables/_commons.scss +1 -0
  240. package/variables/_elevation.scss +16 -22
  241. package/variables/_grid.scss +2 -12
  242. package/variables/_icons.scss +19 -696
  243. package/variables/_index.scss +1 -1
  244. package/variables/_sizing.scss +17 -0
  245. package/variables/_spacing.scss +0 -152
  246. package/variables/_type.scss +17 -27
  247. package/variables/components/_accordion.scss +0 -47
  248. package/variables/components/_badge.scss +9 -5
  249. package/variables/components/_button.scss +61 -113
  250. package/variables/components/_card.scss +7 -4
  251. package/variables/components/_chip.scss +13 -7
  252. package/variables/components/_close.scss +14 -8
  253. package/variables/components/_code.scss +1 -1
  254. package/variables/components/_datatable.scss +12 -8
  255. package/variables/components/_dropdowns.scss +1 -1
  256. package/variables/components/_form-check.scss +9 -46
  257. package/variables/components/_forms.scss +8 -101
  258. package/variables/components/_index.scss +0 -5
  259. package/variables/components/_modal.scss +17 -12
  260. package/variables/components/_nav.scss +3 -3
  261. package/variables/components/_navbar.scss +7 -4
  262. package/variables/components/_notification.scss +48 -37
  263. package/variables/components/_pagination.scss +14 -6
  264. package/variables/components/_spinners.scss +7 -2
  265. package/variables/components/_stepper.scss +15 -10
  266. package/variables/components/_subnavigation.scss +11 -9
  267. package/variables/components/_tables.scss +11 -6
  268. package/variables/components/_tag.scss +10 -7
  269. package/components/accordion.css +0 -1
  270. package/components/accordion.scss +0 -100
  271. package/components/alert.css +0 -1
  272. package/components/alert.scss +0 -137
  273. package/components/carousel.css +0 -1
  274. package/components/carousel.scss +0 -178
  275. package/components/elevation.css +0 -1
  276. package/components/elevation.scss +0 -8
  277. package/components/floating-label.css +0 -1
  278. package/components/floating-label.scss +0 -353
  279. package/components/form-check.css +0 -1
  280. package/components/form-check.scss +0 -297
  281. package/components/form-validation.css +0 -1
  282. package/components/form-validation.scss +0 -148
  283. package/components/forms.css +0 -1
  284. package/components/forms.scss +0 -215
  285. package/components/grid.css +0 -1
  286. package/components/grid.scss +0 -170
  287. package/components/icons.css +0 -1
  288. package/components/icons.scss +0 -60
  289. package/components/sizing.css +0 -1
  290. package/components/sizing.scss +0 -85
  291. package/components/topic-teaser.css +0 -1
  292. package/components/topic-teaser.scss +0 -196
  293. package/layouts/portal/_grid.scss +0 -85
  294. package/layouts/portal/_index.scss +0 -2
  295. package/layouts/portal/_subnavigation.scss +0 -5
  296. package/layouts/portal/_variables.scss +0 -8
  297. package/mixins/_accordion.scss +0 -16
  298. package/mixins/_elevation.scss +0 -6
  299. package/mixins/_focus.scss +0 -9
  300. package/mixins/_form-validation.scss +0 -5
  301. package/mixins/_size.scss +0 -65
  302. package/placeholders/_modes.scss +0 -10
  303. package/themes/bootstrap/_carousel.scss +0 -2
  304. package/themes/bootstrap/_containers.scss +0 -2
  305. package/themes/bootstrap/_grid.scss +0 -2
  306. package/themes/bootstrap/_overrides-mixins.scss +0 -33
  307. package/themes/bootstrap/forms/_floating-labels.scss +0 -2
  308. package/themes/bootstrap/forms/_form-control.scss +0 -2
  309. package/themes/bootstrap/forms/_form-select.scss +0 -2
  310. package/themes/bootstrap/forms/_form-text.scss +0 -2
  311. package/tokens/_modes.scss +0 -11
  312. package/tokens/temp/_mode.scss +0 -299
  313. package/utilities/_functions.scss +0 -35
  314. package/utilities/temp/_legacy.scss +0 -95
  315. package/variables/_options.scss +0 -5
  316. package/variables/components/_carousel.scss +0 -27
  317. package/variables/components/_figures.scss +0 -6
  318. package/variables/components/_form-select.scss +0 -13
  319. package/variables/components/_form-validation.scss +0 -38
  320. package/variables/components/_list-group.scss +0 -29
  321. package/variables/components/_topic-teaser.scss +0 -32
@@ -0,0 +1,112 @@
1
+ @use '../functions/tokens';
2
+ @use '../tokens/elements';
3
+
4
+ @mixin list-bullet($child-selector: 'li') {
5
+ list-style: none;
6
+ margin-block: tokens.get('list-bullet-margin-block', elements.$post-listbullet);
7
+ padding-inline-start: calc(
8
+ #{tokens.get('list-bullet-item-icon-size', elements.$post-listbullet)} + #{tokens.get(
9
+ 'list-bullet-item-icon-gap-inline',
10
+ elements.$post-listbullet
11
+ )}
12
+ );
13
+
14
+ > #{$child-selector} {
15
+ margin: 0;
16
+ padding-inline: 0;
17
+ padding-block: tokens.get('list-bullet-item-text-padding-block', elements.$post-listbullet);
18
+
19
+ ~ #{$child-selector} {
20
+ margin-block-start: tokens.get('list-bullet-item-gap-block', elements.$post-listbullet);
21
+ }
22
+
23
+ &::before {
24
+ display: block;
25
+ content: '';
26
+ box-sizing: content-box;
27
+ float: inline-start;
28
+ margin-block-start: calc(
29
+ (#{tokens.get('body-line-height', elements.$post-body)} * 0.5em) -
30
+ (#{tokens.get('list-bullet-item-icon-bullet-size', elements.$post-listbullet)} * 0.5)
31
+ );
32
+ margin-inline-start: calc(
33
+ (#{tokens.get('list-bullet-item-icon-size', elements.$post-listbullet)} * -0.5) +
34
+ (#{tokens.get('list-bullet-item-icon-bullet-size', elements.$post-listbullet)} * -0.5) +
35
+ (#{tokens.get('post-list-bullet-item-icon-gap-inline', elements.$post-listbullet)} * -1)
36
+ );
37
+ width: tokens.get('list-bullet-item-icon-bullet-size', elements.$post-listbullet);
38
+ height: tokens.get('list-bullet-item-icon-bullet-size', elements.$post-listbullet);
39
+ background-color: currentColor;
40
+ border-radius: 50%;
41
+ }
42
+ }
43
+ }
44
+
45
+ @mixin list-number($child-selector: 'li') {
46
+ margin-block: tokens.get('list-number-item-gap-block', elements.$post-listnumber);
47
+ padding-inline-end: tokens.get('list-number-item-gap-block', elements.$post-listnumber);
48
+ padding-inline-start: calc(
49
+ tokens.get('list-number-item-icon-size', elements.$post-listnumber) +
50
+ tokens.get('list-number-item-icon-gap-inline', elements.$post-listnumber)
51
+ );
52
+
53
+ > #{$child-selector} {
54
+ margin-block-end: tokens.get('list-number-margin-block', elements.$post-listnumber);
55
+ padding-inline-start: tokens.get('list-number-item-icon-gap-inline', elements.$post-listnumber);
56
+ padding-block: tokens.get('list-number-item-text-padding-block', elements.$post-listnumber);
57
+
58
+ &:last-child {
59
+ margin-block-end: 0;
60
+ }
61
+ }
62
+ }
63
+
64
+ @mixin list-inline($child-selector: 'li') {
65
+ @include list-unstyled($child-selector) {
66
+ display: flex;
67
+ flex-wrap: wrap;
68
+ row-gap: tokens.get('list-bullet-item-gap-block', elements.$post-listbullet);
69
+ column-gap: calc(
70
+ tokens.get('post-list-bullet-item-icon-gap-inline', elements.$post-listbullet) * 2
71
+ );
72
+ margin-block: tokens.get('list-bullet-margin-block', elements.$post-listbullet);
73
+ }
74
+ }
75
+
76
+ @mixin list-revert($child-selector: 'li') {
77
+ all: revert;
78
+ @content;
79
+
80
+ > #{$child-selector} {
81
+ all: revert;
82
+
83
+ ~ #{$child-selector} {
84
+ all: revert;
85
+ }
86
+
87
+ &::before {
88
+ all: revert;
89
+ }
90
+ }
91
+ }
92
+
93
+ @mixin list-unstyled($child-selector: 'li') {
94
+ all: unset;
95
+ display: block;
96
+ list-style: none;
97
+ @content;
98
+
99
+ > #{$child-selector} {
100
+ all: unset;
101
+ display: list-item;
102
+
103
+ ~ #{$child-selector} {
104
+ all: unset;
105
+ display: list-item;
106
+ }
107
+
108
+ &::before {
109
+ all: unset;
110
+ }
111
+ }
112
+ }
@@ -1,4 +1,18 @@
1
+ @use 'sass:map';
2
+ @use 'sass:meta';
3
+ @use '../functions/breakpoint';
4
+
5
+ $offset: 0.02;
6
+
7
+ /**
8
+ Creates a min-width breakpoint with the given value
9
+ @param $device-size A pixel value or a key for the breakpoints map
10
+ */
1
11
  @mixin min($device-size) {
12
+ @if (meta.type-of($device-size) == 'string') {
13
+ $device-size: breakpoint.min-width($device-size);
14
+ }
15
+
2
16
  @if $device-size != 0 {
3
17
  @media screen and (min-width: $device-size) {
4
18
  @content;
@@ -8,14 +22,56 @@
8
22
  }
9
23
  }
10
24
 
25
+ /**
26
+ Creates a max-width breakpoint with the given value
27
+ @param $device-size A pixel value or a key for the breakpoints map
28
+ */
11
29
  @mixin max($device-size) {
12
- @media screen and (max-width: ($device-size - 0.01)) {
30
+ @if (meta.type-of($device-size) == 'string') {
31
+ $device-size: breakpoint.min-width($device-size);
32
+ }
33
+
34
+ @media screen and (max-width: ($device-size - $offset)) {
13
35
  @content;
14
36
  }
15
37
  }
16
38
 
39
+ /**
40
+ Creates an in-between breakpoint with the given values
41
+ @param $min-size A pixel value or a key for the breakpoints map
42
+ @param $max-size A pixel value or a key for the breakpoints map
43
+ */
17
44
  @mixin between($min-size, $max-size) {
18
- @media screen and (min-width: $min-size) and (max-width: ($max-size - 0.01)) {
45
+ @if (meta.type-of($min-size) == 'string') {
46
+ $min-size: breakpoint.min-width($min-size);
47
+ }
48
+ @if (meta.type-of($max-size) == 'string') {
49
+ $max-size: breakpoint.min-width($max-size);
50
+ }
51
+
52
+ @media screen and (min-width: $min-size) and (max-width: ($max-size - $offset)) {
19
53
  @content;
20
54
  }
21
55
  }
56
+
57
+ /**
58
+ Creates a breakpoint with only the given value
59
+ @param $size A key for the breakpoint to target
60
+ */
61
+ @mixin only($size) {
62
+ @if (meta.type-of($size) == 'string') {
63
+ $min-size: breakpoint.min-width($size);
64
+ $next: breakpoint.next($size);
65
+ $max-size: breakpoint.min-width($next);
66
+
67
+ @if $max-size != null {
68
+ @media screen and (min-width: $min-size) and (max-width: ($max-size - $offset)) {
69
+ @content;
70
+ }
71
+ } @else if $max-size == null {
72
+ @media screen and (min-width: $min-size) {
73
+ @content;
74
+ }
75
+ }
76
+ }
77
+ }
@@ -1,4 +1,5 @@
1
1
  @use 'sass:map';
2
+ @use 'sass:list';
2
3
 
3
4
  @use './color' as color-mx;
4
5
  @use './icons' as icons-mx;
@@ -8,42 +9,42 @@
8
9
  @use './../variables/spacing';
9
10
  @use './../variables/components/close';
10
11
  @use './../variables/components/notification';
12
+ @use '../tokens/components';
13
+ @use '../tokens/elements';
14
+ @use '../functions/tokens';
15
+
16
+ tokens.$default-map: components.$post-banner;
11
17
 
12
18
  @mixin notification-size($size) {
19
+ $default-var: list.nth(notification.$notification-variants, 1);
13
20
  $icon-size: map.get(notification.$notification-icon-size-map, $size);
14
- $font-size: map.get(notification.$notification-font-size-map, $size);
15
21
  $padding-x: map.get(notification.$notification-padding-x-map, $size);
16
22
  $padding-y: map.get(notification.$notification-padding-y-map, $size);
17
-
18
- position: relative;
23
+ $elevation: map.get(notification.$notification-elevation-map, $size);
24
+ $gap: map.get(notification.$notification-gap-map, $size);
25
+ min-height: calc(#{$icon-size} + (2 * #{$padding-y}));
19
26
  box-sizing: border-box;
20
- min-height: 2 * $padding-y + $icon-size;
21
- box-shadow: notification.$notification-box-shadow;
22
- border-radius: notification.$notification-border-radius;
23
- padding: $padding-y $padding-x;
24
- padding-inline-start: $padding-x + $icon-size + notification.$notification-gap;
25
- margin-block-end: notification.$notification-margin-bottom;
26
- font-size: $font-size;
27
- font-weight: notification.$notification-font-weight;
28
27
 
29
- &.no-icon {
30
- min-height: 2 * $padding-y + close.$close-size;
31
- padding-inline-start: $padding-x;
32
- }
28
+ box-shadow: $elevation;
29
+ border-radius: tokens.get('banner-border-radius');
33
30
 
34
- // for notifications with .pi-* icons (deprecated)
35
- &[class^='pi-'],
36
- &[class*=' pi-'] {
37
- background-size: $icon-size;
38
- background-position: $padding-x $padding-y;
39
- background-repeat: no-repeat;
31
+ padding: $padding-y $padding-x;
32
+ padding-inline-start: calc(#{$padding-x} + #{$icon-size} + #{$gap});
33
+ font-weight: notification.$notification-font-weight;
34
+ border-style: tokens.get('banner-border-style');
35
+ border-width: tokens.get('banner-border-width');
36
+ position: relative;
37
+ color: tokens.get('body-color', elements.$post-body);
40
38
 
41
- &.no-icon {
42
- background-image: none;
43
- }
44
- }
39
+ // Set the neutral notification as the default color
40
+ @include notification-variant(
41
+ list.nth($default-var, 2),
42
+ list.nth($default-var, 3),
43
+ list.nth($default-var, 4),
44
+ list.nth($default-var, 5),
45
+ list.nth($default-var, 6)
46
+ );
45
47
 
46
- // for notifications with mask-image icons and post-icon override
47
48
  &::before {
48
49
  content: '';
49
50
  display: block;
@@ -58,9 +59,10 @@
58
59
  top: $padding-y;
59
60
  }
60
61
 
61
- &.no-icon,
62
- &[class^='pi-'],
63
- &[class*=' pi-'] {
62
+ &.no-icon {
63
+ min-height: calc(2 * $padding-y + close.$close-size);
64
+ padding-inline-start: $padding-x;
65
+
64
66
  &::before {
65
67
  content: unset;
66
68
  }
@@ -79,10 +81,13 @@
79
81
  @mixin notification-body($size) {
80
82
  $hr-margin-block: map.get(notification.$notification-hr-margin-block-map, $size);
81
83
 
82
- display: flex;
83
- flex-direction: column;
84
- justify-content: center;
85
- gap: notification.$notification-body-gap;
84
+ /* stylelint-disable-next-line scss/selector-no-redundant-nesting-selector */
85
+ & {
86
+ display: flex;
87
+ flex-direction: column;
88
+ justify-content: center;
89
+ gap: notification.$notification-body-gap;
90
+ }
86
91
 
87
92
  a {
88
93
  font-weight: notification.$notification-link-font-weight;
@@ -92,22 +97,24 @@
92
97
  margin-block: $hr-margin-block !important;
93
98
  }
94
99
 
95
- > :only-child,
96
- > post-icon:first-child + :last-child {
97
- @include notification-heading($size);
98
- }
99
-
100
100
  > * {
101
101
  margin: 0;
102
102
  }
103
103
  }
104
104
 
105
- @mixin notification-variant($color, $icon) {
106
- @include color-mx.colored-background($color, $allow-alpha: false);
105
+ @mixin notification-variant($color, $icon, $border-color, $icon-color, $scheme) {
106
+ background-color: $color;
107
+ border-color: $border-color;
108
+ color-scheme: $scheme;
107
109
 
108
110
  // default icon (mask-image)
109
- &:not(.no-icon, [class^='pi-'], [class*=' pi-'])::before {
111
+ &:not(.no-icon)::before {
110
112
  @include icons-mx.icon($icon);
113
+ color: $icon-color;
114
+
115
+ @include utilities-mx.high-contrast-mode {
116
+ color: CanvasText;
117
+ }
111
118
  }
112
119
 
113
120
  // Prevent flashing when using post-icon
@@ -118,28 +125,27 @@
118
125
  // icon override (post-icon), needed when :has is not supported
119
126
  > post-icon {
120
127
  background-color: $color;
128
+ color: $icon-color;
121
129
  }
122
130
  }
123
131
 
124
132
  @mixin notification-dismissible($size, $close: 'btn-close') {
125
133
  $padding-x: map.get(notification.$notification-padding-x-map, $size);
134
+ $gap: map.get(notification.$notification-gap-map, $size);
126
135
 
127
- pointer-events: auto;
128
- position: relative;
129
- padding-inline-end: $padding-x + notification.$notification-gap + close.$close-size;
136
+ /* stylelint-disable-next-line scss/selector-no-redundant-nesting-selector */
137
+ & {
138
+ pointer-events: auto;
139
+ position: relative;
140
+ }
141
+
142
+ &:not(.banner-action):not(.alert-action) {
143
+ padding-inline-end: calc(#{$padding-x} + #{$gap} + #{close.$close-size});
144
+ }
130
145
 
131
146
  > .#{$close} {
132
147
  position: absolute;
133
148
  inset-block-start: spacing.$spacer;
134
149
  inset-inline-end: $padding-x;
135
150
  }
136
-
137
- > .#{$close}:first-child + :last-child {
138
- @include notification-heading($size);
139
- }
140
- }
141
-
142
- @mixin notification-heading($size) {
143
- font-size: map.get(notification.$notification-heading-font-size-map, $size);
144
- font-weight: notification.$notification-heading-font-weight;
145
151
  }
@@ -1,9 +1,16 @@
1
+ @use './../themes/bootstrap/core' as *;
2
+
3
+ @use '../functions/tokens';
4
+ @use '../tokens/helpers';
5
+ @use '../tokens/components';
6
+
1
7
  @use '../variables/spacing';
2
8
  @use '../variables/commons';
9
+ @use '../variables/breakpoints';
3
10
 
4
11
  @mixin reset-list() {
5
- margin: 0;
6
- padding: 0;
12
+ margin-block: 0;
13
+ padding-inline-start: 0;
7
14
  list-style: none;
8
15
  }
9
16
 
@@ -63,14 +70,36 @@
63
70
  pointer-events: none;
64
71
  }
65
72
 
66
- @mixin generate-utility-class($classname, $size, $property, $value) {
67
- .#{$classname}-#{$size}-r {
68
- #{$property}: $value !important;
73
+ @mixin high-contrast-mode() {
74
+ @media (forced-colors: active), (-ms-high-contrast: active), (-ms-high-contrast: white-on-black) {
75
+ @content;
69
76
  }
70
77
  }
71
78
 
72
- @mixin high-contrast-mode() {
73
- @media (forced-colors: active), (-ms-high-contrast: active), (-ms-high-contrast: white-on-black) {
79
+ @mixin high-contrast-mode-dark() {
80
+ @media (forced-colors: active) and (prefers-color-scheme: dark),
81
+ (-ms-high-contrast: white-on-black) {
82
+ @content;
83
+ }
84
+ }
85
+
86
+ @mixin high-contrast-mode-light() {
87
+ @media (forced-colors: active) and (prefers-color-scheme: light),
88
+ (-ms-high-contrast: black-on-white) {
89
+ @content;
90
+ }
91
+ }
92
+
93
+ @mixin high-contrast-mode-dark() {
94
+ @media (forced-colors: active) and (prefers-color-scheme: dark),
95
+ (-ms-high-contrast: white-on-black) {
96
+ @content;
97
+ }
98
+ }
99
+
100
+ @mixin high-contrast-mode-light() {
101
+ @media (forced-colors: active) and (prefers-color-scheme: light),
102
+ (-ms-high-contrast: black-on-white) {
74
103
  @content;
75
104
  }
76
105
  }
@@ -91,26 +120,19 @@
91
120
  }
92
121
 
93
122
  @mixin focus-style-none {
94
- outline: none;
123
+ outline: none !important;
95
124
  }
96
125
 
97
- @mixin focus-style(
98
- $additional-selector: '',
99
- $offset: spacing.$size-line,
100
- $width: spacing.$size-line,
101
- $color: var(--post-focus-color),
102
- $style: solid
103
- ) {
126
+ @mixin focus-style($additional-selector: '') {
104
127
  &#{$additional-selector} {
105
- outline-style: none !important; // !important is needed to override bootstrap .form-control:focus
106
- outline-offset: $offset !important;
107
- outline-width: $width !important;
108
- outline-color: $color !important;
128
+ outline-offset: tokens.get('focus-outline-offset', helpers.$post-focus) !important;
129
+ outline: tokens.get('focus-outline-color', helpers.$post-focus) none
130
+ tokens.get('focus-outline-width', helpers.$post-focus) !important;
109
131
  }
110
132
 
111
133
  // :has(:focus-visible) mimic a focus-visible-within pseudo-class
112
134
  &:is(:focus-visible, :has(:focus-visible), .pretend-focus)#{$additional-selector} {
113
- outline-style: $style !important;
135
+ outline-style: tokens.get('focus-border-style', helpers.$post-focus) !important;
114
136
  // In case rules need to be slightly adjusted
115
137
  @content;
116
138
 
@@ -122,7 +144,7 @@
122
144
  // 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).
123
145
  @supports not selector(:has(:focus-visible)) {
124
146
  &:is(:focus-visible, :focus-within, .pretend-focus)#{$additional-selector} {
125
- outline-style: $style !important;
147
+ outline-style: tokens.get('focus-border-style', helpers.$post-focus) !important;
126
148
  // In case rules need to be slightly adjusted
127
149
  @content;
128
150
 
@@ -160,11 +182,10 @@
160
182
  @mixin disabled-style($additional-selector: '') {
161
183
  &:disabled#{$additional-selector} {
162
184
  pointer-events: none;
163
- color: var(--post-gray-60);
164
- border-color: var(--post-gray-40);
165
- border-style: dashed;
185
+ color: tokens.get('input-color-disabled-fg', components.$post-text-input);
186
+ border-color: tokens.get('input-color-disabled-border', components.$post-text-input);
187
+ border-style: tokens.get('input-border-style-disabled', components.$post-text-input);
166
188
  background-clip: padding-box;
167
- text-decoration: line-through;
168
189
  // In case rules need to be slightly adjusted
169
190
  @content;
170
191
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swisspost/design-system-styles",
3
- "version": "9.0.0-next.2",
3
+ "version": "9.0.0-next.21",
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",
@@ -38,31 +38,31 @@
38
38
  "gulp-sourcemaps": "3.0.0"
39
39
  },
40
40
  "devDependencies": {
41
- "@swisspost/design-system-icons": "9.0.0-next.2",
42
- "@swisspost/design-system-tokens": "9.0.0-next.2",
43
- "@types/node": "20.14.14",
44
- "autoprefixer": "10.4.19",
41
+ "@swisspost/design-system-icons": "9.0.0-next.21",
42
+ "@swisspost/design-system-tokens": "9.0.0-next.21",
43
+ "@types/node": "22.10.5",
44
+ "autoprefixer": "10.4.20",
45
45
  "copyfiles": "2.4.1",
46
46
  "glob": "11.0.0",
47
47
  "gulp": "5.0.0",
48
48
  "gulp-newer": "^1.4.0",
49
49
  "gulp-postcss": "10.0.0",
50
- "gulp-sass": "5.1.0",
50
+ "gulp-sass": "6.0.0",
51
51
  "jest": "29.7.0",
52
- "postcss": "8.4.40",
52
+ "postcss": "8.4.49",
53
53
  "postcss-scss": "4.0.9",
54
54
  "prettier": "3.3.3",
55
55
  "rimraf": "6.0.1",
56
- "sass": "1.78.0",
57
- "stylelint": "16.9.0",
56
+ "sass-embedded": "1.78.0",
57
+ "stylelint": "16.12.0",
58
58
  "stylelint-config-sass-guidelines": "11.1.0",
59
59
  "stylelint-prettier": "5.0.2",
60
- "stylelint-scss": "6.5.1",
60
+ "stylelint-scss": "6.10.0",
61
61
  "typescript": "5.5.4",
62
- "vite": "5.4.8"
62
+ "vite": "6.0.9"
63
63
  },
64
64
  "sass": {
65
- "includePaths": [
65
+ "loadPaths": [
66
66
  "node_modules"
67
67
  ],
68
68
  "outputDir": "./dist"
@@ -79,13 +79,13 @@
79
79
  "frontend"
80
80
  ],
81
81
  "scripts": {
82
- "start": "gulp watch",
83
82
  "play": "vite --open",
83
+ "start": "gulp watch",
84
84
  "build": "pnpm clean && gulp build",
85
- "unit": "gulp sass:tests",
86
85
  "clean": "rimraf out-tsc dist src/tokens/temp",
87
- "format": "prettier src/**/*.scss --write",
86
+ "unit": "gulp sass:tests",
88
87
  "lint": "stylelint src/**/*.scss !src/tokens/temp/**",
89
- "lint:fix": "stylelint src/**/*.scss !src/tokens/temp/** --fix"
88
+ "lint:fix": "stylelint src/**/*.scss !src/tokens/temp/** --fix",
89
+ "format": "prettier src/**/*.scss --write"
90
90
  }
91
91
  }
@@ -0,0 +1,74 @@
1
+ @use 'sass:map';
2
+ @use 'sass:meta';
3
+
4
+ @use '../functions/tokens';
5
+ @use '../placeholders/schemes';
6
+ @use '../tokens/elements';
7
+ @use '../tokens/palettes';
8
+
9
+ @use './variables' as *;
10
+
11
+ @forward './utilities';
12
+
13
+ @mixin palettes($theme) {
14
+ body {
15
+ background-color: var(--post-current-palette-bg) !important;
16
+
17
+ &:not([data-color-scheme='dark']) {
18
+ @include palette-tokens($default-palette, $theme, 'light');
19
+ }
20
+
21
+ &[data-color-scheme='dark'] {
22
+ @include palette-tokens($default-palette, $theme, 'dark');
23
+ }
24
+ }
25
+
26
+ @each $palette in $palettes {
27
+ .palette-#{$palette} {
28
+ // Redefining the body color is necessary to ensure that the new color scheme is applied correctly.
29
+ // Known limitation: body color may be incorrect with nested parent with different `data-color-scheme` values.
30
+ color: tokens.get('body-color', elements.$post-body);
31
+ background-color: var(--post-current-palette-bg) !important;
32
+
33
+ // Light scheme explicitly set on the palette:
34
+ &[data-color-scheme='light'],
35
+
36
+ // No scheme explicitly set on the palette, but parent has a light scheme:
37
+ &:where([data-color-scheme='light'] :not([data-color-scheme='dark'])),
38
+
39
+ // No scheme explicitly set on the palette, and no scheme on the parent either:
40
+ &:not([data-color-scheme='dark']):not([data-color-scheme='dark'] *) {
41
+ @include palette-tokens($palette, $theme, 'light', $override-scheme: true);
42
+ }
43
+
44
+ // Dark scheme explicitly set on the palette:
45
+ &[data-color-scheme='dark'],
46
+
47
+ // No scheme explicitly set on the palette, but parent has a dark scheme:
48
+ &:where([data-color-scheme='dark'] :not([data-color-scheme='dark'])) {
49
+ @include palette-tokens($palette, $theme, 'dark', $override-scheme: true);
50
+ }
51
+ }
52
+ }
53
+ }
54
+
55
+ @mixin palette-tokens($name, $theme, $scheme, $override-scheme: false) {
56
+ $palette: map.get(meta.module-variables(palettes), '#{$theme}-#{$scheme}');
57
+
58
+ @if (not $palette) {
59
+ @error 'Palette #{$theme}-#{$scheme} not found.';
60
+ }
61
+
62
+ --post-current-palette-fg: #{tokens.get('palettes-color-#{$name}-fg', $palette)};
63
+ --post-current-palette-bg: #{tokens.get('palettes-color-#{$name}-bg', $palette)};
64
+
65
+ @if ($override-scheme == true) {
66
+ $bg-scheme: tokens.get('palettes-color-#{$name}-bg-scheme', $palette);
67
+
68
+ @if ($bg-scheme == 'light') {
69
+ @extend %color-scheme-light;
70
+ } @else {
71
+ @extend %color-scheme-dark;
72
+ }
73
+ }
74
+ }
@@ -0,0 +1,3 @@
1
+ .palette-text {
2
+ color: var(--post-current-palette-fg);
3
+ }
@@ -0,0 +1,2 @@
1
+ $default-palette: 'default';
2
+ $palettes: $default-palette, 'alternate', 'brand', 'accent';