@swisspost/design-system-styles 6.6.4 → 7.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/_svg-icon-map.scss +927 -907
  2. package/basics.css +1 -1
  3. package/components/_index.scss +4 -1
  4. package/components/alert.scss +6 -1
  5. package/components/badge.scss +25 -78
  6. package/components/button-group.scss +2 -4
  7. package/components/button.scss +82 -31
  8. package/components/card-control.scss +322 -0
  9. package/components/carousel.scss +1 -1
  10. package/components/chip.scss +159 -0
  11. package/components/datepicker.scss +24 -12
  12. package/components/error-container.scss +9 -0
  13. package/components/floating-label.scss +0 -1
  14. package/components/form-check.scss +118 -31
  15. package/components/form-range.scss +94 -19
  16. package/components/form-select.scss +64 -15
  17. package/components/form-validation.scss +32 -13
  18. package/components/forms.scss +51 -13
  19. package/components/intranet-header/_sidebar.scss +24 -5
  20. package/components/sizing.scss +2 -2
  21. package/components/spinner.scss +6 -12
  22. package/components/stepper.scss +283 -138
  23. package/components/subnavigation.scss +2 -5
  24. package/components/tables.scss +1 -1
  25. package/components/tabs/_tabs-wrapper.scss +1 -1
  26. package/components/tag.scss +82 -0
  27. package/components/topic-teaser.scss +1 -2
  28. package/components/utilities.scss +0 -2
  29. package/functions/_color.scss +12 -0
  30. package/functions/_forms.scss +22 -0
  31. package/functions/_list.scss +2 -1
  32. package/functions/_sizing.scss +2 -2
  33. package/functions/_utilities.scss +3 -3
  34. package/index.css +3 -3
  35. package/intranet.css +3 -3
  36. package/mixins/_accordion.scss +2 -2
  37. package/mixins/_button.scss +1 -2
  38. package/mixins/_chip.scss +36 -0
  39. package/mixins/_forms.scss +1 -0
  40. package/mixins/_icons.scss +1 -3
  41. package/mixins/_index.scss +1 -1
  42. package/mixins/_utilities.scss +85 -0
  43. package/package.json +15 -15
  44. package/placeholders/_badge.scss +4 -56
  45. package/placeholders/_button.scss +2 -0
  46. package/placeholders/_close.scss +8 -1
  47. package/placeholders/_color.scss +10 -0
  48. package/themes/bootstrap/_overrides-color.scss +4 -14
  49. package/themes/bootstrap/_overrides-variables.scss +1 -0
  50. package/variables/_color.scss +104 -44
  51. package/variables/_commons.scss +2 -0
  52. package/variables/_features.scss +1 -3
  53. package/variables/_icons.scss +4 -1
  54. package/variables/_type.scss +9 -1
  55. package/variables/components/_badge.scss +14 -38
  56. package/variables/components/_card.scss +1 -1
  57. package/variables/components/_chip.scss +50 -0
  58. package/variables/components/_datatable.scss +1 -1
  59. package/variables/components/_dropdowns.scss +1 -1
  60. package/variables/components/_form-check.scss +75 -1
  61. package/variables/components/_form-select.scss +20 -5
  62. package/variables/components/_form-validation.scss +14 -6
  63. package/variables/components/_index.scss +2 -0
  64. package/variables/components/_list-group.scss +1 -1
  65. package/variables/components/_notification.scss +5 -4
  66. package/variables/components/_pagination.scss +2 -2
  67. package/variables/components/_stepper.scss +25 -14
  68. package/variables/components/_subnavigation.scss +1 -1
  69. package/variables/components/_tag.scss +27 -0
  70. package/components/choice-control-card.scss +0 -148
  71. package/mixins/_badge.scss +0 -31
@@ -6,20 +6,64 @@
6
6
  @use './../mixins/forms' as forms-mixins;
7
7
  @use './../mixins/utilities';
8
8
 
9
+ @use './../variables/commons';
9
10
  @use './../variables/components/forms';
10
11
  @use './../variables/components/form-select' as form-select;
11
12
 
13
+ .form-select-wrapper {
14
+ @include utilities.focus-style() {
15
+ border-radius: commons.$border-radius;
16
+ }
17
+ }
18
+
19
+ :not(.form-select-wrapper) > {
20
+ .form-select {
21
+ @include utilities.focus-style() {
22
+ border-radius: commons.$border-radius;
23
+ }
24
+ }
25
+ }
26
+
12
27
  .form-select {
28
+ --form-select-indicator: #{form-select.$form-select-indicator};
29
+ --form-select-indicator-success: #{b.escape-svg(form-select.$form-select-indicator-success)};
30
+ --form-select-indicator-error: #{b.escape-svg(form-select.$form-select-indicator-error)};
31
+
32
+ &:focus {
33
+ box-shadow: none; // Override bootstrap
34
+
35
+ @include utilities.high-contrast-mode {
36
+ border-color: FieldText !important;
37
+ }
38
+ }
39
+
13
40
  &:not(:disabled) {
41
+ &:hover,
42
+ &:focus {
43
+ @include utilities.high-contrast-mode {
44
+ border-color: FieldText;
45
+ }
46
+ }
47
+
14
48
  &:hover {
15
- border-color: var(--post-contrast-color);
49
+ @include utilities.high-contrast-mode {
50
+ border-color: Highlight;
51
+ }
52
+ }
53
+ }
54
+
55
+ &:disabled {
56
+ @include utilities.high-contrast-mode {
57
+ border-color: GrayText !important;
58
+ background-color: Field !important;
59
+ color: GrayText;
16
60
  }
17
61
  }
18
62
 
19
63
  &:not([multiple]) {
20
64
  &:disabled {
21
65
  background-image: b.escape-svg(form-select.$form-select-indicator-disabled),
22
- var(--bs-form-select-bg-img), var(--bs-form-select-bg-icon, none);
66
+ var(--form-select-indicator), var(--bs-form-select-bg-icon, none);
23
67
  }
24
68
 
25
69
  &.is-valid,
@@ -36,13 +80,13 @@
36
80
  }
37
81
 
38
82
  &.is-valid {
39
- background-image: b.escape-svg(form-select.$form-select-indicator-success),
40
- var(--bs-form-select-bg-img), var(--bs-form-select-bg-icon, none);
83
+ background-image: var(--form-select-indicator-success), var(--form-select-indicator),
84
+ var(--bs-form-select-bg-icon, none);
41
85
  }
42
86
 
43
87
  &.is-invalid {
44
- background-image: b.escape-svg(form-select.$form-select-indicator-error),
45
- var(--bs-form-select-bg-img), var(--bs-form-select-bg-icon, none);
88
+ background-image: var(--form-select-indicator-error), var(--form-select-indicator),
89
+ var(--bs-form-select-bg-icon, none);
46
90
  }
47
91
  }
48
92
 
@@ -53,20 +97,30 @@
53
97
  }
54
98
 
55
99
  &.is-valid {
56
- background-image: b.escape-svg(form-select.$form-select-indicator-success),
57
- var(--bs-form-select-bg-icon, none);
100
+ background-image: var(--form-select-indicator-success), var(--bs-form-select-bg-icon, none);
58
101
  }
59
102
 
60
103
  &.is-invalid {
61
- background-image: b.escape-svg(form-select.$form-select-indicator-error),
62
- var(--bs-form-select-bg-icon, none);
104
+ background-image: var(--form-select-indicator-error), var(--bs-form-select-bg-icon, none);
63
105
  }
64
106
  }
65
107
 
66
108
  @include utilities.high-contrast-mode() {
109
+ --form-select-indicator: #{b.escape-svg(form-select.$form-select-indicator-hcm-dark)};
110
+ --form-select-indicator-success: #{b.escape-svg(
111
+ form-select.$form-select-indicator-success-hcm-dark
112
+ )};
113
+ --form-select-indicator-error: #{b.escape-svg(form-select.$form-select-indicator-error-hcm-dark)};
67
114
  background-image: b.escape-svg(form-select.$form-select-indicator-hcm-dark);
68
115
 
69
116
  @media (prefers-color-scheme: light) {
117
+ --form-select-indicator: #{b.escape-svg(form-select.$form-select-indicator-hcm-light)};
118
+ --form-select-indicator-success: #{b.escape-svg(
119
+ form-select.$form-select-indicator-success-hcm-light
120
+ )};
121
+ --form-select-indicator-error: #{b.escape-svg(
122
+ form-select.$form-select-indicator-error-hcm-light
123
+ )};
70
124
  background-image: b.escape-svg(form-select.$form-select-indicator-hcm-light);
71
125
  }
72
126
 
@@ -77,11 +131,6 @@
77
131
  &:focus-visible {
78
132
  color: FieldText;
79
133
  }
80
-
81
- &:focus,
82
- &:hover:not(:disabled) {
83
- border-color: Highlight;
84
- }
85
134
  }
86
135
  }
87
136
 
@@ -23,9 +23,7 @@
23
23
  font-size: form-validation.$form-feedback-font-size;
24
24
 
25
25
  @include utilities-mx.high-contrast-mode() {
26
- color: HighlightText !important;
27
- background-color: Highlight !important;
28
- forced-color-adjust: none;
26
+ padding-inline: 0;
29
27
  }
30
28
  }
31
29
 
@@ -57,7 +55,6 @@
57
55
  .form-control {
58
56
  @include b.form-validation-state-selector($state) {
59
57
  padding-right: b.$input-height-inner;
60
- background-image: b.escape-svg($icon);
61
58
  background-repeat: no-repeat;
62
59
  background-position: right b.$input-height-inner-quarter center;
63
60
  background-size: form-validation.$form-feedback-icon-size;
@@ -103,21 +100,17 @@
103
100
  .form-select {
104
101
  &.is-invalid {
105
102
  border-color: form-validation.$form-feedback-invalid-color;
106
- background-image: b.escape-svg(form-validation.$form-feedback-icon-invalid);
107
103
 
108
104
  &:focus {
109
105
  border-color: form-validation.$form-feedback-invalid-color;
110
- box-shadow: form-validation.$form-feedback-invalid-box-shadow;
111
106
  }
112
107
  }
113
108
 
114
109
  &.is-valid {
115
- border-color: var(--post-success-green);
116
- background-image: b.escape-svg(form-validation.$form-feedback-icon-valid);
110
+ border-color: var(--post-success);
117
111
 
118
112
  &:focus {
119
113
  border-color: form-validation.$form-feedback-valid-color;
120
- box-shadow: form-validation.$form-feedback-valid-box-shadow;
121
114
  }
122
115
  }
123
116
 
@@ -142,14 +135,36 @@
142
135
  }
143
136
  }
144
137
 
138
+ .form-control:not([type='file']) {
139
+ &.is-invalid {
140
+ background-image: b.escape-svg(form-validation.$form-feedback-icon-invalid);
141
+
142
+ @include utilities-mx.high-contrast-mode() {
143
+ background-image: b.escape-svg(form-validation.$form-feedback-icon-invalid-hcm-dark);
144
+
145
+ @media (prefers-color-scheme: light) {
146
+ background-image: b.escape-svg(form-validation.$form-feedback-icon-invalid-hcm-light);
147
+ }
148
+ }
149
+ }
150
+
151
+ &.is-valid {
152
+ background-image: b.escape-svg(form-validation.$form-feedback-icon-valid);
153
+
154
+ @include utilities-mx.high-contrast-mode() {
155
+ background-image: b.escape-svg(form-validation.$form-feedback-icon-valid-hcm-dark);
156
+
157
+ @media (prefers-color-scheme: light) {
158
+ background-image: b.escape-svg(form-validation.$form-feedback-icon-valid-hcm-light);
159
+ }
160
+ }
161
+ }
162
+ }
163
+
145
164
  .form-check-input {
146
165
  @include form-validation-mx.form-validation-state-selector(invalid) {
147
166
  border-color: form-validation.$form-feedback-invalid-color;
148
167
 
149
- &:focus {
150
- box-shadow: form-validation.$form-feedback-invalid-box-shadow;
151
- }
152
-
153
168
  ~ .form-check-label {
154
169
  color: form-validation.$form-feedback-invalid-color;
155
170
  }
@@ -161,5 +176,9 @@
161
176
  color: color.$white;
162
177
  }
163
178
  }
179
+
180
+ @include utilities-mx.high-contrast-mode {
181
+ border-color: FieldText; // For blink-browser as otherwise the invalid color will be converted to Highlight
182
+ }
164
183
  }
165
184
  }
@@ -2,6 +2,7 @@
2
2
 
3
3
  @use './../lic/bootstrap-license';
4
4
 
5
+ @use './../variables/commons';
5
6
  @use './../variables/components/forms';
6
7
 
7
8
  @use './../mixins/utilities';
@@ -28,11 +29,54 @@ select.form-control-rg:not([size]):not([multiple]) {
28
29
  height: forms.$input-height-rg;
29
30
  }
30
31
 
32
+ .form-control-wrapper {
33
+ @include utilities.focus-style() {
34
+ border-radius: commons.$border-radius;
35
+ }
36
+ }
37
+
38
+ :not(.form-control-wrapper) > {
39
+ .form-control {
40
+ @include utilities.focus-style() {
41
+ border-radius: commons.$border-radius;
42
+ }
43
+ }
44
+ }
45
+
31
46
  .form-control {
32
47
  position: relative;
33
48
 
49
+ &:focus {
50
+ box-shadow: none; // Override bootstrap
51
+
52
+ @include utilities.high-contrast-mode {
53
+ border-color: FieldText !important; // On blink browser valid and invalid border colors are converted to Highlight color
54
+ }
55
+ }
56
+
57
+ &:not(:disabled) {
58
+ &:hover,
59
+ &:focus {
60
+ @include utilities.high-contrast-mode {
61
+ border-color: FieldText;
62
+ }
63
+ }
64
+
65
+ &:hover {
66
+ @include utilities.high-contrast-mode {
67
+ border-color: Highlight;
68
+ }
69
+ }
70
+ }
71
+
34
72
  &:disabled {
35
73
  color: forms.$input-disabled-color;
74
+
75
+ @include utilities.high-contrast-mode {
76
+ border-color: GrayText !important;
77
+ background-color: Field !important;
78
+ color: GrayText;
79
+ }
36
80
  }
37
81
 
38
82
  &[readonly]:not(:disabled) {
@@ -43,6 +87,13 @@ select.form-control-rg:not([size]):not([multiple]) {
43
87
  &[type='file'] {
44
88
  position: relative;
45
89
 
90
+ &:disabled {
91
+ @include utilities.high-contrast-mode {
92
+ color: GrayText; // Needed for the button on blink browser, even if we define it on .form-control:disabled
93
+ border-color: GrayText;
94
+ }
95
+ }
96
+
46
97
  &::file-selector-button {
47
98
  display: block;
48
99
  position: absolute;
@@ -133,17 +184,4 @@ select.form-control-rg:not([size]):not([multiple]) {
133
184
  }
134
185
  }
135
186
  }
136
-
137
- @include utilities.high-contrast-mode() {
138
- &:hover,
139
- &:focus {
140
- &:not(:disabled) {
141
- border-color: Highlight;
142
-
143
- &::file-selector-button {
144
- border-left-color: Highlight;
145
- }
146
- }
147
- }
148
- }
149
187
  }
@@ -1,6 +1,7 @@
1
+ @use './../../mixins/utilities';
1
2
  @use './../../variables/color';
2
- @use './../../variables/spacing';
3
3
  @use './../../variables/commons';
4
+ @use './../../variables/spacing';
4
5
  @use './../../variables/components/intranet-header';
5
6
 
6
7
  @use './../../themes/bootstrap/core' as *;
@@ -17,6 +18,21 @@
17
18
  flex: 1 0 auto;
18
19
  flex-direction: column;
19
20
 
21
+ > div > ul > li:first-child {
22
+ button {
23
+ display: flex;
24
+ width: 100%;
25
+ height: 100%;
26
+ align-items: center;
27
+ background: none;
28
+ border: 0;
29
+
30
+ @include utilities.focus-style() {
31
+ border-radius: commons.$border-radius;
32
+ }
33
+ }
34
+ }
35
+
20
36
  @include media-breakpoint-down(md) {
21
37
  flex: 0 0 auto;
22
38
  }
@@ -33,15 +49,18 @@
33
49
 
34
50
  margin: spacing.$spacer * -1;
35
51
  margin-bottom: 0;
36
- padding: spacing.$spacer;
37
- padding-top: spacing.$spacer;
52
+ padding: spacing.$size-mini;
53
+ padding-left: spacing.$size-regular;
38
54
  border-bottom: commons.$border-width solid rgba(var(--post-contrast-color-rgb), 0.2);
39
55
  background-color: color.$white;
40
56
 
57
+ button {
58
+ padding: spacing.$size-mini;
59
+ }
60
+
41
61
  &:hover,
42
62
  &:focus {
43
- background-color: get-solid-color(rgba(var(--post-contrast-color-rgb), 0.1), color.$white);
44
- cursor: pointer;
63
+ background-color: color.$light;
45
64
  }
46
65
 
47
66
  i.pi {
@@ -7,7 +7,7 @@
7
7
  @use './../mixins/utilities';
8
8
 
9
9
  // Post margins, paddings and sizes
10
- @each $breakpoint in map-keys(breakpoints.$grid-breakpoints) {
10
+ @each $breakpoint in map.keys(breakpoints.$grid-breakpoints) {
11
11
  @include media-breakpoint-up($breakpoint) {
12
12
  $infix: if($breakpoint == 'xs', '', '-#{$breakpoint}');
13
13
 
@@ -56,7 +56,7 @@
56
56
  }
57
57
 
58
58
  // Post breakpoints width - e.g. w-sm-100
59
- @each $breakpoint in map-keys(breakpoints.$grid-breakpoints) {
59
+ @each $breakpoint in map.keys(breakpoints.$grid-breakpoints) {
60
60
  @include media-breakpoint-up($breakpoint) {
61
61
  @if $breakpoint != 'xs' {
62
62
  @each $prop, $abbrev in (width: w) {
@@ -142,35 +142,29 @@ $progress-step-3-inner:
142
142
 
143
143
  @keyframes progressLoader {
144
144
  0% {
145
- -webkit-clip-path: polygon($progress-step-1-inner);
146
- clip-path: polygon($progress-step-1-inner);
145
+ clip-path: polygon($progress-step-1-inner);
147
146
  }
148
147
 
149
148
  50% {
150
- -webkit-clip-path: polygon($progress-step-2-inner);
151
- clip-path: polygon($progress-step-2-inner);
149
+ clip-path: polygon($progress-step-2-inner);
152
150
  }
153
151
 
154
152
  100% {
155
- -webkit-clip-path: polygon($progress-step-3-inner);
156
- clip-path: polygon($progress-step-3-inner);
153
+ clip-path: polygon($progress-step-3-inner);
157
154
  }
158
155
  }
159
156
 
160
157
  /* This animation works as kind of inverted mask based on the progressLoader animation */
161
158
  @keyframes progressLoaderInverted {
162
159
  0% {
163
- -webkit-clip-path: polygon(0 0, 0 100%, 100% 100%, $progress-step-1-inner, 50% 50%, 100% 100%, 100% 0);
164
- clip-path: polygon(0 0, 0 100%, 100% 100%, $progress-step-1-inner, 50% 50%, 100% 100%, 100% 0);
160
+ clip-path: polygon(0 0, 0 100%, 100% 100%, $progress-step-1-inner, 50% 50%, 100% 100%, 100% 0);
165
161
  }
166
162
 
167
163
  50% {
168
- -webkit-clip-path: polygon(0 0, 0 100%, 100% 100%, $progress-step-2-inner, 50% 50%, 100% 100%, 100% 0);
169
- clip-path: polygon(0 0, 0 100%, 100% 100%, $progress-step-2-inner, 50% 50%, 100% 100%, 100% 0);
164
+ clip-path: polygon(0 0, 0 100%, 100% 100%, $progress-step-2-inner, 50% 50%, 100% 100%, 100% 0);
170
165
  }
171
166
 
172
167
  100% {
173
- -webkit-clip-path: polygon(0 0, 0 100%, 100% 100%, $progress-step-3-inner, 50% 50%, 100% 100%, 100% 0);
174
- clip-path: polygon(0 0, 0 100%, 100% 100%, $progress-step-3-inner, 50% 50%, 100% 100%, 100% 0);
168
+ clip-path: polygon(0 0, 0 100%, 100% 100%, $progress-step-3-inner, 50% 50%, 100% 100%, 100% 0);
175
169
  }
176
170
  }