@swisspost/design-system-styles 6.6.1 → 6.6.3

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.
@@ -64,6 +64,12 @@
64
64
  }
65
65
  }
66
66
 
67
+ &:disabled {
68
+ ~ label {
69
+ color: forms.$input-disabled-color;
70
+ }
71
+ }
72
+
67
73
  &[type='file'] {
68
74
  &:focus,
69
75
  &:not(:placeholder-shown) {
@@ -6,6 +6,7 @@
6
6
  @use '../variables/animation';
7
7
  @use '../variables/components/form-check';
8
8
  @use '../mixins/icons' as icons-mx;
9
+ @use '../mixins/utilities' as utility-mx;
9
10
 
10
11
  .form-check {
11
12
  display: flex;
@@ -153,6 +154,24 @@
153
154
  }
154
155
  }
155
156
 
157
+ @include utility-mx.high-contrast-mode {
158
+ transition: none;
159
+ border: form-check.$form-check-input-border-width solid CanvasText;
160
+
161
+ &:checked {
162
+ background-color: SelectedItem;
163
+ }
164
+
165
+ &::after,
166
+ &:checked::after {
167
+ max-width: calc(
168
+ #{form-check.$form-switch-height} - #{2 * form-check.$form-check-input-border-width}
169
+ );
170
+ border-color: Canvas;
171
+ background-color: CanvasText;
172
+ }
173
+ }
174
+
156
175
  &[disabled] {
157
176
  background: form-check.$form-switch-disabled-bg;
158
177
 
@@ -164,6 +183,16 @@
164
183
 
165
184
  &:hover > .form-check-input:not([disabled]) {
166
185
  background-color: rgba(var(--post-contrast-color-rgb), 0.1);
186
+
187
+ @include utility-mx.high-contrast-mode {
188
+ border-color: Highlight;
189
+
190
+ &:checked,
191
+ &::after,
192
+ &:checked::after {
193
+ background-color: Highlight;
194
+ }
195
+ }
167
196
  }
168
197
 
169
198
  .form-check-label {
@@ -64,7 +64,12 @@
64
64
  }
65
65
 
66
66
  @include utilities.high-contrast-mode() {
67
- background-image: b.escape-svg(form-select.$form-select-indicator-hcm);
67
+ background-image: b.escape-svg(form-select.$form-select-indicator-hcm-dark);
68
+
69
+ @media (prefers-color-scheme: light) {
70
+ background-image: b.escape-svg(form-select.$form-select-indicator-hcm-light);
71
+ }
72
+
68
73
  background-color: Field;
69
74
  border-color: FieldText;
70
75
  color: FieldText;
@@ -1,4 +1,6 @@
1
+ @use 'sass:math';
1
2
  @forward './../variables/options';
3
+ @use './../variables/type';
2
4
 
3
5
  @use './../lic/bootstrap-license';
4
6
  @use './../themes/bootstrap/core' as *;
@@ -8,16 +10,6 @@
8
10
  @use './../variables/commons';
9
11
  @use './../variables/components/spinners';
10
12
 
11
- @keyframes spin {
12
- 0% {
13
- transform: rotate(0deg);
14
- }
15
-
16
- 100% {
17
- transform: rotate(360deg);
18
- }
19
- }
20
-
21
13
  .spinner-bg {
22
14
  position: absolute;
23
15
  z-index: commons.$zindex-spinner;
@@ -38,34 +30,147 @@
38
30
  }
39
31
 
40
32
  .loader {
41
- width: spinners.$spinner-size;
42
- height: spinners.$spinner-size;
43
- animation: spin 2s linear infinite;
44
- border: spinners.$spinner-border-width solid spinners.$spinner-color-primary;
45
- border-radius: 50%;
46
- border-right-color: transparent;
47
- border-bottom-color: spinners.$spinner-color-secondary;
33
+ width: 1em;
34
+ height: 1em;
35
+ animation: spin spinners.$spinner-duration linear infinite;
36
+ position: relative;
37
+ font-size: spinners.$spinner-size;
48
38
 
39
+ // Sizes
40
+ @each $key, $font-size in spinners.$spinner-size-map {
41
+ &.loader-#{$key} {
42
+ font-size: $font-size;
43
+ }
44
+ }
45
+
46
+ // Deprecated sizes
49
47
  &.loader-sm {
50
- width: spinners.$spinner-size-sm;
51
- height: spinners.$spinner-size-sm;
52
- border-width: spinners.$spinner-border-width-sm;
48
+ font-size: spinners.$spinner-size-sm;
53
49
  }
54
50
 
55
51
  &.loader-xs {
56
- width: spinners.$spinner-size-xs;
57
- height: spinners.$spinner-size-xs;
58
- border-width: spinners.$spinner-border-width-xs;
52
+ font-size: spinners.$spinner-size-xs;
53
+ }
54
+
55
+ &::before,
56
+ &::after {
57
+ content: '';
58
+ box-sizing: border-box;
59
+ position: absolute;
60
+ inset: 0;
61
+ border-radius: 50%;
62
+ border: max(2px, 0.12em) solid spinners.$spinner-color-secondary; // Size is proportional, but 1px is too thin on browser compared to design
63
+ transform: rotate(130deg);
64
+ animation-timing-function: linear;
65
+ animation-direction: alternate;
66
+ animation-duration: math.div(spinners.$spinner-duration, 2);
67
+ animation-iteration-count: infinite;
68
+ }
69
+
70
+ // Background bar
71
+ &::before {
72
+ animation-name: progressLoaderInverted; // Mask part of the bar where the progress bar is active against antialiasing issue
73
+ }
74
+
75
+ // Progress bar
76
+ &::after {
77
+ border-color: spinners.$spinner-color-primary;
78
+ animation-name: progressLoader;
79
+ }
80
+
81
+ @media (prefers-reduced-motion: reduce) {
82
+ animation-duration: math.div(
83
+ spinners.$spinner-duration,
84
+ spinners.$spinner-speed-reduced-motion
85
+ );
86
+
87
+ &::before,
88
+ &::after {
89
+ animation-duration: math.div(
90
+ spinners.$spinner-duration,
91
+ 2 * spinners.$spinner-speed-reduced-motion
92
+ );
93
+ }
59
94
  }
60
95
 
61
96
  @include utilities.high-contrast-mode() {
62
- border-color: Highlight;
63
- border-bottom-color: CanvasText;
64
- border-right-color: Canvas;
97
+ &::before {
98
+ border-color: CanvasText;
99
+ }
65
100
 
66
- @supports (forced-color-adjust: none) {
67
- forced-color-adjust: none;
68
- border-right-color: transparent;
101
+ &::after {
102
+ border-color: Highlight;
69
103
  }
70
104
  }
71
105
  }
106
+
107
+ @keyframes spin {
108
+ 0% {
109
+ transform: rotate(0deg);
110
+ }
111
+
112
+ 50% {
113
+ transform: rotate(180deg);
114
+ }
115
+
116
+ 100% {
117
+ transform: rotate(720deg);
118
+ }
119
+ }
120
+
121
+ $progress-step-1-inner:
122
+ 50% 50%,
123
+ 0 0,
124
+ 42% 0,
125
+ 42% 0,
126
+ 42% 0,
127
+ 42% 0;
128
+ $progress-step-2-inner:
129
+ 50% 50%,
130
+ 0 0,
131
+ 100% 0,
132
+ 100% 0,
133
+ 100% 0,
134
+ 100% 0;
135
+ $progress-step-3-inner:
136
+ 50% 50%,
137
+ 0 0,
138
+ 100% 0,
139
+ 100% 100%,
140
+ 100% 100%,
141
+ 100% 100%;
142
+
143
+ @keyframes progressLoader {
144
+ 0% {
145
+ -webkit-clip-path: polygon($progress-step-1-inner);
146
+ clip-path: polygon($progress-step-1-inner);
147
+ }
148
+
149
+ 50% {
150
+ -webkit-clip-path: polygon($progress-step-2-inner);
151
+ clip-path: polygon($progress-step-2-inner);
152
+ }
153
+
154
+ 100% {
155
+ -webkit-clip-path: polygon($progress-step-3-inner);
156
+ clip-path: polygon($progress-step-3-inner);
157
+ }
158
+ }
159
+
160
+ /* This animation works as kind of inverted mask based on the progressLoader animation */
161
+ @keyframes progressLoaderInverted {
162
+ 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);
165
+ }
166
+
167
+ 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);
170
+ }
171
+
172
+ 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);
175
+ }
176
+ }
@@ -91,6 +91,8 @@ fieldset {
91
91
  }
92
92
 
93
93
  &-footer {
94
+ color: var(--post-contrast-color);
95
+
94
96
  cite {
95
97
  @extend %font-curve-small;
96
98
  font-weight: type.$blockquote-cite-font-weight;
@@ -53,7 +53,7 @@
53
53
  the color is statically defined because the reference to the variable from here
54
54
  would create a loop
55
55
  */
56
- @if ($background == #2c911c) {
56
+ @if ($background == #2c871d) {
57
57
  @return 'dark';
58
58
  }
59
59