@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
@@ -1,226 +1,371 @@
1
- @use './../mixins/size' as size-mx;
1
+ @use 'sass:math';
2
+
2
3
  @use './../mixins/icons' as icons-mx;
4
+ @use './../mixins/size' as size-mx;
3
5
  @use './../mixins/utilities';
4
6
 
5
- @use './../variables/spacing';
6
7
  @use './../variables/color';
8
+ @use './../variables/commons';
7
9
  @use './../variables/components/stepper';
8
10
 
9
11
  @use './../themes/bootstrap/core' as *;
10
12
 
13
+ // for backward compatibility
11
14
  .stepper-container {
12
15
  @include size-mx.responsive-size('big', 'margin-bottom');
13
- position: relative;
14
- }
15
-
16
- .stepper-bar {
17
- height: stepper.$stepper-bar-height;
18
- margin-top: stepper.$stepper-indicator-height * 0.5;
19
- margin-bottom: -1 * (stepper.$stepper-bar-height + stepper.$stepper-indicator-height) * 0.5;
20
16
 
21
- .progress-bar {
22
- background-color: color.$yellow;
17
+ > .stepper-bar {
18
+ display: none;
23
19
  }
24
20
  }
25
21
 
26
22
  .stepper {
23
+ // start a counter for the step numbers
27
24
  counter-reset: step-index;
28
25
 
29
- list-style: none;
30
- padding: 0 (0.5 * stepper.$stepper-indicator-height);
31
- margin: 0;
26
+ @include utilities.reset-list;
32
27
  display: grid;
33
- grid-template-columns: repeat(auto-fit, minmax(#{0.5 * stepper.$stepper-indicator-height}, 1fr));
34
- justify-items: center;
28
+ position: relative;
29
+ overflow: hidden;
30
+
31
+ // the first column is half a step wide to make sure the separators are the same size even on small screens
32
+ grid-template-columns: math.div(stepper.$stepper-indicator-size, 2);
33
+
34
+ // all other columns are 1 fraction of the available space ase we don't know the number of steps
35
+ grid-auto-columns: minmax(0, 1fr);
36
+
37
+ // we use a padding and negative margin on the last step for the same reason we need the first column
38
+ padding-inline-end: math.div(stepper.$stepper-indicator-size, 2);
35
39
  }
36
40
 
37
41
  .stepper-item {
38
- counter-increment: step-index;
42
+ grid-row: 1;
39
43
  position: relative;
40
- display: flex;
41
- flex-direction: column;
42
- transition: color 250ms;
43
44
 
44
- // Stepper indicator styles
45
- &::before {
46
- content: '';
47
- pointer-events: none;
48
- display: flex;
49
- align-items: center;
50
- justify-content: center;
51
- height: stepper.$stepper-indicator-height;
52
- width: stepper.$stepper-indicator-height;
53
- margin-bottom: -1 * stepper.$stepper-indicator-height;
54
- color: stepper.$stepper-indicator-color;
55
- background-color: stepper.$stepper-indicator-bg;
56
- border: stepper.$stepper-indicator-border-width solid stepper.$stepper-indicator-border-color;
57
- border-radius: 50%;
58
- font-size: stepper.$stepper-indicator-font-size;
59
- font-weight: stepper.$stepper-indicator-font-weight;
60
- transition: background 250ms;
61
- }
62
-
63
- &[aria-current] ~ ::before {
64
- color: stepper.$stepper-indicator-future-color;
65
- background-color: stepper.$stepper-indicator-future-bg;
45
+ &:not(:first-child) {
46
+ padding-inline-start: math.div(stepper.$stepper-link-spacing, 2);
66
47
  }
67
48
 
68
- &:is(:focus-visible, :focus-within)::before {
69
- outline: stepper.$stepper-indicator-hover-outline;
49
+ &:not(:last-child) {
50
+ padding-inline-end: math.div(stepper.$stepper-link-spacing, 2);
51
+ grid-column: span 2;
70
52
  }
71
53
 
72
- // Check icon (for completed steps only)
54
+ // progress bar
55
+ &::before,
73
56
  &::after {
74
- @include icons-mx.icon(2105);
75
57
  content: '';
76
- position: absolute;
77
58
  display: block;
78
- top: 0.5 * (stepper.$stepper-indicator-height - stepper.$stepper-indicator-check-icon-size);
79
- height: stepper.$stepper-indicator-check-icon-size;
80
- width: stepper.$stepper-indicator-check-icon-size;
59
+ position: absolute;
60
+ inset-block-start: math.div((stepper.$stepper-indicator-size - stepper.$stepper-bar-height), 2);
61
+ height: stepper.$stepper-bar-height;
62
+ background-color: stepper.$stepper-bar-color;
63
+ inset-inline: 0 0;
81
64
  }
82
65
 
83
- &[aria-current],
84
- &[aria-current] ~ & {
85
- pointer-events: none;
86
-
66
+ &:not(:first-child, :last-child) {
87
67
  &::before {
88
- content: counter(step-index);
68
+ inset-inline-end: 50%;
89
69
  }
90
70
 
91
71
  &::after {
92
- content: unset;
72
+ inset-inline-start: 50%;
93
73
  }
94
74
  }
95
75
 
96
- // First stepper item - left aligned
97
- &:first-child {
98
- justify-self: start;
99
- align-items: start;
100
- transform: translateX(#{-0.5 * stepper.$stepper-indicator-height});
76
+ // current and completed steps are preceded by a yellow segment (except for the first step)
77
+ &:not(&[aria-current='step'] ~ *, :first-child)::before,
78
+ // completed steps are also followed by a yellow segment (except for the last step)
79
+ &:not([aria-current='step']:not(:last-child), &[aria-current='step'] ~ *)::after {
80
+ background-color: stepper.$stepper-bar-fill-color;
81
+ z-index: 1;
82
+ }
83
+ }
101
84
 
102
- &::after {
103
- left: 0.5 * (stepper.$stepper-indicator-height - stepper.$stepper-indicator-check-icon-size);
104
- }
85
+ .stepper-link {
86
+ // -webkit-box is needed for line-clamp: https://caniuse.com/css-line-clamp
87
+ // stylelint-disable-next-line value-no-vendor-prefix
88
+ display: -webkit-box;
89
+ -webkit-box-orient: vertical;
90
+ -webkit-line-clamp: 2;
91
+ position: relative;
92
+ z-index: 2;
93
+ overflow: hidden;
94
+ text-decoration: none;
95
+ color: stepper.$stepper-link-color;
96
+ width: -moz-fit-content;
97
+ width: fit-content;
98
+ line-height: stepper.$stepper-link-line-height;
99
+
100
+ // not adding ellipsis if the like doesn't have a title for accessibility reasons
101
+ &:not([title]) {
102
+ -webkit-line-clamp: initial;
105
103
  }
106
104
 
107
- // Last stepper item - right aligned
108
- &:last-child {
109
- justify-self: end;
110
- align-items: end;
111
- text-align: right;
112
- margin-right: -0.5 * stepper.$stepper-indicator-height;
105
+ .stepper-item:not(:first-child, :last-child) > & {
106
+ margin-inline: auto;
107
+ text-align: center;
108
+ }
113
109
 
114
- &::after {
115
- right: 0.5 * (stepper.$stepper-indicator-height - stepper.$stepper-indicator-check-icon-size);
116
- }
110
+ .stepper-item:last-child > & {
111
+ margin-inline-start: auto;
112
+ margin-inline-end: -1 * math.div(stepper.$stepper-indicator-size, 2); // negative margin matching the container padding
113
+ text-align: end;
117
114
  }
118
115
 
119
- // Other stepper items - centered
120
- &:not(:first-child):not(:last-child) {
121
- grid-column-end: span 2;
122
- align-items: center;
116
+ .stepper-item[aria-current='step'] > & {
117
+ color: stepper.$stepper-link-current-color;
118
+ font-weight: stepper.$stepper-link-current-font-weight;
119
+ }
120
+ }
123
121
 
124
- &::after {
125
- left: calc(50% - #{0.5 * stepper.$stepper-indicator-check-icon-size});
126
- }
122
+ // step indicator
123
+ .stepper-link::before {
124
+ counter-increment: step-index;
125
+ content: counter(step-index);
126
+ display: flex;
127
+ align-items: center;
128
+ justify-content: center;
129
+ z-index: 1;
130
+ height: stepper.$stepper-indicator-size;
131
+ width: stepper.$stepper-indicator-size;
132
+ box-sizing: border-box;
133
+ margin-block-end: stepper.$stepper-link-gap;
134
+ color: stepper.$stepper-indicator-color;
135
+ background-color: stepper.$stepper-indicator-bg;
136
+ border: stepper.$stepper-indicator-border-width solid stepper.$stepper-indicator-border-color;
137
+ border-radius: 50%;
138
+ font-weight: stepper.$stepper-indicator-font-weight;
139
+ text-indent: initial;
140
+ transition: stepper.$stepper-indicator-transition;
141
+
142
+ .stepper-item:not(:first-child, :last-child) > & {
143
+ margin-inline: auto;
127
144
  }
128
145
 
129
- &:hover {
130
- color: stepper.$stepper-indicator-hover-color;
146
+ .stepper-item:last-child > & {
147
+ margin-inline-start: auto;
148
+ }
131
149
 
132
- &::before {
133
- background-color: stepper.$stepper-indicator-hover-bg;
134
- }
150
+ .stepper-item:not([aria-current='step'], .stepper-item[aria-current='step'] ~ *) > & {
151
+ color: transparent;
152
+ }
153
+
154
+ .stepper-item[aria-current='step'] ~ .stepper-item > & {
155
+ color: stepper.$stepper-indicator-future-color;
156
+ background-color: stepper.$stepper-indicator-future-bg;
135
157
  }
136
158
  }
137
159
 
138
- .stepper-link {
160
+ // check icon
161
+ .stepper-link::after {
162
+ @include icons-mx.icon(2105);
163
+ display: block;
164
+ position: absolute;
165
+ top: math.div((stepper.$stepper-indicator-size - stepper.$stepper-indicator-check-icon-size), 2);
139
166
  z-index: 1;
140
- padding-top: stepper.$stepper-indicator-height + stepper.$stepper-link-gap;
141
- text-decoration: none;
142
- color: stepper.$stepper-link-color;
143
- transition: color 250ms;
144
- text-align: center;
167
+ height: stepper.$stepper-indicator-check-icon-size;
168
+ width: stepper.$stepper-indicator-check-icon-size;
169
+ transition: stepper.$stepper-indicator-transition;
170
+ color: stepper.$stepper-indicator-color;
171
+
172
+ .stepper-item:first-child > & {
173
+ left: math.div(
174
+ (stepper.$stepper-indicator-size - stepper.$stepper-indicator-check-icon-size),
175
+ 2
176
+ );
177
+ }
145
178
 
146
- .stepper-item[aria-current] > & {
147
- color: stepper.$stepper-link-current-color;
148
- font-size: stepper.$stepper-link-current-font-size;
149
- font-weight: stepper.$stepper-link-current-font-weight;
179
+ .stepper-item:not(:first-child, :last-child) > & {
180
+ left: calc(50% - #{math.div(stepper.$stepper-indicator-check-icon-size, 2)});
181
+ }
182
+
183
+ .stepper-item:last-child > & {
184
+ right: math.div(
185
+ (stepper.$stepper-indicator-size - stepper.$stepper-indicator-check-icon-size),
186
+ 2
187
+ );
150
188
  }
151
189
 
152
- @at-root a:hover#{&},
153
- :focus-visible#{&} {
154
- color: stepper.$stepper-link-hover-color;
190
+ // show only for completed steps
191
+ .stepper-item:not([aria-current='step'], .stepper-item[aria-current='step'] ~ *) > & {
192
+ content: '';
193
+ }
194
+ }
195
+
196
+ // hover/focus state
197
+ .stepper-link:is(a[href]) {
198
+ @include utilities.focus-style {
199
+ border-radius: commons.$border-radius;
155
200
  }
156
201
 
157
- &:focus-visible {
158
- outline: none;
202
+ @include utilities.focus-hover-style-custom() {
203
+ color: stepper.$stepper-link-color;
204
+
205
+ .stepper-item[aria-current='step'] > & {
206
+ color: stepper.$stepper-link-current-color;
207
+ }
208
+
209
+ // step indicator
210
+ &::before,
211
+ .stepper-item[aria-current='step'] ~ .stepper-item > &::before {
212
+ color: stepper.$stepper-indicator-hover-color;
213
+ background-color: stepper.$stepper-indicator-hover-bg;
214
+ }
215
+
216
+ // check icon
217
+ &::after {
218
+ color: stepper.$stepper-indicator-hover-color;
219
+ }
159
220
  }
160
221
  }
161
222
 
223
+ // smaller screens
162
224
  @include media-breakpoint-down(rg) {
163
- .stepper-item {
164
- &:not([aria-current]) .stepper-link {
165
- overflow: hidden;
166
- white-space: nowrap;
225
+ .stepper-item:first-child,
226
+ .stepper-item:last-child {
227
+ padding-inline: 0;
228
+ }
229
+
230
+ .stepper-item[aria-current='step'] {
231
+ // using "display: contents" on the stepper-item and stepper-link so that label, indicator and progress bar can be directly placed in the grid
232
+ display: contents;
233
+
234
+ > .stepper-link {
235
+ display: contents;
236
+ }
237
+
238
+ // progress bar
239
+ &::before {
240
+ grid-row: -1;
241
+ margin-block-start: math.div(
242
+ (stepper.$stepper-indicator-size - stepper.$stepper-bar-height),
243
+ 2
244
+ );
245
+ position: static;
246
+ }
247
+
248
+ &:not(:last-child) > .stepper-link::before {
249
+ grid-row: -1;
250
+ }
251
+
252
+ &:not(:first-child, :last-child)::after {
253
+ inset-inline-start: 0;
254
+ }
255
+ }
256
+
257
+ .stepper-item:not([aria-current='step']) {
258
+ grid-row: -1;
259
+ justify-self: stretch;
260
+
261
+ // hide completed and future step labels
262
+ > .stepper-link {
263
+ -webkit-line-clamp: initial;
264
+ line-height: 0;
167
265
  text-indent: 100%;
168
- width: stepper.$stepper-indicator-height;
169
266
  }
170
267
  }
171
- }
172
268
 
173
- @include utilities.high-contrast-mode() {
174
- .stepper-bar {
175
- background-color: CanvasText;
176
- border: 0 none;
269
+ .stepper-link {
270
+ white-space: nowrap;
271
+ width: 100%;
272
+ }
177
273
 
178
- .progress-bar {
179
- background-color: Highlight;
274
+ // step indicator
275
+ .stepper-link::before {
276
+ .stepper-item[aria-current='step']:first-child > & {
277
+ order: -1;
278
+ }
279
+
280
+ .stepper-item[aria-current='step']:not(:first-child, :last-child) > & {
281
+ margin-inline-start: 0;
282
+ transform: translateX(-50%);
283
+ }
284
+
285
+ .stepper-item[aria-current='step']:last-child > & {
286
+ position: absolute;
287
+ z-index: 2;
288
+ inset-block-start: 0;
289
+ inset-inline-end: 0;
180
290
  }
181
291
  }
292
+ }
182
293
 
294
+ @include utilities.high-contrast-mode {
183
295
  .stepper-item {
184
- &::before {
185
- width: calc(#{stepper.$stepper-indicator-height} + 2 * #{spacing.$size-line});
186
- height: calc(#{stepper.$stepper-indicator-height} + 2 * #{spacing.$size-line});
187
- line-height: calc(#{stepper.$stepper-indicator-height} + 2 * #{spacing.$size-line});
188
- color: ButtonText;
189
- background-color: ButtonFace;
190
- border: 0;
191
- outline: spacing.$size-line solid VisitedText;
192
- outline-offset: -3 * spacing.$size-line;
193
- margin-top: -1 * spacing.$size-line;
296
+ &::before,
297
+ &::after {
298
+ background-color: CanvasText;
194
299
  }
195
300
 
196
- &[aria-current] ~ &::before {
197
- outline-color: ButtonBorder;
301
+ &:not(&[aria-current='step'] ~ &, :first-child)::before,
302
+ &:not([aria-current='step']:not(:last-child), &[aria-current='step'] ~ *)::after {
303
+ background-color: Highlight;
198
304
  }
305
+ }
199
306
 
200
- &[aria-current]::before {
201
- outline-color: Highlight;
307
+ .stepper-link {
308
+ &::before {
309
+ forced-color-adjust: none;
202
310
  }
203
311
 
204
- &:is(:focus-visible, :focus-within)::before {
205
- border: spacing.$size-line solid Highlight;
206
- line-height: stepper.$stepper-indicator-height;
207
- outline-color: VisitedText;
312
+ .stepper-item[aria-current='step'] > & {
313
+ &::before {
314
+ background-color: Canvas;
315
+ color: CanvasText;
316
+ }
208
317
  }
209
318
 
210
- &[aria-current] ~ &:is(:focus-visible, :focus-within)::before {
211
- outline-color: ButtonBorder;
319
+ .stepper-item[aria-current='step'] ~ .stepper-item > &,
320
+ .stepper-item:not([aria-current='step']) > & {
321
+ &::before {
322
+ color: Canvas;
323
+ border-color: Canvas;
324
+ background-color: CanvasText;
325
+ }
326
+ }
327
+
328
+ &::after {
329
+ color: Canvas;
212
330
  }
213
331
  }
214
332
 
215
- .stepper-link {
216
- color: VisitedText;
333
+ .stepper-link:is(a[href]) {
334
+ .stepper-item[aria-current='step'] > & {
335
+ @include utilities.focus-hover-style-custom() {
336
+ &::before {
337
+ border-color: Highlight;
338
+ }
339
+ }
340
+ }
217
341
 
218
- .stepper-item[aria-current] ~ .stepper-item > & {
219
- color: CanvasText;
342
+ .stepper-item[aria-current='step'] ~ .stepper-item > & {
343
+ &::before {
344
+ color: Canvas;
345
+ }
346
+
347
+ @include utilities.focus-hover-style-custom() {
348
+ &::before {
349
+ background-color: Highlight;
350
+ color: HighlightText;
351
+ }
352
+ }
220
353
  }
221
354
 
222
- .stepper-item[aria-current] > & {
223
- color: Highlight;
355
+ .stepper-item:not([aria-current='step']) > & {
356
+ &::before {
357
+ background-color: LinkText;
358
+ }
359
+
360
+ @include utilities.focus-hover-style-custom() {
361
+ &::before {
362
+ background-color: Highlight;
363
+ }
364
+
365
+ &::after {
366
+ color: HighlightText;
367
+ }
368
+ }
224
369
  }
225
370
  }
226
371
  }
@@ -46,11 +46,6 @@ $module-name: 'subnavigation';
46
46
  @include media-breakpoint-up(xl) {
47
47
  min-height: subnavigation.$subnavigation-height-xl;
48
48
  }
49
-
50
- .badge {
51
- margin-left: subnavigation.$subnavigation-result-margin-left;
52
- color: inherit;
53
- }
54
49
  }
55
50
 
56
51
  &-link {
@@ -59,12 +54,14 @@ $module-name: 'subnavigation';
59
54
  @include transition(
60
55
  color animation.$transition-time-default animation.$transition-easing-default
61
56
  );
57
+
62
58
  display: flex;
63
59
  position: relative;
64
60
  align-items: center;
65
61
  justify-content: space-between;
66
62
  width: 100%;
67
63
  height: 100%;
64
+ gap: subnavigation.$subnavigation-result-margin-left;
68
65
  padding: subnavigation.$subnavigation-link-padding-xs;
69
66
  color: subnavigation.$subnavigation-link-color;
70
67
  text-decoration: none;
@@ -53,6 +53,6 @@
53
53
  }
54
54
 
55
55
  > tbody > tr {
56
- background-color: color.$gray-background;
56
+ background-color: color.$gray;
57
57
  }
58
58
  }
@@ -12,7 +12,7 @@
12
12
  background-color: rgba(
13
13
  var(--post-contrast-color-rgb),
14
14
  0.02
15
- ); // 0.02 gets as close as possible to color.$gray-background-light on white background
15
+ ); // 0.02 gets as close as possible to color.$light on white background
16
16
 
17
17
  // Create a line that lies below the active but above the passive elements
18
18
  // This way hover works smoothly with the background color
@@ -0,0 +1,82 @@
1
+ @use 'sass:map';
2
+ @forward './../variables/options';
3
+ @use './../variables/color';
4
+ @use './../variables/components/tag';
5
+ @use './../functions/contrast' as contrast-fn;
6
+
7
+ // style `.tag` only if is not descendant of a `<pre>` element
8
+ // as `<pre><div class="tag">...</div><pre>` is usually used by code highlight tools
9
+
10
+ // `.tag` selector can be removed (leave only `.tag:where(:has(:not(pre)))`)as soon as Firefox ESR v128 is released and rolled out
11
+ // https://whattrainisitnow.com/calendar/
12
+ .tag,
13
+ .tag:where(:has(:not(pre))) {
14
+ --post-tag-bg: #{tag.$tag-default-background};
15
+ --post-tag-fg: #{contrast-fn.get-best-contrast-text(tag.$tag-default-background)};
16
+
17
+ display: inline-flex;
18
+ align-items: center;
19
+ gap: tag.$tag-gap;
20
+ padding: tag.$tag-padding-y tag.$tag-padding-x;
21
+ max-width: tag.$tag-max-width;
22
+ background-color: var(--post-tag-bg);
23
+ border: tag.$tag-border-width solid transparent;
24
+ border-radius: tag.$tag-border-radius;
25
+ font-size: tag.$tag-font-size;
26
+ line-height: tag.$tag-line-height;
27
+ white-space: nowrap;
28
+ color: var(--post-tag-fg);
29
+
30
+ post-icon {
31
+ flex: 0 0 auto;
32
+ width: tag.$tag-icon-size;
33
+ height: tag.$tag-icon-size;
34
+ }
35
+
36
+ .tag-text {
37
+ overflow: hidden;
38
+ text-overflow: ellipsis;
39
+ white-space: nowrap;
40
+
41
+ svg,
42
+ img {
43
+ display: inline-block;
44
+ height: tag.$tag-icon-size !important;
45
+ vertical-align: text-top;
46
+ }
47
+ }
48
+
49
+ &.tag-sm {
50
+ line-height: tag.$tag-sm-line-height;
51
+
52
+ .tag-icon {
53
+ width: tag.$tag-sm-icon-size;
54
+ height: tag.$tag-sm-icon-size;
55
+ }
56
+ }
57
+
58
+ @each $key, $color in tag.$tag-backgrounds {
59
+ &.tag-#{$key} {
60
+ --post-tag-bg: #{$color};
61
+ --post-tag-fg: #{contrast-fn.get-best-contrast-text($color)};
62
+ }
63
+ }
64
+
65
+ &.tag-white {
66
+ border-color: var(--post-contrast-color);
67
+ }
68
+
69
+ // Can be removed completely as soon as Firefox ESR v128 is released and rolled out
70
+ // https://whattrainisitnow.com/calendar/
71
+ pre & {
72
+ display: inline;
73
+ padding: initial;
74
+ max-width: initial;
75
+ background: initial;
76
+ border: initial;
77
+ border-radius: initial;
78
+ font-size: inherit;
79
+ line-height: inherit;
80
+ white-space: unset;
81
+ }
82
+ }
@@ -40,8 +40,7 @@
40
40
  padding-right: 0;
41
41
  // webkit subpixel-issue fix
42
42
  margin-right: -1px;
43
- -webkit-clip-path: inset(0 1px (map.get(spacing.$size-curve-huge, 'xxl') * -1) 0);
44
- clip-path: inset(0 1px (map.get(spacing.$size-curve-huge, 'xxl') * -1) 0);
43
+ clip-path: inset(0 1px (map.get(spacing.$size-curve-huge, 'xxl') * -1) 0);
45
44
  }
46
45
 
47
46
  > .row {
@@ -73,7 +73,6 @@ span.spacer {
73
73
  a {
74
74
  color: inherit;
75
75
 
76
- &:focus,
77
76
  &:hover {
78
77
  opacity: 0.8;
79
78
  }
@@ -83,7 +82,6 @@ span.spacer {
83
82
  a {
84
83
  color: var(--post-contrast-color);
85
84
 
86
- &:focus,
87
85
  &:hover {
88
86
  color: rgba(var(--post-contrast-color-rgb), 0.8);
89
87
  }
@@ -33,3 +33,15 @@
33
33
 
34
34
  @return string.unquote('\##{string.to-lower-case($hex)}');
35
35
  }
36
+
37
+ // Source: https://gist.github.com/certainlyakey/e9c0d8f5c87ff47e3d5b
38
+ @function encode-uri-color($string) {
39
+ @if meta.type-of($string) == 'color' and string.index(#{$string}, '#') == 1 {
40
+ $hex: string.slice(color.ie-hex-str($string), 4);
41
+ $string: string.unquote('#{$hex}');
42
+
43
+ @return '%23' + $string;
44
+ }
45
+
46
+ @return $string;
47
+ }