@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
@@ -14,17 +14,11 @@ $stepper-indicator-font-size: type.$font-size-regular;
14
14
  $stepper-indicator-font-weight: type.$font-weight-base;
15
15
  $stepper-indicator-bg: color.$yellow;
16
16
  $stepper-indicator-color: color.$black;
17
- $_stepper-indicator-check-icon: icon-fn.get-colored-svg-url('2105', $stepper-indicator-color);
18
- $stepper-indicator-check-icon: url($_stepper-indicator-check-icon);
17
+ $stepper-indicator-check-icon-size: spacing.$size-large;
19
18
  $stepper-indicator-hover-color: color.$white;
20
19
  $stepper-indicator-hover-bg: color.$black;
21
20
  $stepper-indicator-hover-outline: forms.$input-focus-outline-thickness solid
22
21
  var(--post-contrast-color);
23
- $_stepper-indicator-hover-check-icon: icon-fn.get-colored-svg-url(
24
- '2105',
25
- $stepper-indicator-hover-color
26
- );
27
- $stepper-indicator-hover-check-icon: url($_stepper-indicator-hover-check-icon);
28
22
  $stepper-indicator-future-bg: color.$gray-60;
29
23
  $stepper-indicator-future-color: color.$white;
30
24
 
@@ -34,3 +28,10 @@ $stepper-link-hover-color: color.$black;
34
28
  $stepper-link-current-color: color.$black;
35
29
  $stepper-link-current-font-size: type.$font-size-regular;
36
30
  $stepper-link-current-font-weight: type.$font-weight-bold;
31
+
32
+ // DEPRECATED
33
+ $stepper-indicator-check-icon: url('#{icon-fn.get-colored-svg-url('2105', $stepper-indicator-color)}');
34
+ $stepper-indicator-hover-check-icon: url('#{icon-fn.get-colored-svg-url(
35
+ '2105',
36
+ $stepper-indicator-hover-color
37
+ )}');
@@ -9,6 +9,11 @@ $content-cols: (
9
9
  xl: 7,
10
10
  );
11
11
 
12
+ $content-gap: (
13
+ rg: 32px,
14
+ xl: 40px,
15
+ );
16
+
12
17
  $image-cols: (
13
18
  xs: 10,
14
19
  rg: 8,
@@ -1,44 +0,0 @@
1
- @forward './../variables/options';
2
-
3
- @use './../variables';
4
- @use './../variables/components/form-feedback';
5
- @use './../variables/components/form-select';
6
- @use './../variables/components/forms';
7
- @use './../variables/components/button';
8
- @use './../mixins/forms' as forms-mixins;
9
- @use './../mixins/utilities' as utility-mixins;
10
-
11
- .invalid-feedback,
12
- .valid-feedback {
13
- margin-bottom: 0;
14
-
15
- @include utility-mixins.high-contrast-mode() {
16
- color: HighlightText !important;
17
- background-color: Highlight !important;
18
- forced-color-adjust: none;
19
- }
20
- }
21
-
22
- .invalid-feedback {
23
- padding: button.$input-btn-padding-x * 0.5 button.$input-btn-padding-x;
24
- background: form-feedback.$form-feedback-invalid-bg;
25
- color: form-feedback.$form-feedback-invalid-text;
26
- }
27
-
28
- .valid-feedback {
29
- padding: button.$input-btn-padding-x * 0.5 button.$input-btn-padding-x;
30
- background: form-feedback.$form-feedback-valid-bg;
31
- color: form-feedback.$form-feedback-valid-text;
32
- }
33
-
34
- .valid-feedback.custom-feedback {
35
- background: form-feedback.$form-feedback-custom-bg;
36
- color: form-feedback.$form-feedback-custom-text;
37
- }
38
-
39
- .was-validated .form-control:invalid,
40
- .form-control.is-invalid,
41
- .was-validated .form-control:valid,
42
- .form-control.is-valid {
43
- background-size: form-feedback.$form-feedback-icon-size;
44
- }
@@ -1,214 +0,0 @@
1
- @forward './../variables/options';
2
-
3
- @use './../lic/bootstrap-license';
4
- @use './../themes/bootstrap/core' as *;
5
- @use './../themes/bootstrap/nav' as n;
6
-
7
- @use './../variables/components/nav';
8
- @use './../variables/spacing';
9
- @use './../variables/commons';
10
- @use './../variables/color';
11
- @use './../mixins/color' as color-mx;
12
- @use './../mixins/utilities';
13
-
14
- .tabs-wrapper {
15
- position: relative;
16
- padding-top: spacing.$spacer;
17
- border: 0;
18
- background-color: color.$gray-background-light;
19
-
20
- // Create a line that lies below the active but above the passive elements
21
- // This way hover works smoothly with the background color
22
- &::after {
23
- content: '';
24
- position: absolute;
25
- bottom: 0;
26
- width: 100%;
27
- height: 1px;
28
- background-color: nav.$nav-tabs-border-color;
29
- }
30
-
31
- // Small hack to save a lot of code and provide a lot of flexibility to tabs coloring
32
- .tabs {
33
- background-color: transparent !important;
34
- }
35
-
36
- @include utilities.high-contrast-mode() {
37
- &::after {
38
- background-color: ButtonBorder;
39
- }
40
- }
41
- }
42
-
43
- .tabs {
44
- flex-wrap: nowrap;
45
- overflow-x: auto;
46
-
47
- /* prevent scroll chaining on x scroll */
48
- overscroll-behavior-x: contain;
49
- white-space: nowrap;
50
-
51
- // Scrolling fix, make the tabs scroll a little more so the right most tab is not
52
- // flush with the window border
53
- &::after {
54
- content: '';
55
- display: block;
56
- flex: 1 0 auto;
57
- width: nav.$nav-link-padding-x;
58
- }
59
-
60
- .tab-title {
61
- position: relative;
62
- box-sizing: border-box;
63
- padding: nav.$nav-link-padding;
64
- transition: background-color 100ms;
65
- border-right: 1px solid transparent;
66
- border-left: 1px solid transparent;
67
- outline-color: currentColor;
68
- opacity: 0.7;
69
- color: var(--post-contrast-color);
70
-
71
- &:focus {
72
- opacity: 0.7;
73
- background-color: unset;
74
- color: var(--post-contrast-color);
75
- }
76
-
77
- &:hover {
78
- opacity: 1;
79
- background-color: nav.$nav-tabs-link-active-bg;
80
- color: var(--post-contrast-color);
81
- }
82
-
83
- // same styles as focus, can't use placeholder here because focus-visible can't be described outside of the support condition
84
- &:focus-visible {
85
- outline: transparent;
86
- opacity: 1;
87
- background-color: nav.$nav-tabs-link-active-bg;
88
- color: var(--post-contrast-color);
89
- box-shadow: none;
90
-
91
- &::after {
92
- content: '';
93
- display: block;
94
- position: absolute;
95
- top: $nav-tabs-focus-box-shadow-width;
96
- right: $nav-tabs-focus-box-shadow-width - 1px;
97
- bottom: 0;
98
- left: $nav-tabs-focus-box-shadow-width - 1px;
99
- box-shadow: nav.$nav-tabs-focus-box-shadow;
100
- }
101
- }
102
-
103
- &.active {
104
- z-index: 1; // Lift above the line and make focus visible all around
105
- border-right-color: nav.$nav-tabs-border-color;
106
- border-left-color: nav.$nav-tabs-border-color;
107
- opacity: 1;
108
- background-color: nav.$nav-tabs-link-active-bg;
109
- color: var(--post-contrast-color);
110
- font-weight: 700;
111
-
112
- // Create a line that does not suffer from border corner mitering
113
- &::before {
114
- content: '';
115
- display: block;
116
- position: absolute;
117
- top: 0;
118
- right: -1px;
119
- left: -1px;
120
- height: spacing.$size-micro;
121
- background-color: nav.$nav-tabs-link-active-border-color;
122
- }
123
- }
124
-
125
- @include utilities.high-contrast-mode() {
126
- opacity: 1;
127
- border-left-color: Canvas;
128
- border-right-color: Canvas;
129
- color: LinkText;
130
-
131
- &:hover,
132
- &:focus,
133
- &:focus-within,
134
- &:focus-visible {
135
- outline: spacing.$size-line solid Highlight;
136
- outline-offset: -(spacing.$size-micro);
137
- }
138
-
139
- &.active {
140
- border-left-color: ButtonText;
141
- border-right-color: ButtonText;
142
- color: Highlight;
143
-
144
- &::before {
145
- background-color: Highlight;
146
- }
147
- }
148
- }
149
- }
150
-
151
- // Tabs with dark backgrounds
152
- @include color-mx.on-dark-background(true) {
153
- .tab-title {
154
- &:hover {
155
- background-color: rgba(nav.$nav-tabs-link-active-bg, 0.2);
156
- }
157
-
158
- &:focus-visible {
159
- background-color: rgba(nav.$nav-tabs-link-active-bg, 0.2);
160
- }
161
- }
162
- }
163
- }
164
-
165
- .tab-content {
166
- padding-top: spacing.$spacer;
167
- padding-bottom: spacing.$spacer;
168
- }
169
-
170
- // Careful, this generates a lot of code
171
- @each $key, $color in color.$background-colors {
172
- .bg-#{$key} {
173
- .tabs-wrapper {
174
- background-color: $color;
175
- }
176
-
177
- .tab-title {
178
- background-color: $color;
179
-
180
- &.active {
181
- background-color: $color;
182
- }
183
- }
184
-
185
- .nav-item {
186
- background-color: $color;
187
- }
188
- }
189
- }
190
-
191
- [class*='bg-'] .tab-title.active {
192
- &:focus {
193
- &::after {
194
- background-color: rgba(255, 255, 255, 0.2);
195
- }
196
- }
197
-
198
- // write supports for selectors this way: https://stackoverflow.com/a/62666132
199
- // need to include * otherwise it throws build error
200
- @supports #{'\selector(*:focus-visible)'} {
201
- &:focus {
202
- &::after {
203
- background-color: unset;
204
- }
205
- }
206
-
207
- // same styles as focus, can't use placeholder here because focus-visible can't be described outside of the support condition
208
- &:focus-visible {
209
- &::after {
210
- background-color: rgba(255, 255, 255, 0.2);
211
- }
212
- }
213
- }
214
- }
@@ -1,13 +0,0 @@
1
- @use './../variables/components/notification';
2
- @use './../variables/components/close';
3
-
4
- %notification-body {
5
- display: flex;
6
- flex-direction: column;
7
- justify-content: center;
8
- gap: notification.$notification-body-gap;
9
-
10
- > * {
11
- margin: 0;
12
- }
13
- }
@@ -1,38 +0,0 @@
1
- @use './../color';
2
- @use './../type';
3
- @use './../spacing';
4
- @use './../animation';
5
-
6
- // Design System custom variables
7
- $form-switch-border-color: color.$gray-60 !default;
8
- $form-switch-checked-border-color: color.$black !default;
9
-
10
- // Bootstrap variables
11
- $form-switch-color: color.$white !default;
12
- $form-switch-width: 2 * spacing.$size-big !default;
13
- $form-switch-padding-start: 0 !default;
14
- $form-switch-bg-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='-16 -16 32 32'><circle r='15' stroke='#{$form-switch-border-color}' stroke-width='2' fill='#{$form-switch-color}'/></svg>") !default;
15
- $form-switch-border-radius: $form-switch-width !default;
16
- $form-switch-transition: background-position animation.$transition-base-timing,
17
- background-color animation.$transition-time-default !default;
18
- $form-switch-checked-color: color.$white !default;
19
- $form-switch-checked-bg-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='-16 -16 32 32'><circle r='15' stroke='#{$form-switch-checked-border-color}' stroke-width='2' fill='#{$form-switch-checked-color}'/></svg>") !default;
20
- $form-switch-focus-bg-image: $form-switch-checked-bg-image;
21
-
22
- // Design System custom variables
23
- $form-switch-height: spacing.$size-big !default;
24
- $form-switch-bg: rgba(var(--post-contrast-color-rgb), 0.3) !default;
25
- $form-switch-hover-bg: rgba(var(--post-contrast-color-rgb), 0.1) !default;
26
- $form-switch-checked-bg: var(--post-success) !default;
27
- $form-switch-checked-bg-image-size: $form-switch-height;
28
- $form-switch-linear-gradient: linear-gradient(
29
- to left,
30
- #{$form-switch-bg} 50%,
31
- #{$form-switch-checked-bg} 50%
32
- );
33
- $form-switch-linear-gradient-size: (2 * $form-switch-width - $form-switch-height)
34
- $form-switch-height;
35
- $form-switch-label-padding-top: ($form-switch-height - type.$line-height-copy) * 0.5 !default;
36
- $form-switch-label-padding-x: spacing.$size-regular !default;
37
- $form-switch-label-padding-start: $form-switch-label-padding-top 0 0 $form-switch-label-padding-x !default;
38
- $form-switch-label-padding-end: $form-switch-label-padding-top $form-switch-label-padding-x 0 0 !default;