@swisspost/design-system-styles 6.3.0 → 6.4.1

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 (54) hide show
  1. package/_svg-icon-map.scss +25 -1
  2. package/basics.css +1 -3
  3. package/components/_index.scss +2 -1
  4. package/components/alert.scss +3 -7
  5. package/components/card.scss +3 -18
  6. package/components/choice-control-card.scss +146 -0
  7. package/components/datatable.scss +6 -9
  8. package/components/datepicker.scss +42 -4
  9. package/components/dropdown.scss +18 -30
  10. package/components/floating-label.scss +6 -5
  11. package/components/form-check.scss +94 -177
  12. package/components/form-select.scss +1 -1
  13. package/components/form-validation.scss +116 -0
  14. package/components/forms.scss +4 -2
  15. package/components/intranet-header/_logo.scss +1 -4
  16. package/components/intranet-header/_nav-overflow.scss +9 -4
  17. package/components/pagination.scss +22 -19
  18. package/components/product-card.scss +6 -1
  19. package/components/stepper.scss +73 -42
  20. package/components/subnavigation.scss +3 -4
  21. package/components/tabs/_tab-title.scss +152 -0
  22. package/components/tabs/_tabs-wrapper.scss +69 -0
  23. package/components/tabs/index.scss +2 -0
  24. package/components/timepicker.scss +1 -5
  25. package/components/toast.scss +6 -2
  26. package/components/topic-teaser.scss +24 -14
  27. package/functions/_icons.scss +10 -0
  28. package/index.css +4 -10
  29. package/intranet.css +4 -10
  30. package/mixins/_animation.scss +1 -0
  31. package/mixins/_button.scss +2 -1
  32. package/mixins/_color.scss +7 -2
  33. package/mixins/_forms.scss +4 -71
  34. package/mixins/_notification.scss +48 -19
  35. package/package.json +15 -14
  36. package/placeholders/_dropdown.scss +0 -3
  37. package/placeholders/_index.scss +0 -1
  38. package/placeholders/_text.scss +4 -4
  39. package/themes/bootstrap/_core.scss +2 -0
  40. package/themes/bootstrap/_overrides-mixins.scss +33 -0
  41. package/themes/bootstrap/_overrides-variables.scss +1 -2
  42. package/variables/_type.scss +1 -0
  43. package/variables/components/_datatable.scss +6 -10
  44. package/variables/components/_form-check.scss +48 -11
  45. package/variables/components/{_form-feedback.scss → _form-validation.scss} +15 -11
  46. package/variables/components/_forms.scss +2 -2
  47. package/variables/components/_index.scss +1 -2
  48. package/variables/components/_notification.scss +4 -1
  49. package/variables/components/_stepper.scss +8 -7
  50. package/variables/components/_topic-teaser.scss +5 -0
  51. package/components/form-feedback.scss +0 -44
  52. package/components/tabs.scss +0 -214
  53. package/placeholders/_notification.scss +0 -13
  54. package/variables/components/_form-switch.scss +0 -38
@@ -1,236 +1,153 @@
1
1
  @forward './../variables/options';
2
2
 
3
- @use 'sass:math';
4
- @use './../lic/bootstrap-license';
5
- @use './../themes/bootstrap/core' as *;
6
- @use './../themes/bootstrap/forms/form-check' as bfc;
7
-
8
- @use './../variables/color';
9
- @use './../variables/spacing';
10
- @use './../variables/components/form-check';
11
- @use './../variables/components/form-switch';
12
- @use './../variables/components/button';
13
- @use './../mixins/form-checks' as form-checks-mixins;
14
- @use './../mixins/utilities';
15
- @use './../functions/icons' as fi;
16
- @use './../functions/icons';
3
+ @use '../variables/color';
4
+ @use '../variables/spacing';
5
+ @use '../variables/animation';
6
+ @use '../variables/components/form-check';
7
+ @use '../mixins/icons' as icons-mx;
17
8
 
18
9
  .form-check {
19
10
  display: flex;
20
11
  flex-wrap: wrap;
21
- align-items: flex-start;
12
+ row-gap: form-check.$form-check-row-gap;
13
+ column-gap: form-check.$form-check-column-gap;
14
+ margin-bottom: form-check.$form-check-margin-bottom;
22
15
 
23
- &-reverse {
24
- flex-direction: row-reverse;
25
- justify-content: flex-end;
26
- }
27
-
28
- &.form-check-inline {
16
+ &-inline {
29
17
  display: inline-flex;
30
18
  }
31
19
 
20
+ &-input,
32
21
  &-label {
33
- flex: 1;
34
- padding: form-check.$form-check-label-padding-start;
22
+ color: rgba(var(--post-contrast-color-rgb), 0.8);
23
+ transition: color animation.$transition-base-timing;
35
24
 
36
- &.order-first {
37
- flex: 0 0 auto;
38
- padding: form-check.$form-check-label-padding-end;
25
+ &:not([disabled]) {
26
+ cursor: pointer;
39
27
  }
40
28
 
41
- .form-check-input:disabled ~ & {
42
- cursor: default;
29
+ &:hover:not([disabled]),
30
+ &:hover:not([disabled]) ~ &-label {
31
+ color: var(--post-contrast-color);
43
32
  }
44
33
  }
45
34
 
46
35
  &-input {
47
- flex: 0 0 auto;
48
- margin-top: 0;
36
+ display: inline-flex;
37
+ flex: 0 auto;
38
+ appearance: none;
39
+ background: none;
40
+ height: form-check.$form-check-input-size;
41
+ width: form-check.$form-check-input-size;
42
+ border: form-check.$form-check-input-border-width solid
43
+ rgba(var(--post-contrast-color-rgb), 0.8);
49
44
 
50
- &:not(:disabled) {
51
- cursor: form-check.$form-check-label-cursor;
45
+ &:focus {
46
+ outline: none;
47
+ border-color: currentColor;
48
+ box-shadow: form-check.$form-check-input-focus-box-shadow;
52
49
  }
53
50
 
54
- &[type='radio']:checked,
55
- &[type='checkbox']:checked,
56
- &[type='checkbox']:indeterminate {
57
- @include form-checks-mixins.form-check-color(form-check.$form-check-input-checked-color);
51
+ &::after {
52
+ content: '';
53
+ display: block;
54
+ flex: 1;
58
55
  }
59
56
 
60
- .was-validated &:valid ~ .form-check-label,
61
- &.is-valid ~ .form-check-label {
62
- color: form-check.$form-check-label-color;
63
- }
57
+ &:checked,
58
+ &:indeterminate {
59
+ color: var(--post-contrast-color);
60
+ border-color: var(--post-contrast-color);
64
61
 
65
- &.is-valid,
66
- &.is-invalid {
67
- &[type='radio']:checked,
68
- &[type='checkbox']:checked,
69
- &[type='checkbox']:indeterminate {
70
- background-color: transparent;
62
+ ~ .form-check-label {
63
+ color: var(--post-contrast-color);
71
64
  }
72
65
  }
73
66
 
74
- &[type='radio']:hover:not(:disabled),
75
- &[type='checkbox']:hover:not(:disabled) {
76
- @include form-checks-mixins.form-check-color(form-check.$form-check-input-hover-color);
77
- }
78
- }
79
-
80
- .valid-feedback,
81
- .invalid-feedback {
82
- flex: 1 0 100%;
83
- margin-top: form-check.$form-check-feedback-margin-top;
84
- margin-left: -1 * form-check.$form-check-padding-start;
85
- }
86
-
87
- // Styles to improve accessibility in high contrast mode
88
- @include utilities.high-contrast-mode() {
89
- &-input {
90
- &[type='checkbox']:checked {
91
- background-image: url(fi.get-colored-svg-url(2105, color.$white));
67
+ &[type='checkbox'] {
68
+ &:checked::after {
69
+ @include icons-mx.icon(3035);
92
70
  }
93
71
 
94
- &[type='radio']:checked {
95
- background-image: url(icons.add-fill-color(
96
- form-check.$form-check-radio-checked-bg-icon,
97
- color.$white
98
- ));
72
+ &:indeterminate::after {
73
+ @include icons-mx.icon(2039);
99
74
  }
75
+ }
100
76
 
101
- // use color: graytext to highlight the text in the disabled color
102
- &:disabled,
103
- &[disabled] {
104
- border-color: graytext !important;
105
- opacity: 1;
77
+ &[type='radio'] {
78
+ border-radius: 50%;
106
79
 
107
- ~ .form-check-label {
108
- opacity: 1;
109
- color: graytext !important;
110
- }
80
+ &:checked::after {
81
+ margin: spacing.$size-micro;
82
+ background-color: currentColor;
83
+ border-radius: inherit;
111
84
  }
85
+ }
112
86
 
113
- &:focus {
114
- outline: 2px solid transparent;
115
- }
87
+ &[disabled],
88
+ &[disabled] ~ .form-check-label {
89
+ opacity: 1; // Bootstrap reset
90
+ border-color: rgba(var(--post-contrast-color-rgb), 0.4) !important;
91
+ color: rgba(var(--post-contrast-color-rgb), 0.4) !important;
116
92
  }
117
93
  }
118
- }
119
94
 
120
- @each $colorname, $color in color.$background-colors {
121
- .bg-#{$colorname} {
122
- $color-contrast: color-contrast($color, form-check.$form-check-input-color);
123
-
124
- @if ($color-contrast == color.$white) {
125
- @include form-checks-mixins.form-check-variant(
126
- color.$white,
127
- rgba(color.$white, 0.6),
128
- rgba(color.$white, 0.8)
129
- );
130
- } @else if($color-contrast == color.$black) {
131
- @include form-checks-mixins.form-check-variant(
132
- color.$black,
133
- rgba(color.$black, 0.6),
134
- rgba(color.$black, 0.8)
135
- );
136
- }
95
+ &-label {
96
+ flex: 1;
137
97
  }
138
98
  }
139
99
 
140
100
  .form-switch {
141
- .form-check-label {
142
- padding: form-switch.$form-switch-label-padding-start;
143
-
144
- &.order-first {
145
- padding: form-switch.$form-switch-label-padding-end;
146
- }
147
- }
101
+ column-gap: form-check.$form-switch-column-gap;
148
102
 
149
103
  .form-check-input {
150
- height: form-switch.$form-switch-height;
104
+ height: form-check.$form-switch-height;
105
+ width: form-check.$form-switch-width;
151
106
  border: 0;
152
- outline-offset: button.$input-btn-focus-width * 1.5;
153
- background-image: escape-svg(form-switch.$form-switch-bg-image),
154
- form-switch.$form-switch-linear-gradient;
155
- background-position: left center, right center;
156
- background-size: form-switch.$form-switch-checked-bg-image-size,
157
- form-switch.$form-switch-linear-gradient-size;
107
+ border-radius: form-check.$form-switch-width;
108
+ background-image: form-check.$form-switch-background-image;
109
+ background-size: 2 * form-check.$form-switch-width;
110
+ background-position-x: 0;
111
+ transition: background-color animation.$transition-base-timing,
112
+ background-position animation.$transition-base-timing;
158
113
 
159
- &:focus {
160
- background-image: escape-svg(form-switch.$form-switch-bg-image),
161
- form-switch.$form-switch-linear-gradient;
162
- box-shadow: none;
163
- outline: button.$input-btn-focus-width solid var(--post-contrast-color, color.$black);
164
- }
165
-
166
- @supports selector(:focus-visible) {
167
- &:focus {
168
- outline-color: transparent;
169
- }
170
-
171
- &:focus-visible {
172
- outline: button.$input-btn-focus-width solid var(--post-contrast-color, color.$black);
173
- }
114
+ &::after {
115
+ max-width: form-check.$form-switch-height;
116
+ background-color: form-check.$form-switch-color;
117
+ border: form-check.$form-check-input-border-width solid form-check.$form-switch-border-color;
118
+ border-radius: 50%;
119
+ transition: transform animation.$transition-base-timing;
174
120
  }
175
121
 
176
122
  &:checked {
177
- background-image: escape-svg(form-switch.$form-switch-checked-bg-image),
178
- form-switch.$form-switch-linear-gradient;
179
- background-position: right center, left center;
180
- }
181
-
182
- &:checked:focus {
183
- background-image: escape-svg(form-switch.$form-switch-checked-bg-image),
184
- form-switch.$form-switch-linear-gradient;
185
- }
186
-
187
- &:hover:not(:disabled) {
188
- background-color: form-switch.$form-switch-hover-bg;
189
- }
190
-
191
- @include utilities.high-contrast-mode() {
192
- --post-success: ActiveText;
123
+ background-position-x: form-check.$form-switch-width;
193
124
 
194
- // linear-gradients or statements which contains linear-gradients are disabled in firefox
195
- // so we have to repeat background-image statements here without linear-gradients
196
-
197
- background-image: escape-svg(form-switch.$form-switch-checked-bg-image);
198
- background-color: Field;
199
- border: button.$input-btn-focus-width solid FieldText;
200
-
201
- &:focus {
202
- background-image: escape-svg(form-switch.$form-switch-checked-bg-image);
203
- border-color: FieldText;
204
- outline: none;
125
+ &::after {
126
+ mask: none;
127
+ background-color: form-check.$form-switch-color;
128
+ border-color: form-check.$form-switch-checked-border-color;
129
+ transform: translateX(2rem);
205
130
  }
131
+ }
206
132
 
207
- &:hover:not(:disabled) {
208
- border-color: Highlight;
209
- }
133
+ &[disabled] {
134
+ background: form-check.$form-switch-disabled-bg;
210
135
 
211
- &:focus-visible {
212
- outline: button.$input-btn-focus-width solid Highlight;
136
+ &::after {
137
+ border-color: form-check.$form-switch-disabled-border-color;
213
138
  }
139
+ }
140
+ }
214
141
 
215
- &:checked {
216
- background-color: var(--post-success);
217
- background-image: escape-svg(form-switch.$form-switch-checked-bg-image);
142
+ &:hover > .form-check-input:not([disabled]) {
143
+ background-color: rgba(var(--post-contrast-color-rgb), 0.1);
144
+ }
218
145
 
219
- &:focus {
220
- background-color: var(--post-success);
221
- background-image: escape-svg(form-switch.$form-switch-checked-bg-image);
222
- }
146
+ .form-check-label {
147
+ padding-top: form-check.$form-switch-label-padding-top;
223
148
 
224
- &:hover:not(:disabled) {
225
- background-color: var(--post-success);
226
- border-color: Highlight;
227
- }
228
- }
149
+ &.order-first {
150
+ flex: 0 auto;
229
151
  }
230
152
  }
231
-
232
- .valid-feedback,
233
- .invalid-feedback {
234
- margin-left: -1 * form-switch.$form-switch-padding-start;
235
- }
236
153
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  @use './../lic/bootstrap-license';
4
4
  @use './../themes/bootstrap/core' as *;
5
- @use './../themes/bootstrap/forms' as bf;
5
+ @use './../themes/bootstrap/forms/form-select' as bffs;
6
6
  @use './../mixins/forms' as forms-mixins;
7
7
  @use './../mixins/utilities';
8
8
 
@@ -0,0 +1,116 @@
1
+ @forward './../variables/options';
2
+
3
+ @use './../lic/bootstrap-license';
4
+ @use './../themes/bootstrap/core' as *;
5
+ @use './../themes/bootstrap/forms/validation' as bfv;
6
+
7
+ @use './../mixins/color' as color-mx;
8
+ @use './../mixins/utilities' as utilities-mx;
9
+ @use './../variables/color';
10
+ @use './../variables/components/form-validation';
11
+
12
+ .invalid-feedback,
13
+ .valid-feedback {
14
+ display: none;
15
+ width: 100%;
16
+ margin-block: form-validation.$form-feedback-margin-top 0;
17
+ padding: form-validation.$form-feedback-padding-y form-validation.$form-feedback-padding-x;
18
+ font-size: form-validation.$form-feedback-font-size;
19
+
20
+ @include utilities-mx.high-contrast-mode() {
21
+ color: HighlightText !important;
22
+ background-color: Highlight !important;
23
+ forced-color-adjust: none;
24
+ }
25
+ }
26
+
27
+ .invalid-feedback {
28
+ background: form-validation.$form-feedback-invalid-bg;
29
+ color: form-validation.$form-feedback-invalid-text;
30
+ }
31
+
32
+ .valid-feedback {
33
+ background: form-validation.$form-feedback-valid-bg;
34
+ color: form-validation.$form-feedback-valid-text;
35
+ }
36
+
37
+ .valid-feedback.custom-feedback {
38
+ background: form-validation.$form-feedback-custom-bg;
39
+ color: form-validation.$form-feedback-custom-text;
40
+ }
41
+
42
+ @each $state, $data in $form-validation-states {
43
+ $icon: map-get($data, 'icon');
44
+
45
+ @include form-validation-state-selector($state) {
46
+ ~ .#{$state}-feedback,
47
+ ~ .#{$state}-tooltip {
48
+ display: block;
49
+ }
50
+ }
51
+
52
+ .form-control {
53
+ @include form-validation-state-selector($state) {
54
+ padding-right: $input-height-inner;
55
+ background-image: escape-svg($icon);
56
+ background-repeat: no-repeat;
57
+ background-position: right $input-height-inner-quarter center;
58
+ background-size: form-validation.$form-feedback-icon-size;
59
+ }
60
+ }
61
+
62
+ textarea.form-control {
63
+ @include form-validation-state-selector($state) {
64
+ padding-right: $input-height-inner;
65
+ background-position: top $input-height-inner-quarter right $input-height-inner-quarter;
66
+ }
67
+ }
68
+
69
+ .input-group {
70
+ > .form-control:not(:focus),
71
+ > .form-select:not(:focus),
72
+ > .form-floating:not(:focus-within) {
73
+ @include form-validation-state-selector($state) {
74
+ @if $state == 'valid' {
75
+ z-index: 3;
76
+ } @else if $state == 'invalid' {
77
+ z-index: 4;
78
+ }
79
+ }
80
+ }
81
+ }
82
+ }
83
+
84
+ .form-control,
85
+ .form-select {
86
+ @include form-validation-state-selector(invalid) {
87
+ border-color: form-validation.$form-feedback-invalid-color;
88
+
89
+ &:focus {
90
+ border-color: form-validation.$form-feedback-invalid-color;
91
+ box-shadow: form-validation.$form-feedback-invalid-box-shadow;
92
+ }
93
+ }
94
+ }
95
+
96
+ .form-check-input {
97
+ @include form-validation-state-selector(invalid) {
98
+ border-color: form-validation.$form-feedback-invalid-color;
99
+
100
+ &:focus {
101
+ box-shadow: form-validation.$form-feedback-invalid-box-shadow;
102
+ }
103
+
104
+ ~ .form-check-label {
105
+ color: form-validation.$form-feedback-invalid-color;
106
+ }
107
+
108
+ @include color-mx.on-dark-background {
109
+ border-color: inherit;
110
+
111
+ ~ .form-check-label {
112
+ color: color.$white;
113
+ }
114
+ }
115
+ }
116
+ }
@@ -7,8 +7,10 @@
7
7
  @use './../mixins/utilities';
8
8
  @use './../mixins/forms' as form-mixins;
9
9
 
10
- @use './../themes/bootstrap/forms' as bf;
11
- @use './../themes/bootstrap/forms/input-group';
10
+ @use './../themes/bootstrap/forms/labels' as bfl;
11
+ @use './../themes/bootstrap/forms/form-text' as bfft;
12
+ @use './../themes/bootstrap/forms/form-control' as bffc;
13
+ @use './../themes/bootstrap/forms/input-group' as bfig;
12
14
 
13
15
  .form-control-rg {
14
16
  @include form-mixins.form-control-rg;
@@ -8,10 +8,7 @@
8
8
  flex: 0 1 intranet-header.$header-content-size;
9
9
  }
10
10
 
11
- .header-logo-de,
12
- .header-logo-en,
13
- .header-logo-fr,
14
- .header-logo-it {
11
+ .header-logo {
15
12
  display: block;
16
13
  padding: 0;
17
14
  width: intranet-header.$header-content-size;
@@ -1,6 +1,6 @@
1
1
  @use './../../variables/color';
2
2
  @use './../../variables/commons';
3
- @use './../../functions/icons';
3
+ @use './../../mixins/icons' as icons-mx;
4
4
 
5
5
  @use './../../themes/bootstrap/core' as *;
6
6
  @use './../../placeholders/dropdown';
@@ -14,13 +14,18 @@
14
14
  }
15
15
 
16
16
  > .nav-link::after {
17
- @extend %toggler-icon;
18
- background-image: url(icons.get-colored-svg-url('2051', color.$gray-80));
17
+ display: inline-flex;
18
+ align-items: center;
19
+
20
+ &::after {
21
+ @extend %toggler-icon;
22
+ @include icons-mx.icon(2051);
23
+ }
19
24
  }
20
25
 
21
26
  &.hidden {
22
27
  > .nav-link::after {
23
- background-image: url(icons.get-colored-svg-url('2052', color.$gray-80)); // Angle downwards
28
+ transform: rotate(180deg);
24
29
  }
25
30
  }
26
31
  }
@@ -5,9 +5,9 @@
5
5
  @use './../variables/components/pagination';
6
6
  @use './../variables/spacing';
7
7
  @use './../variables/commons';
8
+ @use './../variables/icons';
8
9
  @use './../mixins/icons' as icon-mixin;
9
10
  @use './../mixins/utilities';
10
- @use './icons.scss';
11
11
 
12
12
  .pagination {
13
13
  .page-item {
@@ -34,32 +34,35 @@
34
34
  }
35
35
  }
36
36
 
37
+ &[aria-label='First'],
37
38
  &[aria-label='Previous'],
38
- &[aria-label='Next'] {
39
- display: flex;
40
- align-items: center;
41
- justify-content: center;
42
- padding: 0;
39
+ &[aria-label='Next'],
40
+ &[aria-label='Last'] {
41
+ > span {
42
+ display: inline-block;
43
+ width: icons.$icon-size-default;
44
+ height: icons.$icon-size-default;
45
+ }
43
46
  }
44
47
 
45
- &[aria-label='Previous'] span,
46
- &[aria-label='Next'] span {
47
- display: none;
48
+ &[aria-label='Previous'],
49
+ &[aria-label='Next'] {
50
+ > span {
51
+ @include icon-mixin.icon(2110);
52
+ }
48
53
  }
49
54
 
50
- &[aria-label='Previous'] {
51
- &::before {
52
- @extend %pi;
53
- @include icon-mixin.pi(2110, pagination.$pagination-color);
54
- content: '';
55
+ &[aria-label='First'],
56
+ &[aria-label='Last'] {
57
+ > span {
58
+ @include icon-mixin.icon(2396);
55
59
  }
56
60
  }
57
61
 
58
- &[aria-label='Next'] {
59
- &::before {
60
- @extend %pi;
61
- @include icon-mixin.pi(2111, pagination.$pagination-color);
62
- content: '';
62
+ &[aria-label='Next'],
63
+ &[aria-label='Last'] {
64
+ > span {
65
+ transform: rotate(180deg);
63
66
  }
64
67
  }
65
68
 
@@ -49,7 +49,8 @@
49
49
  color: inherit;
50
50
  text-decoration: none;
51
51
 
52
- > .pi {
52
+ > .pi,
53
+ > post-icon {
53
54
  flex-shrink: 0;
54
55
  width: 3rem;
55
56
  height: 3rem;
@@ -62,6 +63,9 @@
62
63
  }
63
64
 
64
65
  .post-card-favourit {
66
+ display: flex;
67
+ align-items: center;
68
+ justify-content: center;
65
69
  position: absolute;
66
70
  top: 0.5rem;
67
71
  right: 0.5rem;
@@ -69,5 +73,6 @@
69
73
  border-radius: 0;
70
74
  background: transparent;
71
75
  box-shadow: none;
76
+ color: currentColor;
72
77
  }
73
78
  }