@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.
- package/_svg-icon-map.scss +85 -23
- package/basics.css +1 -1
- package/basics.scss +2 -6
- package/cargo-external.css +7 -0
- package/cargo-external.scss +10 -0
- package/cargo-internal.css +7 -0
- package/cargo-internal.scss +10 -0
- package/cargo-tokens-external.css +1 -0
- package/cargo-tokens-external.scss +8 -0
- package/cargo-tokens-internal.css +1 -0
- package/cargo-tokens-internal.scss +8 -0
- package/components/_form-check.scss +166 -0
- package/components/_index.scss +21 -13
- package/components/appstore-badge.css +1 -0
- package/components/appstore-badge.scss +18 -0
- package/components/avatar.css +1 -0
- package/components/avatar.scss +41 -0
- package/components/badge.css +1 -1
- package/components/badge.scss +8 -2
- package/components/banner.css +1 -0
- package/components/banner.scss +105 -0
- package/components/blockquote.css +1 -0
- package/components/blockquote.scss +46 -0
- package/components/breadcrumb.css +1 -1
- package/components/breadcrumb.scss +4 -24
- package/components/breakpoints.css +1 -0
- package/components/breakpoints.scss +17 -0
- package/components/button-group.css +1 -1
- package/components/button-group.scss +7 -6
- package/components/button.css +1 -1
- package/components/button.scss +41 -228
- package/components/card-control.css +1 -1
- package/components/card-control.scss +33 -24
- package/components/card.css +1 -1
- package/components/card.scss +72 -68
- package/components/checkbox.css +1 -0
- package/components/checkbox.scss +127 -0
- package/components/chip.css +1 -1
- package/components/chip.scss +9 -8
- package/components/close.css +1 -1
- package/components/close.scss +0 -2
- package/components/datatable.css +1 -3
- package/components/datatable.scss +22 -17
- package/components/datepicker.css +1 -1
- package/components/datepicker.scss +6 -22
- package/components/dialog.css +1 -1
- package/components/dialog.scss +26 -38
- package/components/dropdown.css +1 -1
- package/components/dropdown.scss +9 -6
- package/components/fonts.css +1 -1
- package/components/fonts.scss +7 -45
- package/components/form-footer.css +1 -0
- package/components/form-footer.scss +18 -0
- package/components/form-hint.css +1 -0
- package/components/form-hint.scss +15 -0
- package/components/form-input.css +1 -0
- package/components/form-input.scss +301 -0
- package/components/form-range.css +1 -1
- package/components/form-range.scss +9 -9
- package/components/form-search-input.css +1 -0
- package/components/form-search-input.scss +97 -0
- package/components/form-select.css +1 -1
- package/components/form-select.scss +266 -55
- package/components/form-textarea.css +1 -1
- package/components/form-textarea.scss +172 -9
- package/components/globals/_index.scss +1 -0
- package/components/globals/post-footer.css +1 -0
- package/components/globals/post-footer.scss +113 -0
- package/components/header/_mixins.scss +48 -0
- package/components/header/index.css +1 -0
- package/components/header/index.scss +131 -0
- package/components/icon-button.css +1 -0
- package/components/icon-button.scss +19 -0
- package/components/icon-close-button.css +1 -0
- package/components/icon-close-button.scss +29 -0
- package/components/intranet-header/_icon.scss +1 -1
- package/components/intranet-header/_index.scss +0 -2
- package/components/intranet-header/_language-chooser.scss +3 -2
- package/components/intranet-header/_nav-overflow.scss +2 -2
- package/components/intranet-header/_scaffolding.scss +1 -1
- package/components/intranet-header/_searchbox.scss +1 -1
- package/components/intranet-header/_sidebar.scss +11 -11
- package/components/intranet-header/_top-navigation.scss +1 -1
- package/components/list-check.css +1 -0
- package/components/list-check.scss +79 -0
- package/components/list-group.css +1 -1
- package/components/list-group.scss +72 -127
- package/components/modal.css +2 -2
- package/components/modal.scss +2 -4
- package/components/offcanvas.css +1 -1
- package/components/offcanvas.scss +0 -2
- package/components/pagination.css +1 -1
- package/components/pagination.scss +10 -9
- package/components/popover.css +1 -1
- package/components/popover.scss +0 -2
- package/components/product-card.css +1 -1
- package/components/product-card.scss +11 -5
- package/components/progress.scss +0 -2
- package/components/radio-button.css +1 -0
- package/components/radio-button.scss +125 -0
- package/components/segmented-button.css +3 -0
- package/components/segmented-button.scss +207 -0
- package/components/skiplinks.css +1 -0
- package/components/skiplinks.scss +20 -0
- package/components/spinner.scss +0 -1
- package/components/stepper.css +1 -1
- package/components/stepper.scss +40 -33
- package/components/subnavigation.css +1 -1
- package/components/subnavigation.scss +17 -14
- package/components/switch.css +1 -0
- package/components/switch.scss +212 -0
- package/components/tables.css +1 -1
- package/components/tables.scss +0 -1
- package/components/tabs/_tab-title.scss +16 -55
- package/components/tabs/_tabs-wrapper.scss +3 -13
- package/components/tabs/index.css +1 -1
- package/components/tabs/index.scss +0 -2
- package/components/tag.css +1 -1
- package/components/tag.scss +1 -2
- package/components/teaser.css +1 -0
- package/components/teaser.scss +83 -0
- package/components/text-highlight.css +1 -1
- package/components/timepicker.css +1 -1
- package/components/timepicker.scss +13 -16
- package/components/toast.css +1 -1
- package/components/toast.scss +19 -16
- package/components/tooltip.css +1 -1
- package/components/tooltip.scss +0 -2
- package/components/transitions.scss +0 -2
- package/components/validation.css +1 -0
- package/components/validation.scss +120 -0
- package/elements/_index.scss +7 -1
- package/elements/anchor.css +1 -0
- package/elements/anchor.scss +33 -0
- package/elements/body.css +1 -1
- package/elements/body.scss +5 -1
- package/elements/fieldset-legend.css +1 -1
- package/elements/fieldset-legend.scss +7 -3
- package/elements/heading.css +1 -1
- package/elements/heading.scss +10 -12
- package/elements/list-bullet.css +1 -0
- package/elements/list-bullet.scss +43 -0
- package/elements/list-description.css +1 -0
- package/elements/list-description.scss +5 -0
- package/elements/list-number.css +1 -0
- package/elements/list-number.scss +33 -0
- package/elements/paragraph.css +1 -0
- package/elements/paragraph.scss +17 -0
- package/elements/reset.css +1 -1
- package/elements/reset.scss +16 -7
- package/elements.css +1 -0
- package/elements.scss +1 -0
- package/fonts.css +1 -1
- package/functions/_breakpoint.scss +26 -0
- package/functions/_forms.scss +46 -3
- package/functions/_icons.scss +2 -14
- package/helpers/_index.scss +4 -0
- package/helpers/clearfix.css +1 -0
- package/helpers/clearfix.scss +5 -0
- package/helpers/focus-ring.css +1 -0
- package/helpers/focus-ring.scss +5 -0
- package/helpers/text-truncation.css +1 -0
- package/helpers/text-truncation.scss +5 -0
- package/helpers/visually-hidden.css +1 -0
- package/helpers/visually-hidden.scss +5 -0
- package/index.css +3 -3
- package/index.scss +2 -5
- package/intranet.css +3 -3
- package/intranet.scss +2 -2
- package/layout/_containers.scss +32 -0
- package/layout/_section.scss +133 -0
- package/layout/grid/_index.scss +11 -0
- package/layout/grid/_mixins.scss +104 -0
- package/layout/grid/_variables.scss +2 -0
- package/layout/index.css +1 -0
- package/layout/index.scss +3 -0
- package/mixins/_button.scss +19 -15
- package/mixins/_form-checks.scss +1 -1
- package/mixins/_forms.scss +42 -33
- package/mixins/_icon-button.scss +27 -0
- package/mixins/_icons.scss +22 -32
- package/mixins/_index.scss +3 -2
- package/mixins/_layout.scss +26 -0
- package/mixins/_list.scss +112 -0
- package/mixins/_media.scss +58 -2
- package/mixins/_notification.scss +59 -53
- package/mixins/_utilities.scss +46 -25
- package/package.json +16 -16
- package/palettes/_mixins.scss +74 -0
- package/palettes/_utilities.scss +3 -0
- package/palettes/_variables.scss +2 -0
- package/palettes/cargo-palettes.css +1 -0
- package/palettes/cargo-palettes.scss +3 -0
- package/palettes/post-palettes.css +1 -0
- package/palettes/post-palettes.scss +3 -0
- package/placeholders/_button.scss +3 -6
- package/placeholders/_close.scss +2 -5
- package/placeholders/_schemes.scss +10 -0
- package/post-external.css +3 -3
- package/post-external.scss +7 -1
- package/post-internal.css +3 -3
- package/post-internal.scss +7 -1
- package/post-tokens-external.css +1 -1
- package/post-tokens-external.scss +1 -1
- package/post-tokens-internal.css +1 -1
- package/post-tokens-internal.scss +1 -1
- package/themes/bootstrap/_core.scss +0 -2
- package/themes/bootstrap/_forms.scss +0 -4
- package/themes/bootstrap/_overrides-variables.scss +0 -6
- package/themes/bootstrap/_utilities.scss +45 -1
- package/tokens/_cargo-theme.scss +8 -0
- package/tokens/_helpers.scss +1 -0
- package/tokens/_palettes.scss +9 -0
- package/tokens/_schemes.scss +11 -0
- package/tokens/_utilities_formatted.scss +1 -0
- package/tokens/temp/_channel.scss +4 -3
- package/tokens/temp/_components.scss +594 -503
- package/tokens/temp/_core.scss +49 -37
- package/tokens/temp/_device.scss +210 -239
- package/tokens/temp/_elements.scss +11 -11
- package/tokens/temp/_helpers.scss +13 -0
- package/tokens/temp/_index.scss +6 -4
- package/tokens/temp/_palettes.scss +19 -0
- package/tokens/temp/_scheme.scss +334 -0
- package/tokens/temp/_theme.scss +28 -9
- package/tokens/temp/_utilities-formatted.scss +128 -0
- package/tokens/temp/_utilities.scss +34 -58
- package/tokens/temp/palettes/_cargo-dark.scss +19 -0
- package/tokens/temp/palettes/_cargo-light.scss +19 -0
- package/tokens/temp/palettes/_post-dark.scss +19 -0
- package/tokens/temp/palettes/_post-light.scss +19 -0
- package/utilities/_not-defined.scss +44 -0
- package/utilities/_variables.scss +304 -22
- package/utilities/index.css +1 -0
- package/utilities/{_index.scss → index.scss} +1 -2
- package/variables/_animation.scss +10 -6
- package/variables/_breakpoints.scss +9 -5
- package/variables/_color.scss +0 -61
- package/variables/_commons.scss +1 -0
- package/variables/_elevation.scss +16 -22
- package/variables/_grid.scss +2 -12
- package/variables/_icons.scss +19 -696
- package/variables/_index.scss +1 -1
- package/variables/_sizing.scss +17 -0
- package/variables/_spacing.scss +0 -152
- package/variables/_type.scss +17 -27
- package/variables/components/_accordion.scss +0 -47
- package/variables/components/_badge.scss +9 -5
- package/variables/components/_button.scss +61 -113
- package/variables/components/_card.scss +7 -4
- package/variables/components/_chip.scss +13 -7
- package/variables/components/_close.scss +14 -8
- package/variables/components/_code.scss +1 -1
- package/variables/components/_datatable.scss +12 -8
- package/variables/components/_dropdowns.scss +1 -1
- package/variables/components/_form-check.scss +9 -46
- package/variables/components/_forms.scss +8 -101
- package/variables/components/_index.scss +0 -5
- package/variables/components/_modal.scss +17 -12
- package/variables/components/_nav.scss +3 -3
- package/variables/components/_navbar.scss +7 -4
- package/variables/components/_notification.scss +48 -37
- package/variables/components/_pagination.scss +14 -6
- package/variables/components/_spinners.scss +7 -2
- package/variables/components/_stepper.scss +15 -10
- package/variables/components/_subnavigation.scss +11 -9
- package/variables/components/_tables.scss +11 -6
- package/variables/components/_tag.scss +10 -7
- package/components/accordion.css +0 -1
- package/components/accordion.scss +0 -100
- package/components/alert.css +0 -1
- package/components/alert.scss +0 -137
- package/components/carousel.css +0 -1
- package/components/carousel.scss +0 -178
- package/components/elevation.css +0 -1
- package/components/elevation.scss +0 -8
- package/components/floating-label.css +0 -1
- package/components/floating-label.scss +0 -353
- package/components/form-check.css +0 -1
- package/components/form-check.scss +0 -297
- package/components/form-validation.css +0 -1
- package/components/form-validation.scss +0 -148
- package/components/forms.css +0 -1
- package/components/forms.scss +0 -215
- package/components/grid.css +0 -1
- package/components/grid.scss +0 -170
- package/components/icons.css +0 -1
- package/components/icons.scss +0 -60
- package/components/sizing.css +0 -1
- package/components/sizing.scss +0 -85
- package/components/topic-teaser.css +0 -1
- package/components/topic-teaser.scss +0 -196
- package/layouts/portal/_grid.scss +0 -85
- package/layouts/portal/_index.scss +0 -2
- package/layouts/portal/_subnavigation.scss +0 -5
- package/layouts/portal/_variables.scss +0 -8
- package/mixins/_accordion.scss +0 -16
- package/mixins/_elevation.scss +0 -6
- package/mixins/_focus.scss +0 -9
- package/mixins/_form-validation.scss +0 -5
- package/mixins/_size.scss +0 -65
- package/placeholders/_modes.scss +0 -10
- package/themes/bootstrap/_carousel.scss +0 -2
- package/themes/bootstrap/_containers.scss +0 -2
- package/themes/bootstrap/_grid.scss +0 -2
- package/themes/bootstrap/_overrides-mixins.scss +0 -33
- package/themes/bootstrap/forms/_floating-labels.scss +0 -2
- package/themes/bootstrap/forms/_form-control.scss +0 -2
- package/themes/bootstrap/forms/_form-select.scss +0 -2
- package/themes/bootstrap/forms/_form-text.scss +0 -2
- package/tokens/_modes.scss +0 -11
- package/tokens/temp/_mode.scss +0 -299
- package/utilities/_functions.scss +0 -35
- package/utilities/temp/_legacy.scss +0 -95
- package/variables/_options.scss +0 -5
- package/variables/components/_carousel.scss +0 -27
- package/variables/components/_figures.scss +0 -6
- package/variables/components/_form-select.scss +0 -13
- package/variables/components/_form-validation.scss +0 -38
- package/variables/components/_list-group.scss +0 -29
- 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
|
+
}
|
package/mixins/_media.scss
CHANGED
|
@@ -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
|
-
@
|
|
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
|
-
@
|
|
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
|
-
|
|
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
|
-
|
|
30
|
-
|
|
31
|
-
padding-inline-start: $padding-x;
|
|
32
|
-
}
|
|
28
|
+
box-shadow: $elevation;
|
|
29
|
+
border-radius: tokens.get('banner-border-radius');
|
|
33
30
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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
|
-
|
|
42
|
-
|
|
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
|
-
|
|
63
|
-
|
|
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
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
128
|
-
|
|
129
|
-
|
|
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
|
}
|
package/mixins/_utilities.scss
CHANGED
|
@@ -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
|
|
67
|
-
|
|
68
|
-
|
|
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)
|
|
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-
|
|
106
|
-
outline
|
|
107
|
-
|
|
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:
|
|
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:
|
|
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:
|
|
164
|
-
border-color:
|
|
165
|
-
border-style:
|
|
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.
|
|
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.
|
|
42
|
-
"@swisspost/design-system-tokens": "9.0.0-next.
|
|
43
|
-
"@types/node": "
|
|
44
|
-
"autoprefixer": "10.4.
|
|
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": "
|
|
50
|
+
"gulp-sass": "6.0.0",
|
|
51
51
|
"jest": "29.7.0",
|
|
52
|
-
"postcss": "8.4.
|
|
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.
|
|
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.
|
|
60
|
+
"stylelint-scss": "6.10.0",
|
|
61
61
|
"typescript": "5.5.4",
|
|
62
|
-
"vite": "
|
|
62
|
+
"vite": "6.0.9"
|
|
63
63
|
},
|
|
64
64
|
"sass": {
|
|
65
|
-
"
|
|
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
|
-
"
|
|
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
|
+
}
|