@carbon/styles 1.82.0-rc.0 → 1.82.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.
- package/css/styles.css +315 -43
- package/css/styles.min.css +1 -1
- package/package.json +3 -3
- package/scss/__tests__/theme-test.js +4 -0
- package/scss/_layer.scss +7 -0
- package/scss/_zone.scss +3 -1
- package/scss/components/content-switcher/_content-switcher.scss +424 -54
- package/scss/components/content-switcher/_index.scss +6 -1
- package/scss/components/content-switcher/_tokens.scss +110 -0
- package/scss/layer/_layer-sets.scss +5 -0
- package/scss/theme/_theme.scss +1 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//
|
|
2
|
-
// Copyright IBM Corp. 2016,
|
|
2
|
+
// Copyright IBM Corp. 2016, 2025
|
|
3
3
|
//
|
|
4
4
|
// This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
// LICENSE file in the root directory of this source tree.
|
|
@@ -15,6 +15,8 @@
|
|
|
15
15
|
@use '../../utilities/focus-outline' as *;
|
|
16
16
|
@use '../../utilities/high-contrast-mode' as *;
|
|
17
17
|
@use '../../utilities/layout';
|
|
18
|
+
@use './tokens' as *;
|
|
19
|
+
@use '../button/tokens' as *;
|
|
18
20
|
|
|
19
21
|
@mixin content-switcher {
|
|
20
22
|
.#{$prefix}--content-switcher {
|
|
@@ -23,8 +25,17 @@
|
|
|
23
25
|
|
|
24
26
|
display: flex;
|
|
25
27
|
justify-content: space-evenly;
|
|
28
|
+
border-radius: convert.to-rem(4px);
|
|
26
29
|
block-size: layout.size('height');
|
|
27
30
|
inline-size: 100%;
|
|
31
|
+
outline: convert.to-rem(1px) solid $border-inverse;
|
|
32
|
+
outline-offset: convert.to-rem(-1px);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.#{$prefix}--content-switcher:has(
|
|
36
|
+
.#{$prefix}--content-switcher-btn:disabled
|
|
37
|
+
) {
|
|
38
|
+
outline-color: $border-disabled;
|
|
28
39
|
}
|
|
29
40
|
|
|
30
41
|
.#{$prefix}--content-switcher-btn {
|
|
@@ -44,12 +55,12 @@
|
|
|
44
55
|
color: $text-secondary;
|
|
45
56
|
text-align: start;
|
|
46
57
|
text-decoration: none;
|
|
47
|
-
transition: all $duration-moderate-01 motion(standard, productive);
|
|
48
58
|
white-space: nowrap;
|
|
49
59
|
|
|
50
60
|
&::after {
|
|
51
61
|
position: absolute;
|
|
52
62
|
display: block;
|
|
63
|
+
border-radius: convert.to-rem(4px);
|
|
53
64
|
background-color: $layer-selected-inverse;
|
|
54
65
|
block-size: 100%;
|
|
55
66
|
content: '';
|
|
@@ -58,11 +69,6 @@
|
|
|
58
69
|
inset-inline-start: 0;
|
|
59
70
|
transform: scaleY(0);
|
|
60
71
|
transform-origin: bottom;
|
|
61
|
-
transition: all $duration-moderate-01 motion(standard, productive);
|
|
62
|
-
|
|
63
|
-
@media (prefers-reduced-motion: reduce) {
|
|
64
|
-
transition: none;
|
|
65
|
-
}
|
|
66
72
|
}
|
|
67
73
|
|
|
68
74
|
&:disabled::after {
|
|
@@ -70,15 +76,14 @@
|
|
|
70
76
|
}
|
|
71
77
|
|
|
72
78
|
&:focus {
|
|
73
|
-
|
|
74
|
-
border-color: $focus;
|
|
75
|
-
box-shadow:
|
|
76
|
-
inset 0 0 0 2px $focus,
|
|
77
|
-
inset 0 0 0 3px $focus-inset;
|
|
79
|
+
border: 0;
|
|
78
80
|
}
|
|
79
81
|
|
|
80
82
|
&:focus::after {
|
|
81
|
-
|
|
83
|
+
border-radius: convert.to-rem(4px);
|
|
84
|
+
box-shadow:
|
|
85
|
+
inset 0 0 0 2px $focus,
|
|
86
|
+
inset 0 0 0 3px $focus-inset;
|
|
82
87
|
}
|
|
83
88
|
|
|
84
89
|
&:hover {
|
|
@@ -102,10 +107,31 @@
|
|
|
102
107
|
cursor: not-allowed;
|
|
103
108
|
}
|
|
104
109
|
}
|
|
110
|
+
}
|
|
105
111
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
112
|
+
.#{$prefix}--content-switcher-btn:not(
|
|
113
|
+
.#{$prefix}--content-switcher--selected
|
|
114
|
+
) {
|
|
115
|
+
&:focus::before {
|
|
116
|
+
display: block;
|
|
117
|
+
border-radius: convert.to-rem(4px);
|
|
118
|
+
block-size: 100%;
|
|
119
|
+
box-shadow: inset 0 0 0 convert.to-rem(2px) $focus;
|
|
120
|
+
content: '';
|
|
121
|
+
inline-size: 100%;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
&:focus::after {
|
|
125
|
+
background-color: $focus-inset;
|
|
126
|
+
transform: scaleY(1);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
&:focus:hover::after {
|
|
130
|
+
border-radius: 0;
|
|
131
|
+
background-color: $layer-hover;
|
|
132
|
+
border-block-end: convert.to-rem(1px) solid $border-inverse;
|
|
133
|
+
border-block-start: convert.to-rem(1px) solid $border-inverse;
|
|
134
|
+
box-shadow: none;
|
|
109
135
|
}
|
|
110
136
|
}
|
|
111
137
|
|
|
@@ -119,24 +145,22 @@
|
|
|
119
145
|
.#{$prefix}--content-switcher:not(.#{$prefix}--content-switcher--icon-only)
|
|
120
146
|
.#{$prefix}--content-switcher-btn:first-child {
|
|
121
147
|
border-end-start-radius: convert.to-rem(4px);
|
|
122
|
-
border-inline-start: convert.to-rem(1px) solid $border-inverse;
|
|
123
148
|
border-start-start-radius: convert.to-rem(4px);
|
|
149
|
+
box-shadow: inset convert.to-rem(1px) 0 0 0 $border-inverse;
|
|
124
150
|
|
|
125
151
|
&:disabled {
|
|
126
|
-
|
|
127
|
-
color: $text-disabled;
|
|
152
|
+
box-shadow: none;
|
|
128
153
|
}
|
|
129
154
|
}
|
|
130
155
|
|
|
131
156
|
.#{$prefix}--content-switcher:not(.#{$prefix}--content-switcher--icon-only)
|
|
132
157
|
.#{$prefix}--content-switcher-btn:last-child {
|
|
133
158
|
border-end-end-radius: convert.to-rem(4px);
|
|
134
|
-
border-inline-end: convert.to-rem(1px) solid $border-inverse;
|
|
135
159
|
border-start-end-radius: convert.to-rem(4px);
|
|
160
|
+
box-shadow: inset convert.to-rem(-1px) 0 0 0 $border-inverse;
|
|
136
161
|
|
|
137
162
|
&:disabled {
|
|
138
|
-
|
|
139
|
-
color: $text-disabled;
|
|
163
|
+
box-shadow: none;
|
|
140
164
|
}
|
|
141
165
|
}
|
|
142
166
|
|
|
@@ -147,6 +171,10 @@
|
|
|
147
171
|
.#{$prefix}--content-switcher
|
|
148
172
|
.#{$prefix}--content-switcher-btn.#{$prefix}--content-switcher--selected:last-child {
|
|
149
173
|
border: 0;
|
|
174
|
+
|
|
175
|
+
&:disabled::before {
|
|
176
|
+
display: none;
|
|
177
|
+
}
|
|
150
178
|
}
|
|
151
179
|
|
|
152
180
|
.#{$prefix}--content-switcher-btn::before {
|
|
@@ -162,7 +190,7 @@
|
|
|
162
190
|
|
|
163
191
|
.#{$prefix}--content-switcher:not(.#{$prefix}--content-switcher--icon-only)
|
|
164
192
|
.#{$prefix}--content-switcher-btn:first-of-type::before {
|
|
165
|
-
|
|
193
|
+
background-color: transparent;
|
|
166
194
|
}
|
|
167
195
|
|
|
168
196
|
.#{$prefix}--content-switcher-btn:focus::before,
|
|
@@ -192,7 +220,6 @@
|
|
|
192
220
|
|
|
193
221
|
.#{$prefix}--content-switcher__icon {
|
|
194
222
|
fill: $icon-secondary;
|
|
195
|
-
transition: fill $duration-fast-01 motion(standard, productive);
|
|
196
223
|
}
|
|
197
224
|
|
|
198
225
|
.#{$prefix}--content-switcher__icon + span {
|
|
@@ -212,13 +239,47 @@
|
|
|
212
239
|
fill: $icon-primary;
|
|
213
240
|
}
|
|
214
241
|
|
|
242
|
+
.#{$prefix}--content-switcher-btn:focus:has(
|
|
243
|
+
+ .#{$prefix}--content-switcher-btn:not(
|
|
244
|
+
.#{$prefix}--content-switcher--selected
|
|
245
|
+
):hover
|
|
246
|
+
),
|
|
247
|
+
.#{$prefix}--content-switcher-btn:not(
|
|
248
|
+
.#{$prefix}--content-switcher--selected
|
|
249
|
+
):hover
|
|
250
|
+
+ .#{$prefix}--content-switcher-btn:focus,
|
|
251
|
+
.#{$prefix}--content-switcher-btn:hover
|
|
252
|
+
+ .#{$prefix}--content-switcher-btn.#{$prefix}--content-switcher--selected,
|
|
253
|
+
.#{$prefix}--content-switcher-btn.#{$prefix}--content-switcher--selected:has(
|
|
254
|
+
+ .#{$prefix}--content-switcher-btn:hover
|
|
255
|
+
) {
|
|
256
|
+
&::before {
|
|
257
|
+
z-index: 0;
|
|
258
|
+
border-radius: 0;
|
|
259
|
+
block-size: 100%;
|
|
260
|
+
border-block-end: convert.to-rem(1px) solid $border-inverse;
|
|
261
|
+
border-block-start: convert.to-rem(1px) solid $border-inverse;
|
|
262
|
+
box-shadow: inset 0 0 0 convert.to-rem(1px) $layer-hover;
|
|
263
|
+
content: '';
|
|
264
|
+
inline-size: 100%;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
&:not(.#{$prefix}--content-switcher--selected)::after {
|
|
268
|
+
background-color: $focus-inset;
|
|
269
|
+
transform: scaleY(1);
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
|
|
215
273
|
.#{$prefix}--content-switcher-btn.#{$prefix}--content-switcher--selected {
|
|
216
274
|
z-index: 3;
|
|
217
|
-
background-color: $layer-selected-inverse;
|
|
218
275
|
color: $text-inverse;
|
|
219
276
|
|
|
277
|
+
&:hover {
|
|
278
|
+
background-color: transparent;
|
|
279
|
+
}
|
|
280
|
+
|
|
220
281
|
&:disabled {
|
|
221
|
-
background-color: $
|
|
282
|
+
background-color: $button-disabled;
|
|
222
283
|
color: $text-disabled;
|
|
223
284
|
}
|
|
224
285
|
|
|
@@ -233,7 +294,6 @@
|
|
|
233
294
|
}
|
|
234
295
|
|
|
235
296
|
// Windows HCM fix
|
|
236
|
-
|
|
237
297
|
.#{$prefix}--content-switcher-btn:focus {
|
|
238
298
|
@include high-contrast-mode('focus');
|
|
239
299
|
}
|
|
@@ -241,40 +301,48 @@
|
|
|
241
301
|
// Icon Only overrides
|
|
242
302
|
.#{$prefix}--content-switcher--icon-only {
|
|
243
303
|
justify-content: flex-start;
|
|
304
|
+
inline-size: fit-content;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
.#{$prefix}--content-switcher--icon-only .#{$prefix}--content-switcher-btn {
|
|
308
|
+
align-items: center;
|
|
309
|
+
padding: 0;
|
|
310
|
+
transition: none;
|
|
311
|
+
|
|
312
|
+
&:focus {
|
|
313
|
+
box-shadow: none;
|
|
314
|
+
}
|
|
244
315
|
}
|
|
245
316
|
|
|
246
317
|
.#{$prefix}--content-switcher--icon-only
|
|
247
318
|
.#{$prefix}--content-switcher-popover__wrapper:first-child
|
|
248
|
-
.#{$prefix}--content-switcher-btn {
|
|
249
|
-
|
|
250
|
-
border-inline-start: convert.to-rem(1px) solid $border-inverse;
|
|
251
|
-
border-start-start-radius: convert.to-rem(4px);
|
|
319
|
+
.#{$prefix}--content-switcher-btn:first-of-type::before {
|
|
320
|
+
background-color: transparent;
|
|
252
321
|
}
|
|
253
322
|
|
|
254
323
|
.#{$prefix}--content-switcher--icon-only
|
|
255
324
|
.#{$prefix}--content-switcher-popover__wrapper:first-child
|
|
256
|
-
.#{$prefix}--content-switcher
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
border-color: $layer-selected-disabled;
|
|
325
|
+
.#{$prefix}--content-switcher-btn {
|
|
326
|
+
border-end-start-radius: convert.to-rem(4px);
|
|
327
|
+
border-start-start-radius: convert.to-rem(4px);
|
|
328
|
+
box-shadow: inset convert.to-rem(1px) 0 0 0 $border-inverse;
|
|
261
329
|
}
|
|
262
330
|
|
|
263
331
|
.#{$prefix}--content-switcher--icon-only
|
|
264
332
|
.#{$prefix}--content-switcher-popover__wrapper:last-child
|
|
265
333
|
.#{$prefix}--content-switcher-btn {
|
|
266
334
|
border-end-end-radius: convert.to-rem(4px);
|
|
267
|
-
border-inline-end: convert.to-rem(1px) solid $border-inverse;
|
|
268
335
|
border-start-end-radius: convert.to-rem(4px);
|
|
336
|
+
box-shadow: inset convert.to-rem(-1px) 0 0 0 $border-inverse;
|
|
269
337
|
}
|
|
270
338
|
|
|
271
|
-
.#{$prefix}--content-switcher--icon-only
|
|
272
|
-
.#{$prefix}--content-switcher-popover__wrapper:last-child
|
|
273
|
-
.#{$prefix}--content-switcher-btn.#{$prefix}--content-switcher--selected,
|
|
274
339
|
.#{$prefix}--content-switcher--icon-only
|
|
275
340
|
.#{$prefix}--content-switcher-popover__wrapper:first-child
|
|
276
|
-
.#{$prefix}--content-switcher-btn
|
|
277
|
-
|
|
341
|
+
.#{$prefix}--content-switcher-btn[disabled],
|
|
342
|
+
.#{$prefix}--content-switcher--icon-only
|
|
343
|
+
.#{$prefix}--content-switcher-popover__wrapper:last-child
|
|
344
|
+
.#{$prefix}--content-switcher-btn[disabled] {
|
|
345
|
+
box-shadow: none;
|
|
278
346
|
}
|
|
279
347
|
|
|
280
348
|
.#{$prefix}--content-switcher--lg .#{$prefix}--content-switcher-btn {
|
|
@@ -290,6 +358,7 @@
|
|
|
290
358
|
.#{$prefix}--content-switcher--icon-only
|
|
291
359
|
.#{$prefix}--content-switcher-btn
|
|
292
360
|
svg {
|
|
361
|
+
z-index: 1;
|
|
293
362
|
fill: $icon-primary;
|
|
294
363
|
}
|
|
295
364
|
|
|
@@ -306,22 +375,18 @@
|
|
|
306
375
|
}
|
|
307
376
|
|
|
308
377
|
// Subtle border overrides
|
|
309
|
-
.#{$prefix}--content-switcher--icon-only
|
|
310
|
-
.#{$prefix}--content-switcher-popover__wrapper:first-of-type
|
|
311
|
-
.#{$prefix}--content-switcher-btn::before {
|
|
312
|
-
display: none;
|
|
313
|
-
}
|
|
314
378
|
|
|
315
379
|
.#{$prefix}--content-switcher-btn:focus::before,
|
|
316
380
|
.#{$prefix}--content-switcher-popover__wrapper:focus-within
|
|
317
381
|
+ .#{$prefix}--content-switcher-popover__wrapper
|
|
318
382
|
.#{$prefix}--content-switcher-btn::before,
|
|
319
|
-
.#{$prefix}--content-switcher-btn:hover::before,
|
|
320
383
|
.#{$prefix}--content-switcher-popover__wrapper:not(
|
|
321
384
|
.#{$prefix}--content-switcher-popover--disabled
|
|
322
385
|
):hover
|
|
323
386
|
+ .#{$prefix}--content-switcher-popover__wrapper
|
|
324
|
-
.#{$prefix}--content-switcher-btn
|
|
387
|
+
.#{$prefix}--content-switcher-btn:not(
|
|
388
|
+
.#{$prefix}--content-switcher--selected
|
|
389
|
+
):not(:focus)::before,
|
|
325
390
|
.#{$prefix}--content-switcher--selected::before,
|
|
326
391
|
.#{$prefix}--content-switcher-popover--selected
|
|
327
392
|
+ .#{$prefix}--content-switcher-popover__wrapper
|
|
@@ -329,11 +394,6 @@
|
|
|
329
394
|
background-color: transparent;
|
|
330
395
|
}
|
|
331
396
|
|
|
332
|
-
.#{$prefix}--content-switcher--icon-only
|
|
333
|
-
.#{$prefix}--content-switcher-btn[disabled] {
|
|
334
|
-
border-color: $border-inverse;
|
|
335
|
-
}
|
|
336
|
-
|
|
337
397
|
.#{$prefix}--content-switcher--icon-only
|
|
338
398
|
.#{$prefix}--content-switcher-btn[disabled]
|
|
339
399
|
svg {
|
|
@@ -355,4 +415,314 @@
|
|
|
355
415
|
.#{$prefix}--content-switcher-btn[disabled]:hover::before {
|
|
356
416
|
background-color: $border-subtle;
|
|
357
417
|
}
|
|
418
|
+
|
|
419
|
+
.#{$prefix}--content-switcher-popover__wrapper:has(
|
|
420
|
+
+ .#{$prefix}--content-switcher-popover__wrapper
|
|
421
|
+
.#{$prefix}--content-switcher-btn:not(
|
|
422
|
+
.#{$prefix}--content-switcher--selected
|
|
423
|
+
):hover
|
|
424
|
+
)
|
|
425
|
+
.#{$prefix}--content-switcher-btn:focus,
|
|
426
|
+
.#{$prefix}--content-switcher-popover__wrapper:not(
|
|
427
|
+
.#{$prefix}--content-switcher-popover--selected
|
|
428
|
+
):hover
|
|
429
|
+
+ .#{$prefix}--content-switcher-popover__wrapper
|
|
430
|
+
.#{$prefix}--content-switcher-btn:focus,
|
|
431
|
+
.#{$prefix}--content-switcher-popover__wrapper:hover
|
|
432
|
+
+ .#{$prefix}--content-switcher-popover__wrapper
|
|
433
|
+
.#{$prefix}--content-switcher--selected,
|
|
434
|
+
.#{$prefix}--content-switcher-popover--selected:has(
|
|
435
|
+
+ .#{$prefix}--content-switcher-popover__wrapper
|
|
436
|
+
.#{$prefix}--content-switcher-btn:hover
|
|
437
|
+
)
|
|
438
|
+
.#{$prefix}--content-switcher-btn {
|
|
439
|
+
&::before {
|
|
440
|
+
z-index: 0;
|
|
441
|
+
border-radius: 0;
|
|
442
|
+
block-size: 100%;
|
|
443
|
+
border-block-end: convert.to-rem(1px) solid $border-inverse;
|
|
444
|
+
border-block-start: convert.to-rem(1px) solid $border-inverse;
|
|
445
|
+
box-shadow: inset 0 0 0 convert.to-rem(1px) $layer-hover;
|
|
446
|
+
content: '';
|
|
447
|
+
inline-size: 100%;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
&:not(.#{$prefix}--content-switcher--selected)::after {
|
|
451
|
+
background-color: $focus-inset;
|
|
452
|
+
transform: scaleY(1);
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
// Low contrast selected state styling
|
|
457
|
+
.#{$prefix}--content-switcher--low-contrast {
|
|
458
|
+
background-color: $content-switcher-background;
|
|
459
|
+
outline-color: $border-strong;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
.#{$prefix}--content-switcher--low-contrast
|
|
463
|
+
.#{$prefix}--content-switcher-btn {
|
|
464
|
+
border-color: $border-strong;
|
|
465
|
+
|
|
466
|
+
&:hover,
|
|
467
|
+
&:active {
|
|
468
|
+
background-color: $content-switcher-background-hover;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
&::before {
|
|
472
|
+
background-color: $border-strong;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
&::after {
|
|
476
|
+
background-color: $content-switcher-selected;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
&:disabled {
|
|
480
|
+
border-color: $border-disabled;
|
|
481
|
+
background-color: transparent;
|
|
482
|
+
color: $text-disabled;
|
|
483
|
+
|
|
484
|
+
&:hover {
|
|
485
|
+
cursor: not-allowed;
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
.#{$prefix}--content-switcher--low-contrast
|
|
491
|
+
.#{$prefix}--content-switcher-btn:not(
|
|
492
|
+
.#{$prefix}--content-switcher--selected
|
|
493
|
+
) {
|
|
494
|
+
&:focus::before {
|
|
495
|
+
background: transparent;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
&:focus::after {
|
|
499
|
+
background-color: $content-switcher-background;
|
|
500
|
+
box-shadow: inset 0 0 0 convert.to-rem(2px) $focus;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
&:focus:hover::after {
|
|
504
|
+
border-color: $border-strong;
|
|
505
|
+
background-color: $content-switcher-background-hover;
|
|
506
|
+
box-shadow: none;
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
.#{$prefix}--content-switcher--low-contrast:not(
|
|
511
|
+
.#{$prefix}--content-switcher--icon-only
|
|
512
|
+
)
|
|
513
|
+
.#{$prefix}--content-switcher-btn:first-child {
|
|
514
|
+
box-shadow: inset convert.to-rem(1px) 0 0 0 $border-strong;
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
.#{$prefix}--content-switcher--low-contrast:not(
|
|
518
|
+
.#{$prefix}--content-switcher--icon-only
|
|
519
|
+
)
|
|
520
|
+
.#{$prefix}--content-switcher-btn:last-child {
|
|
521
|
+
box-shadow: inset convert.to-rem(-1px) 0 0 0 $border-strong;
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
.#{$prefix}--content-switcher--low-contrast {
|
|
525
|
+
.#{$prefix}--content-switcher-btn:focus:has(
|
|
526
|
+
+ .#{$prefix}--content-switcher-btn:not(
|
|
527
|
+
.#{$prefix}--content-switcher--selected
|
|
528
|
+
):hover
|
|
529
|
+
),
|
|
530
|
+
.#{$prefix}--content-switcher-btn:not(
|
|
531
|
+
.#{$prefix}--content-switcher--selected
|
|
532
|
+
):hover
|
|
533
|
+
+ .#{$prefix}--content-switcher-btn:focus,
|
|
534
|
+
.#{$prefix}--content-switcher-btn:hover
|
|
535
|
+
+ .#{$prefix}--content-switcher-btn.#{$prefix}--content-switcher--selected,
|
|
536
|
+
.#{$prefix}--content-switcher-btn.#{$prefix}--content-switcher--selected:has(
|
|
537
|
+
+ .#{$prefix}--content-switcher-btn:hover
|
|
538
|
+
) {
|
|
539
|
+
&::before {
|
|
540
|
+
border-color: $border-strong;
|
|
541
|
+
box-shadow: inset 0 0 0 convert.to-rem(1px)
|
|
542
|
+
$content-switcher-background-hover;
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
&:not(.#{$prefix}--content-switcher--selected)::after {
|
|
546
|
+
background-color: $content-switcher-background;
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
.#{$prefix}--content-switcher--low-contrast
|
|
552
|
+
.#{$prefix}--content-switcher-btn.#{$prefix}--content-switcher--selected {
|
|
553
|
+
@include type-style('heading-compact-01');
|
|
554
|
+
|
|
555
|
+
color: $text-primary;
|
|
556
|
+
|
|
557
|
+
&:hover {
|
|
558
|
+
background-color: transparent;
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
&::after {
|
|
562
|
+
border-radius: convert.to-rem(4px);
|
|
563
|
+
background-color: $content-switcher-selected;
|
|
564
|
+
box-shadow: inset 0 0 0 convert.to-rem(1px) $border-inverse;
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
&:focus::after {
|
|
568
|
+
box-shadow: inset 0 0 0 convert.to-rem(2px) $focus;
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
&:disabled {
|
|
572
|
+
border: convert.to-rem(1px) solid $border-disabled;
|
|
573
|
+
border-radius: convert.to-rem(4px);
|
|
574
|
+
background-color: $content-switcher-selected;
|
|
575
|
+
color: $text-disabled;
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
&:disabled::before {
|
|
579
|
+
background-color: transparent;
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
.#{$prefix}--content-switcher--low-contrast
|
|
584
|
+
.#{$prefix}--content-switcher-btn:focus::before,
|
|
585
|
+
.#{$prefix}--content-switcher--low-contrast
|
|
586
|
+
.#{$prefix}--content-switcher-btn:focus
|
|
587
|
+
+ .#{$prefix}--content-switcher-btn::before,
|
|
588
|
+
.#{$prefix}--content-switcher--low-contrast
|
|
589
|
+
.#{$prefix}--content-switcher-btn:hover::before,
|
|
590
|
+
.#{$prefix}--content-switcher--low-contrast
|
|
591
|
+
.#{$prefix}--content-switcher-btn:hover
|
|
592
|
+
+ .#{$prefix}--content-switcher-btn::before,
|
|
593
|
+
.#{$prefix}--content-switcher--low-contrast
|
|
594
|
+
.#{$prefix}--content-switcher--selected::before,
|
|
595
|
+
.#{$prefix}--content-switcher--low-contrast
|
|
596
|
+
.#{$prefix}--content-switcher--selected
|
|
597
|
+
+ .#{$prefix}--content-switcher-btn::before {
|
|
598
|
+
background-color: transparent;
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
.#{$prefix}--content-switcher--low-contrast
|
|
602
|
+
.#{$prefix}--content-switcher-btn:disabled::before,
|
|
603
|
+
.#{$prefix}--content-switcher--low-contrast
|
|
604
|
+
.#{$prefix}--content-switcher-btn:disabled:hover
|
|
605
|
+
+ .#{$prefix}--content-switcher-btn:disabled::before {
|
|
606
|
+
background-color: $border-disabled;
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
.#{$prefix}--content-switcher--low-contrast
|
|
610
|
+
.#{$prefix}--content-switcher-btn.#{$prefix}--content-switcher--selected:disabled
|
|
611
|
+
+ .#{$prefix}--content-switcher-btn::before,
|
|
612
|
+
.#{$prefix}--content-switcher--low-contrast
|
|
613
|
+
.#{$prefix}--content-switcher-btn.#{$prefix}--content-switcher--selected:disabled:hover
|
|
614
|
+
+ .#{$prefix}--content-switcher-btn::before,
|
|
615
|
+
.#{$prefix}--content-switcher--low-contrast
|
|
616
|
+
.#{$prefix}--content-switcher-btn:disabled:hover
|
|
617
|
+
+ .#{$prefix}--content-switcher-btn.#{$prefix}--content-switcher--selected::before {
|
|
618
|
+
background-color: transparent;
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
// low contrast icons
|
|
622
|
+
|
|
623
|
+
.#{$prefix}--content-switcher--low-contrast.#{$prefix}--content-switcher--icon-only
|
|
624
|
+
.#{$prefix}--content-switcher-popover__wrapper:first-child
|
|
625
|
+
.#{$prefix}--content-switcher-btn:not([disabled]) {
|
|
626
|
+
box-shadow: inset convert.to-rem(1px) 0 0 0 $border-strong;
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
.#{$prefix}--content-switcher--low-contrast.#{$prefix}--content-switcher--icon-only
|
|
630
|
+
.#{$prefix}--content-switcher-popover__wrapper:last-child
|
|
631
|
+
.#{$prefix}--content-switcher-btn:not([disabled]) {
|
|
632
|
+
box-shadow: inset convert.to-rem(-1px) 0 0 0 $border-strong;
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
.#{$prefix}--content-switcher--low-contrast.#{$prefix}--content-switcher--icon-only
|
|
636
|
+
.#{$prefix}--content-switcher-btn
|
|
637
|
+
svg {
|
|
638
|
+
fill: $icon-secondary;
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
.#{$prefix}--content-switcher--low-contrast.#{$prefix}--content-switcher--icon-only
|
|
642
|
+
.#{$prefix}--content-switcher-btn:hover
|
|
643
|
+
svg {
|
|
644
|
+
fill: $icon-primary;
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
.#{$prefix}--content-switcher--low-contrast.#{$prefix}--content-switcher--icon-only
|
|
648
|
+
.#{$prefix}--content-switcher-btn[disabled]
|
|
649
|
+
svg {
|
|
650
|
+
fill: $icon-disabled;
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
.#{$prefix}--content-switcher--low-contrast.#{$prefix}--content-switcher--icon-only
|
|
654
|
+
.#{$prefix}--content-switcher-btn.#{$prefix}--content-switcher--selected
|
|
655
|
+
svg {
|
|
656
|
+
fill: $icon-primary;
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
.#{$prefix}--content-switcher--low-contrast.#{$prefix}--content-switcher--icon-only
|
|
660
|
+
.#{$prefix}--content-switcher-btn.#{$prefix}--content-switcher--selected[disabled]
|
|
661
|
+
svg {
|
|
662
|
+
fill: $icon-disabled;
|
|
663
|
+
}
|
|
664
|
+
.#{$prefix}--content-switcher--low-contrast.#{$prefix}--content-switcher--icon-only
|
|
665
|
+
.#{$prefix}--content-switcher-btn.#{$prefix}--content-switcher--selected:disabled {
|
|
666
|
+
border-color: $border-disabled;
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
.#{$prefix}--content-switcher--low-contrast
|
|
670
|
+
.#{$prefix}--content-switcher-btn:not(
|
|
671
|
+
.#{$prefix}--content-switcher__selected-hovered
|
|
672
|
+
):focus::before,
|
|
673
|
+
.#{$prefix}--content-switcher--low-contrast
|
|
674
|
+
.#{$prefix}--content-switcher-popover__wrapper:focus-within
|
|
675
|
+
+ .#{$prefix}--content-switcher-popover__wrapper
|
|
676
|
+
.#{$prefix}--content-switcher-btn::before,
|
|
677
|
+
.#{$prefix}--content-switcher--low-contrast
|
|
678
|
+
.#{$prefix}--content-switcher-popover__wrapper:not(
|
|
679
|
+
.#{$prefix}--content-switcher-popover--disabled
|
|
680
|
+
):hover
|
|
681
|
+
+ .#{$prefix}--content-switcher-popover__wrapper
|
|
682
|
+
.#{$prefix}--content-switcher-btn:not(
|
|
683
|
+
.#{$prefix}--content-switcher__selected-hovered
|
|
684
|
+
)::before,
|
|
685
|
+
.#{$prefix}--content-switcher--low-contrast
|
|
686
|
+
.#{$prefix}--content-switcher--selected:not(
|
|
687
|
+
.#{$prefix}--content-switcher__selected-hovered
|
|
688
|
+
)::before,
|
|
689
|
+
.#{$prefix}--content-switcher--low-contrast
|
|
690
|
+
.#{$prefix}--content-switcher-popover--selected
|
|
691
|
+
+ .#{$prefix}--content-switcher-popover__wrapper
|
|
692
|
+
.#{$prefix}--content-switcher-btn::before {
|
|
693
|
+
background-color: transparent;
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
.#{$prefix}--content-switcher--low-contrast {
|
|
697
|
+
.#{$prefix}--content-switcher-popover__wrapper:has(
|
|
698
|
+
+ .#{$prefix}--content-switcher-popover__wrapper
|
|
699
|
+
.#{$prefix}--content-switcher-btn:not(
|
|
700
|
+
.#{$prefix}--content-switcher--selected
|
|
701
|
+
):hover
|
|
702
|
+
)
|
|
703
|
+
.#{$prefix}--content-switcher-btn:focus,
|
|
704
|
+
.#{$prefix}--content-switcher-popover__wrapper:not(
|
|
705
|
+
.#{$prefix}--content-switcher-popover--selected
|
|
706
|
+
):hover
|
|
707
|
+
+ .#{$prefix}--content-switcher-popover__wrapper
|
|
708
|
+
.#{$prefix}--content-switcher-btn:focus,
|
|
709
|
+
.#{$prefix}--content-switcher-popover__wrapper:hover
|
|
710
|
+
+ .#{$prefix}--content-switcher-popover__wrapper
|
|
711
|
+
.#{$prefix}--content-switcher--selected,
|
|
712
|
+
.#{$prefix}--content-switcher-popover--selected:has(
|
|
713
|
+
+ .#{$prefix}--content-switcher-popover__wrapper
|
|
714
|
+
.#{$prefix}--content-switcher-btn:hover
|
|
715
|
+
)
|
|
716
|
+
.#{$prefix}--content-switcher-btn {
|
|
717
|
+
&::before {
|
|
718
|
+
border-color: $border-strong;
|
|
719
|
+
box-shadow: inset 0 0 0 convert.to-rem(1px)
|
|
720
|
+
$content-switcher-background-hover;
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
&:not(.#{$prefix}--content-switcher--selected)::after {
|
|
724
|
+
background-color: $content-switcher-background;
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
}
|
|
358
728
|
}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
//
|
|
2
|
-
// Copyright IBM Corp. 2018,
|
|
2
|
+
// Copyright IBM Corp. 2018, 2025
|
|
3
3
|
//
|
|
4
4
|
// This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
// LICENSE file in the root directory of this source tree.
|
|
6
6
|
//
|
|
7
7
|
|
|
8
8
|
@forward 'content-switcher';
|
|
9
|
+
@forward 'tokens';
|
|
10
|
+
|
|
11
|
+
@use '../../theme';
|
|
9
12
|
@use 'content-switcher';
|
|
13
|
+
@use 'tokens';
|
|
10
14
|
|
|
15
|
+
@include theme.add-component-tokens(tokens.$content-switcher-tokens);
|
|
11
16
|
@include content-switcher.content-switcher;
|