@slotted/styles 0.1.0-beta.3 → 0.1.0-beta.30
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/package.json +13 -1
- package/src/accordion/accordion.css +11 -11
- package/src/action-bar/action-bar.css +47 -44
- package/src/action-bar/action-bar.tokens.json +1 -0
- package/src/action-sheet/action-sheet.css +39 -39
- package/src/alert/alert.css +96 -96
- package/src/alert/alert.tokens.json +5 -0
- package/src/app-shell/app-shell.css +455 -328
- package/src/app-shell/app-shell.tokens.json +5 -2
- package/src/aspect-ratio/aspect-ratio.css +9 -9
- package/src/attachment/attachment.css +118 -114
- package/src/avatar/avatar.css +96 -66
- package/src/avatar/avatar.tokens.json +7 -0
- package/src/avatar-group/avatar-group.css +22 -23
- package/src/badge/badge.css +54 -46
- package/src/badge/badge.tokens.json +5 -0
- package/src/breadcrumb/breadcrumb.css +52 -52
- package/src/button/button.css +137 -89
- package/src/button/button.tokens.json +5 -0
- package/src/button-group/button-group.css +80 -79
- package/src/button-group/button-group.tokens.json +1 -0
- package/src/calendar/calendar.css +139 -109
- package/src/calendar/calendar.tokens.json +5 -1
- package/src/card/card.css +68 -65
- package/src/carousel/carousel.css +158 -169
- package/src/cascader/cascader.css +158 -157
- package/src/cascader/cascader.tokens.json +1 -0
- package/src/chart/chart.css +288 -267
- package/src/chart/chart.tokens.json +4 -0
- package/src/checkbox/checkbox.css +143 -148
- package/src/checkbox-group/checkbox-group.css +7 -7
- package/src/code-block/code-block.css +85 -89
- package/src/collapsible/collapsible.css +76 -80
- package/src/color-picker/color-picker.css +106 -114
- package/src/column-manager/column-manager.css +111 -119
- package/src/combobox/combobox.css +203 -130
- package/src/combobox/combobox.tokens.json +3 -0
- package/src/command-palette/command-palette.css +155 -102
- package/src/command-palette/command-palette.tokens.json +2 -0
- package/src/container/container.css +27 -27
- package/src/context-menu/context-menu.css +9 -9
- package/src/currency-field/currency-field.css +119 -119
- package/src/currency-field/currency-field.tokens.json +1 -0
- package/src/dashboard-grid/dashboard-grid.css +185 -115
- package/src/data-grid/data-grid.css +598 -496
- package/src/data-grid/data-grid.tokens.json +5 -1
- package/src/data-list/data-list.css +82 -71
- package/src/data-list/data-list.tokens.json +2 -1
- package/src/date-field/date-field.css +62 -57
- package/src/date-field/date-field.tokens.json +1 -0
- package/src/date-picker/date-picker.css +117 -58
- package/src/date-picker/date-picker.tokens.json +5 -0
- package/src/date-range-picker/date-range-picker.css +157 -127
- package/src/date-range-picker/date-range-picker.tokens.json +4 -0
- package/src/datetime-field/datetime-field.css +90 -90
- package/src/datetime-field/datetime-field.tokens.json +1 -0
- package/src/datetime-picker/datetime-picker.css +123 -70
- package/src/datetime-picker/datetime-picker.tokens.json +4 -1
- package/src/datetime-range-picker/datetime-range-picker.css +191 -163
- package/src/datetime-range-picker/datetime-range-picker.tokens.json +4 -0
- package/src/description-list/description-list.css +105 -75
- package/src/description-list/description-list.tokens.json +1 -0
- package/src/detail-panel/detail-panel.css +86 -71
- package/src/detail-panel/detail-panel.tokens.json +2 -0
- package/src/dialog/dialog.css +434 -198
- package/src/dialog/dialog.tokens.json +7 -0
- package/src/divider/divider.css +20 -20
- package/src/drawer/drawer.css +597 -236
- package/src/drawer/drawer.tokens.json +13 -0
- package/src/entity-picker/entity-picker.css +323 -270
- package/src/entity-picker/entity-picker.tokens.json +3 -0
- package/src/event-calendar/event-calendar.css +357 -399
- package/src/field/field.css +106 -93
- package/src/field/field.tokens.json +2 -0
- package/src/field-group/field-group.css +43 -33
- package/src/field-group/field-group.tokens.json +3 -0
- package/src/filter-bar/filter-bar.css +200 -216
- package/src/form/form.css +99 -25
- package/src/form/form.tokens.json +5 -0
- package/src/fullscreen/fullscreen.css +26 -27
- package/src/grid/grid.css +29 -29
- package/src/highlight/highlight.css +11 -11
- package/src/hover-card/hover-card.css +9 -9
- package/src/icon/icon.css +67 -20
- package/src/icon/icon.tokens.json +1 -0
- package/src/image/image.css +42 -42
- package/src/import-export-center/import-export-center.css +144 -165
- package/src/inline/inline.css +28 -28
- package/src/inline-message/inline-message.css +162 -86
- package/src/inline-message/inline-message.tokens.json +4 -0
- package/src/kbd/kbd.css +62 -50
- package/src/kbd/kbd.tokens.json +3 -0
- package/src/link/link.css +54 -33
- package/src/link/link.tokens.json +4 -0
- package/src/list/list.css +23 -23
- package/src/list-item/list-item.css +89 -75
- package/src/list-item/list-item.tokens.json +7 -0
- package/src/listbox/listbox.css +71 -70
- package/src/listbox/listbox.tokens.json +0 -1
- package/src/loading-overlay/loading-overlay.css +86 -103
- package/src/markdown/markdown.css +20 -20
- package/src/media-viewer/media-viewer.css +790 -0
- package/src/media-viewer/media-viewer.tokens.json +53 -0
- package/src/menu/menu.css +162 -82
- package/src/menu/menu.tokens.json +2 -1
- package/src/menubar/menubar.css +16 -16
- package/src/message/message.css +1250 -1253
- package/src/message/message.tokens.json +5 -0
- package/src/message-scroller/message-scroller.css +323 -320
- package/src/multi-select/multi-select.css +230 -172
- package/src/multi-select/multi-select.tokens.json +2 -0
- package/src/navigation-menu/navigation-menu.css +169 -190
- package/src/notification-center/notification-center.css +153 -161
- package/src/notification-center/notification-center.tokens.json +3 -0
- package/src/number-field/number-field.css +93 -93
- package/src/number-field/number-field.tokens.json +1 -0
- package/src/otp-input/otp-input.css +74 -64
- package/src/otp-input/otp-input.tokens.json +1 -0
- package/src/page/page.css +41 -27
- package/src/page/page.tokens.json +1 -0
- package/src/page-header/page-header.css +341 -286
- package/src/page-header/page-header.tokens.json +5 -0
- package/src/pagination/pagination.css +75 -79
- package/src/popover/popover.css +81 -64
- package/src/popover/popover.tokens.json +1 -0
- package/src/progress-indicator/progress-indicator.css +192 -136
- package/src/progress-indicator/progress-indicator.tokens.json +1 -0
- package/src/prompt-composer/prompt-composer.css +260 -113
- package/src/prompt-composer/prompt-composer.tokens.json +15 -0
- package/src/prose/prose.css +77 -82
- package/src/radio-group/radio-group.css +107 -112
- package/src/rating/rating.css +146 -142
- package/src/rating/rating.tokens.json +1 -0
- package/src/result-state/result-state.css +94 -101
- package/src/runtime-properties.mjs +19 -6
- package/src/saved-views/saved-views.css +43 -49
- package/src/scroll-area/scroll-area.css +44 -37
- package/src/section/section.css +178 -43
- package/src/section/section.tokens.json +8 -2
- package/src/segmented-control/segmented-control.css +210 -133
- package/src/segmented-control/segmented-control.tokens.json +7 -11
- package/src/select/select.css +210 -147
- package/src/select/select.tokens.json +3 -0
- package/src/side-navigation/side-navigation.css +193 -196
- package/src/side-navigation/side-navigation.tokens.json +1 -0
- package/src/skeleton/skeleton.css +57 -58
- package/src/slider/slider.css +101 -103
- package/src/sparkline/sparkline.css +75 -53
- package/src/sparkline/sparkline.tokens.json +2 -0
- package/src/spinner/spinner.css +83 -180
- package/src/spinner/spinner.tokens.json +0 -1
- package/src/split-button/split-button.css +34 -35
- package/src/split-button/split-button.tokens.json +1 -0
- package/src/splitter/splitter.css +47 -48
- package/src/stack/stack.css +25 -25
- package/src/stat-card/stat-card.css +415 -245
- package/src/stat-card/stat-card.tokens.json +8 -0
- package/src/status-indicator/status-indicator.css +124 -100
- package/src/status-indicator/status-indicator.tokens.json +0 -3
- package/src/stepper/stepper.css +78 -82
- package/src/switch/switch.css +100 -106
- package/src/table/table.css +270 -198
- package/src/table/table.tokens.json +2 -0
- package/src/table-of-contents/table-of-contents.css +60 -59
- package/src/table-of-contents/table-of-contents.tokens.json +1 -0
- package/src/tabs/tabs.css +327 -294
- package/src/tabs/tabs.tokens.json +7 -1
- package/src/tag/tag.css +109 -88
- package/src/tag/tag.tokens.json +10 -0
- package/src/tags-input/tags-input.css +152 -87
- package/src/tags-input/tags-input.tokens.json +7 -1
- package/src/text-field/text-field.css +146 -148
- package/src/text-field/text-field.tokens.json +1 -0
- package/src/textarea/textarea.css +38 -33
- package/src/textarea/textarea.tokens.json +1 -0
- package/src/time-field/time-field.css +82 -77
- package/src/time-field/time-field.tokens.json +1 -0
- package/src/time-picker/time-picker.css +116 -64
- package/src/time-picker/time-picker.tokens.json +4 -1
- package/src/time-range-picker/time-range-picker.css +168 -140
- package/src/time-range-picker/time-range-picker.tokens.json +4 -0
- package/src/timeline/timeline.css +280 -292
- package/src/timeline/timeline.tokens.json +5 -0
- package/src/toast/toast.css +138 -121
- package/src/toast/toast.tokens.json +6 -0
- package/src/toggle/toggle.css +34 -38
- package/src/toggle-group/toggle-group.css +73 -77
- package/src/toolbar/toolbar.css +33 -38
- package/src/tooltip/tooltip.css +65 -39
- package/src/tooltip/tooltip.tokens.json +1 -0
- package/src/top-navigation/top-navigation.css +252 -268
- package/src/tour/tour.css +64 -73
- package/src/transfer/transfer.css +164 -168
- package/src/tree/tree.css +113 -121
- package/src/typography/typography.css +42 -38
- package/src/typography/typography.tokens.json +1 -0
- package/src/upload/upload.css +256 -257
- package/src/visually-hidden/visually-hidden.css +1 -1
- package/src/wizard/wizard.css +187 -199
package/src/switch/switch.css
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
* the binding mirrors, because a control can be disabled by something that
|
|
22
22
|
* never told it so.
|
|
23
23
|
*/
|
|
24
|
-
[data-ui
|
|
24
|
+
[data-ui-switch][data-part-root] {
|
|
25
25
|
/**
|
|
26
26
|
* The thumb is the control glyph, which is the scale the theme restates
|
|
27
27
|
* per density — so a switch in a dense table shrinks whole rather than in
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
--_line-height: var(--slotted-switch-line-height, var(--slotted-line-height-md, 1.5));
|
|
44
44
|
/**
|
|
45
45
|
* The height the label's line is missing before it is as tall as the pill,
|
|
46
|
-
* split above and below its text, so the text reads
|
|
46
|
+
* split above and below its text, so the text reads centerd on the pill
|
|
47
47
|
* rather than sitting at the top of a row the pill made.
|
|
48
48
|
*
|
|
49
49
|
* It was the height a one-line label was missing before it was a WCAG 2.2
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
* its pill and its label and never of its target (SW2). The overhang is on
|
|
99
99
|
* a transparent box, so nothing about it is visible.
|
|
100
100
|
*/
|
|
101
|
-
[data-ui
|
|
101
|
+
[data-ui-switch] > [data-part-control] {
|
|
102
102
|
align-self: start;
|
|
103
103
|
appearance: none;
|
|
104
104
|
background-color: transparent;
|
|
@@ -136,10 +136,10 @@
|
|
|
136
136
|
/**
|
|
137
137
|
* The track. It carries the ground, the edge and the ring, and it is the
|
|
138
138
|
* containing block the thumb travels inside. It is lifted onto the label's
|
|
139
|
-
* first line rather than
|
|
139
|
+
* first line rather than centerd on the label, because `align-items: center`
|
|
140
140
|
* on a label that wraps to three lines puts the pill beside the second one.
|
|
141
141
|
*/
|
|
142
|
-
[data-ui
|
|
142
|
+
[data-ui-switch] > [data-part-track] {
|
|
143
143
|
background-color: var(
|
|
144
144
|
--slotted-switch-track-background,
|
|
145
145
|
var(--slotted-tone-secondary-solid, ButtonFace)
|
|
@@ -169,8 +169,8 @@
|
|
|
169
169
|
* right-to-left document mirrors the movement with no direction-specific
|
|
170
170
|
* rule at all — the axis is the writing direction's, not the screen's.
|
|
171
171
|
*/
|
|
172
|
-
[data-ui
|
|
173
|
-
/* A flex box, so the mark's icon is
|
|
172
|
+
[data-ui-switch] > [data-part-track] > [data-part-thumb] {
|
|
173
|
+
/* A flex box, so the mark's icon is centerd in the knob as a box and not
|
|
174
174
|
set on a line of text. */
|
|
175
175
|
align-items: center;
|
|
176
176
|
/**
|
|
@@ -184,8 +184,8 @@
|
|
|
184
184
|
background-color: var(--slotted-switch-thumb-background, var(--slotted-tone-accent-on-solid));
|
|
185
185
|
/**
|
|
186
186
|
* The thumb keeps an edge in every state. A thumb separated from its track
|
|
187
|
-
* by
|
|
188
|
-
* unchecked track is white, and under forced
|
|
187
|
+
* by color alone disappears in the `high-contrast` scheme, where the
|
|
188
|
+
* unchecked track is white, and under forced colors, where it is Canvas.
|
|
189
189
|
*/
|
|
190
190
|
border: var(--_border) solid
|
|
191
191
|
var(--slotted-switch-thumb-border-color, var(--slotted-control-border-color, ButtonBorder));
|
|
@@ -196,7 +196,7 @@
|
|
|
196
196
|
* that is meant to look raised. It is barely visible on purpose: on a
|
|
197
197
|
* light unchecked track the knob and the ground are two steps apart, and
|
|
198
198
|
* without it the knob rests on its own hairline border alone. The theme
|
|
199
|
-
* withdraws it in `high-contrast` and under forced
|
|
199
|
+
* withdraws it in `high-contrast` and under forced colors, where the
|
|
200
200
|
* border is doing the work instead.
|
|
201
201
|
*/
|
|
202
202
|
box-shadow: var(--slotted-switch-thumb-shadow, var(--slotted-control-shadow, none));
|
|
@@ -218,7 +218,7 @@
|
|
|
218
218
|
|
|
219
219
|
/**
|
|
220
220
|
* The mark. `docs/component-features.md` asks for the state to be
|
|
221
|
-
* perceptible beyond
|
|
221
|
+
* perceptible beyond color *and* beyond position, and this is what supplies
|
|
222
222
|
* it: the check the binding renders in the knob as the `Glyph` element,
|
|
223
223
|
* never a character. `indicator="none"` is the binding rendering none.
|
|
224
224
|
*
|
|
@@ -226,7 +226,7 @@
|
|
|
226
226
|
* changing rather than two marks swapping places. Off is the absence of the
|
|
227
227
|
* mark, which is the same statement a checkbox makes.
|
|
228
228
|
*/
|
|
229
|
-
[data-ui
|
|
229
|
+
[data-ui-switch] > [data-part-track] > [data-part-thumb] > [data-ui-icon] {
|
|
230
230
|
/**
|
|
231
231
|
* Seventy per cent of the knob rather than all of it. The glyph is drawn
|
|
232
232
|
* on a 24-unit grid with a 3-unit stroke, so filling the knob the check
|
|
@@ -249,9 +249,9 @@
|
|
|
249
249
|
* at the tighter densities, and what makes up the difference is the control
|
|
250
250
|
* stretched over the pill, which is a transparent box with a minimum of its
|
|
251
251
|
* own — the correction `docs/token-foundation.md` asks the family for. The
|
|
252
|
-
* padding here is optical: it
|
|
252
|
+
* padding here is optical: it centers the words on the pill.
|
|
253
253
|
*/
|
|
254
|
-
[data-ui
|
|
254
|
+
[data-ui-switch] > [data-part-label] {
|
|
255
255
|
cursor: pointer;
|
|
256
256
|
grid-column: 2;
|
|
257
257
|
grid-row: 1;
|
|
@@ -271,18 +271,18 @@
|
|
|
271
271
|
* back as a negative margin, as it gives back its block overhang, so the row
|
|
272
272
|
* is no wider and a press between the pill and the words still lands on it.
|
|
273
273
|
*/
|
|
274
|
-
[data-ui
|
|
274
|
+
[data-ui-switch][data-part-root]:has(> [data-part-label]) {
|
|
275
275
|
column-gap: var(--_gap);
|
|
276
276
|
}
|
|
277
277
|
|
|
278
278
|
/* Beside the pill, the label is as wide as its words: stretched across the
|
|
279
279
|
column, a label in Arabic in a row in Portuguese aligned its text to its
|
|
280
280
|
own start and set it at the far end of the row, away from the pill. */
|
|
281
|
-
[data-ui
|
|
281
|
+
[data-ui-switch] > [data-part-label] {
|
|
282
282
|
justify-self: start;
|
|
283
283
|
}
|
|
284
284
|
|
|
285
|
-
[data-ui
|
|
285
|
+
[data-ui-switch][data-part-root]:has(> [data-part-label]) > [data-part-control] {
|
|
286
286
|
inline-size: calc(var(--_track-inline) + var(--_gap));
|
|
287
287
|
margin-inline-end: calc(-1 * var(--_gap));
|
|
288
288
|
}
|
|
@@ -292,7 +292,7 @@
|
|
|
292
292
|
* label: inside, it would join the accessible name, and a paragraph of help
|
|
293
293
|
* text that toggles a setting when it is clicked is a paragraph nobody reads.
|
|
294
294
|
*/
|
|
295
|
-
[data-ui
|
|
295
|
+
[data-ui-switch] > [data-part-description] {
|
|
296
296
|
color: var(--slotted-switch-description-color, var(--slotted-text-muted, GrayText));
|
|
297
297
|
font-size: var(--slotted-switch-description-font-size, var(--slotted-font-size-xs, 0.75rem));
|
|
298
298
|
grid-column: 2;
|
|
@@ -312,7 +312,7 @@
|
|
|
312
312
|
* directions.
|
|
313
313
|
*/
|
|
314
314
|
|
|
315
|
-
[data-ui
|
|
315
|
+
[data-ui-switch][data-part-root][data-label-placement='start'] {
|
|
316
316
|
/**
|
|
317
317
|
* `1fr` and not `max-content`, for the reason `checkbox` records: sizing
|
|
318
318
|
* the first column from each row's own label ends a list with the controls
|
|
@@ -321,24 +321,24 @@
|
|
|
321
321
|
grid-template-columns: minmax(0, 1fr) auto;
|
|
322
322
|
}
|
|
323
323
|
|
|
324
|
-
[data-ui
|
|
325
|
-
[data-ui
|
|
324
|
+
[data-ui-switch][data-part-root][data-label-placement='start'] > [data-part-control],
|
|
325
|
+
[data-ui-switch][data-part-root][data-label-placement='start'] > [data-part-track] {
|
|
326
326
|
grid-area: 1 / 2;
|
|
327
327
|
}
|
|
328
328
|
|
|
329
|
-
[data-ui
|
|
330
|
-
[data-ui
|
|
329
|
+
[data-ui-switch][data-part-root][data-label-placement='start'] > [data-part-label],
|
|
330
|
+
[data-ui-switch][data-part-root][data-label-placement='start'] > [data-part-description] {
|
|
331
331
|
grid-column: 1;
|
|
332
332
|
}
|
|
333
333
|
|
|
334
334
|
/* Before the pill, the label takes the row, so the row is the settings row. */
|
|
335
|
-
[data-ui
|
|
335
|
+
[data-ui-switch][data-part-root][data-label-placement='start'] > [data-part-label] {
|
|
336
336
|
justify-self: stretch;
|
|
337
337
|
}
|
|
338
338
|
|
|
339
339
|
/* The control reaches across the gap towards the label, now on its start side. */
|
|
340
|
-
[data-ui
|
|
341
|
-
> [data-part
|
|
340
|
+
[data-ui-switch][data-part-root][data-label-placement='start']:has(> [data-part-label])
|
|
341
|
+
> [data-part-control] {
|
|
342
342
|
margin-inline-end: 0;
|
|
343
343
|
margin-inline-start: calc(-1 * var(--_gap));
|
|
344
344
|
}
|
|
@@ -350,19 +350,19 @@
|
|
|
350
350
|
* an `md` control is a field and a control disagreeing about one row.
|
|
351
351
|
*/
|
|
352
352
|
|
|
353
|
-
[data-ui
|
|
353
|
+
[data-ui-switch][data-part-root][data-size='sm'] {
|
|
354
354
|
--_thumb-size: var(--slotted-control-icon-size-sm, 14px);
|
|
355
355
|
--_font-size: var(--slotted-control-font-size-sm, 12px);
|
|
356
356
|
--_gap: var(--slotted-control-label-gap-sm, 8px);
|
|
357
357
|
}
|
|
358
358
|
|
|
359
|
-
[data-ui
|
|
359
|
+
[data-ui-switch][data-part-root][data-size='md'] {
|
|
360
360
|
--_thumb-size: var(--slotted-control-icon-size-md, 16px);
|
|
361
361
|
--_font-size: var(--slotted-control-font-size-md, 13px);
|
|
362
362
|
--_gap: var(--slotted-control-label-gap-md, 12px);
|
|
363
363
|
}
|
|
364
364
|
|
|
365
|
-
[data-ui
|
|
365
|
+
[data-ui-switch][data-part-root][data-size='lg'] {
|
|
366
366
|
--_thumb-size: var(--slotted-control-icon-size-lg, 18px);
|
|
367
367
|
--_font-size: var(--slotted-control-font-size-lg, 14px);
|
|
368
368
|
--_gap: var(--slotted-control-label-gap-lg, 12px);
|
|
@@ -379,8 +379,8 @@
|
|
|
379
379
|
* and the deleted `input` family shipped that defect once already.
|
|
380
380
|
*/
|
|
381
381
|
|
|
382
|
-
[data-ui
|
|
383
|
-
> [data-part
|
|
382
|
+
[data-ui-switch][data-part-root]:is([data-checked], :has(> [data-part-control]:checked))
|
|
383
|
+
> [data-part-track] {
|
|
384
384
|
background-color: var(
|
|
385
385
|
--slotted-switch-checked-background,
|
|
386
386
|
var(--slotted-tone-accent-solid, Highlight)
|
|
@@ -391,9 +391,9 @@
|
|
|
391
391
|
);
|
|
392
392
|
}
|
|
393
393
|
|
|
394
|
-
[data-ui
|
|
395
|
-
> [data-part
|
|
396
|
-
> [data-part
|
|
394
|
+
[data-ui-switch][data-part-root]:is([data-checked], :has(> [data-part-control]:checked))
|
|
395
|
+
> [data-part-track]
|
|
396
|
+
> [data-part-thumb] {
|
|
397
397
|
border-color: var(
|
|
398
398
|
--slotted-switch-checked-thumb-border-color,
|
|
399
399
|
var(--slotted-tone-accent-solid, Highlight)
|
|
@@ -401,13 +401,12 @@
|
|
|
401
401
|
inset-inline-start: calc(var(--_gutter) + var(--_travel));
|
|
402
402
|
}
|
|
403
403
|
|
|
404
|
-
[data-ui
|
|
405
|
-
[data-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
> [data-part
|
|
409
|
-
> [data-
|
|
410
|
-
> [data-ui='icon'] {
|
|
404
|
+
[data-ui-switch][data-part-root]:is([data-checked], :has(> [data-part-control]:checked)):not(
|
|
405
|
+
[data-loading]
|
|
406
|
+
)
|
|
407
|
+
> [data-part-track]
|
|
408
|
+
> [data-part-thumb]
|
|
409
|
+
> [data-ui-icon] {
|
|
411
410
|
opacity: 1;
|
|
412
411
|
}
|
|
413
412
|
|
|
@@ -417,23 +416,23 @@
|
|
|
417
416
|
* competes with it. Both are held back for disabled, loading and read-only,
|
|
418
417
|
* and both are written before `invalid`, which outranks them.
|
|
419
418
|
*/
|
|
420
|
-
[data-ui
|
|
419
|
+
[data-ui-switch][data-part-root]:hover:not([data-disabled]):not([data-loading]):not(
|
|
421
420
|
[data-readonly]
|
|
422
|
-
):not(:has(> [data-part
|
|
423
|
-
> [data-part
|
|
421
|
+
):not(:has(> [data-part-control]:disabled))
|
|
422
|
+
> [data-part-track] {
|
|
424
423
|
background-color: var(
|
|
425
424
|
--slotted-switch-hover-background,
|
|
426
425
|
var(--slotted-tone-secondary-solid-hover, ButtonFace)
|
|
427
426
|
);
|
|
428
427
|
}
|
|
429
428
|
|
|
430
|
-
[data-ui
|
|
429
|
+
[data-ui-switch][data-part-root]:is(
|
|
431
430
|
[data-checked],
|
|
432
|
-
:has(> [data-part
|
|
431
|
+
:has(> [data-part-control]:checked)
|
|
433
432
|
):hover:not([data-disabled]):not([data-loading]):not([data-readonly]):not(
|
|
434
|
-
:has(> [data-part
|
|
433
|
+
:has(> [data-part-control]:disabled)
|
|
435
434
|
)
|
|
436
|
-
> [data-part
|
|
435
|
+
> [data-part-track] {
|
|
437
436
|
background-color: var(
|
|
438
437
|
--slotted-switch-checked-hover-background,
|
|
439
438
|
var(--slotted-tone-accent-solid-hover, Highlight)
|
|
@@ -444,23 +443,23 @@
|
|
|
444
443
|
);
|
|
445
444
|
}
|
|
446
445
|
|
|
447
|
-
[data-ui
|
|
446
|
+
[data-ui-switch][data-part-root]:active:not([data-disabled]):not([data-loading]):not(
|
|
448
447
|
[data-readonly]
|
|
449
|
-
):not(:has(> [data-part
|
|
450
|
-
> [data-part
|
|
448
|
+
):not(:has(> [data-part-control]:disabled))
|
|
449
|
+
> [data-part-track] {
|
|
451
450
|
background-color: var(
|
|
452
451
|
--slotted-switch-active-background,
|
|
453
452
|
var(--slotted-tone-secondary-solid-active, ButtonFace)
|
|
454
453
|
);
|
|
455
454
|
}
|
|
456
455
|
|
|
457
|
-
[data-ui
|
|
456
|
+
[data-ui-switch][data-part-root]:is(
|
|
458
457
|
[data-checked],
|
|
459
|
-
:has(> [data-part
|
|
458
|
+
:has(> [data-part-control]:checked)
|
|
460
459
|
):active:not([data-disabled]):not([data-loading]):not([data-readonly]):not(
|
|
461
|
-
:has(> [data-part
|
|
460
|
+
:has(> [data-part-control]:disabled)
|
|
462
461
|
)
|
|
463
|
-
> [data-part
|
|
462
|
+
> [data-part-track] {
|
|
464
463
|
background-color: var(
|
|
465
464
|
--slotted-switch-checked-active-background,
|
|
466
465
|
var(--slotted-tone-accent-solid-active, Highlight)
|
|
@@ -477,8 +476,7 @@
|
|
|
477
476
|
* offset keeps the ring off the pill's own edge, which is what makes a
|
|
478
477
|
* focused unchecked switch legible against a sunken surface.
|
|
479
478
|
*/
|
|
480
|
-
[data-ui
|
|
481
|
-
> [data-part='track'] {
|
|
479
|
+
[data-ui-switch][data-part-root]:has(> [data-part-control]:focus-visible) > [data-part-track] {
|
|
482
480
|
outline: var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, Highlight);
|
|
483
481
|
outline-offset: var(--slotted-focus-ring-offset, 2px);
|
|
484
482
|
}
|
|
@@ -486,14 +484,14 @@
|
|
|
486
484
|
/**
|
|
487
485
|
* Read-only stays focusable, announced and submitted, and it must not be
|
|
488
486
|
* mistakable for disabled. The pill goes hollow rather than grey: the state
|
|
489
|
-
* keeps its own
|
|
487
|
+
* keeps its own color in the mark, and the ground stops saying "press me".
|
|
490
488
|
*/
|
|
491
|
-
[data-ui
|
|
489
|
+
[data-ui-switch][data-part-root][data-readonly] > [data-part-track] {
|
|
492
490
|
background-color: var(--slotted-switch-readonly-background, var(--slotted-surface, Canvas));
|
|
493
491
|
}
|
|
494
492
|
|
|
495
|
-
[data-ui
|
|
496
|
-
[data-ui
|
|
493
|
+
[data-ui-switch][data-part-root][data-readonly] > [data-part-control],
|
|
494
|
+
[data-ui-switch][data-part-root][data-readonly] > [data-part-label] {
|
|
497
495
|
cursor: default;
|
|
498
496
|
}
|
|
499
497
|
|
|
@@ -506,11 +504,11 @@
|
|
|
506
504
|
* two pixels apart, and neither could be told from the other. The state is
|
|
507
505
|
* carried where it always is — the thumb's position, and the mark on it.
|
|
508
506
|
*/
|
|
509
|
-
[data-ui
|
|
507
|
+
[data-ui-switch][data-part-root][data-readonly]:is(
|
|
510
508
|
[data-checked],
|
|
511
|
-
:has(> [data-part
|
|
509
|
+
:has(> [data-part-control]:checked)
|
|
512
510
|
)
|
|
513
|
-
> [data-part
|
|
511
|
+
> [data-part-track] {
|
|
514
512
|
background-color: var(--slotted-switch-readonly-background, var(--slotted-surface, Canvas));
|
|
515
513
|
border-color: var(
|
|
516
514
|
--slotted-switch-readonly-border-color,
|
|
@@ -518,12 +516,12 @@
|
|
|
518
516
|
);
|
|
519
517
|
}
|
|
520
518
|
|
|
521
|
-
[data-ui
|
|
519
|
+
[data-ui-switch][data-part-root][data-readonly]:is(
|
|
522
520
|
[data-checked],
|
|
523
|
-
:has(> [data-part
|
|
521
|
+
:has(> [data-part-control]:checked)
|
|
524
522
|
)
|
|
525
|
-
> [data-part
|
|
526
|
-
> [data-part
|
|
523
|
+
> [data-part-track]
|
|
524
|
+
> [data-part-thumb] {
|
|
527
525
|
border-color: var(
|
|
528
526
|
--slotted-switch-readonly-border-color,
|
|
529
527
|
var(--slotted-control-border-color, ButtonBorder)
|
|
@@ -537,21 +535,21 @@
|
|
|
537
535
|
*
|
|
538
536
|
* The ring is retargeted rather than repainted. Every rule that draws focus
|
|
539
537
|
* reads `--slotted-focus-ring-color`, so pointing that one name at the
|
|
540
|
-
* invalid
|
|
538
|
+
* invalid color on the root moves the ring without restating it — the rule
|
|
541
539
|
* `text-field` wrote for this family to inherit.
|
|
542
540
|
*/
|
|
543
|
-
[data-ui
|
|
541
|
+
[data-ui-switch][data-part-root][data-invalid] {
|
|
544
542
|
--slotted-focus-ring-color: var(
|
|
545
543
|
--slotted-switch-invalid-focus-ring-color,
|
|
546
544
|
var(--slotted-focus-ring-color-invalid, Highlight)
|
|
547
545
|
);
|
|
548
546
|
}
|
|
549
547
|
|
|
550
|
-
[data-ui
|
|
551
|
-
[data-ui
|
|
548
|
+
[data-ui-switch][data-part-root][data-invalid] > [data-part-track],
|
|
549
|
+
[data-ui-switch][data-part-root][data-invalid] > [data-part-track] > [data-part-thumb] {
|
|
552
550
|
border-color: var(--slotted-switch-invalid-border-color, var(--slotted-tone-danger-border));
|
|
553
551
|
/*
|
|
554
|
-
* Width as well as
|
|
552
|
+
* Width as well as color (WCAG 1.4.1), the edge `text-field` draws: in
|
|
555
553
|
* `high-contrast` the danger border is the resting edge's black. An edge
|
|
556
554
|
* inside the border of the track and of the thumb, so neither moves, in
|
|
557
555
|
* place of the thumb's resting lift; the thumb carries it where a checked
|
|
@@ -572,14 +570,14 @@
|
|
|
572
570
|
* moves the row under the pointer. The mark gives way to the arc, which is
|
|
573
571
|
* the one thing in the family that says the value is not settled yet.
|
|
574
572
|
*/
|
|
575
|
-
[data-ui
|
|
573
|
+
[data-ui-switch][data-part-root][data-loading] > [data-part-control] {
|
|
576
574
|
cursor: progress;
|
|
577
575
|
}
|
|
578
576
|
|
|
579
|
-
[data-ui
|
|
580
|
-
> [data-part
|
|
581
|
-
> [data-part
|
|
582
|
-
> [data-ui
|
|
577
|
+
[data-ui-switch][data-part-root][data-loading]
|
|
578
|
+
> [data-part-track]
|
|
579
|
+
> [data-part-thumb]
|
|
580
|
+
> [data-ui-icon] {
|
|
583
581
|
opacity: 0;
|
|
584
582
|
}
|
|
585
583
|
|
|
@@ -589,13 +587,11 @@
|
|
|
589
587
|
* the border already draws. `progress-indicator` is wave 2 and not built;
|
|
590
588
|
* when it is, this is the first thing it should replace.
|
|
591
589
|
*
|
|
592
|
-
* Three quarters rather than one. A single
|
|
590
|
+
* Three quarters rather than one. A single colored side read as a shape
|
|
593
591
|
* rather than as a spinner in a still image, and a still image is what a
|
|
594
592
|
* reader under `prefers-reduced-motion` is looking at.
|
|
595
593
|
*/
|
|
596
|
-
[data-ui
|
|
597
|
-
> [data-part='track']
|
|
598
|
-
> [data-part='thumb']::after {
|
|
594
|
+
[data-ui-switch][data-part-root][data-loading] > [data-part-track] > [data-part-thumb]::after {
|
|
599
595
|
animation: slotted-switch-pending var(--slotted-duration-loop) linear infinite;
|
|
600
596
|
border: var(--slotted-border-width-thin, 1px) solid
|
|
601
597
|
var(--slotted-switch-pending-color, var(--slotted-tone-accent-solid));
|
|
@@ -622,9 +618,7 @@
|
|
|
622
618
|
* without anything moving.
|
|
623
619
|
*/
|
|
624
620
|
@media (prefers-reduced-motion: reduce) {
|
|
625
|
-
[data-ui
|
|
626
|
-
> [data-part='track']
|
|
627
|
-
> [data-part='thumb']::after {
|
|
621
|
+
[data-ui-switch][data-part-root][data-loading] > [data-part-track] > [data-part-thumb]::after {
|
|
628
622
|
animation: none;
|
|
629
623
|
}
|
|
630
624
|
}
|
|
@@ -636,15 +630,15 @@
|
|
|
636
630
|
* so — and left to the attribute alone it would look fully operable and
|
|
637
631
|
* answer nothing.
|
|
638
632
|
*/
|
|
639
|
-
[data-ui
|
|
640
|
-
> [data-part
|
|
641
|
-
[data-ui
|
|
642
|
-
> [data-part
|
|
633
|
+
[data-ui-switch][data-part-root]:is([data-disabled], :has(> [data-part-control]:disabled))
|
|
634
|
+
> [data-part-control],
|
|
635
|
+
[data-ui-switch][data-part-root]:is([data-disabled], :has(> [data-part-control]:disabled))
|
|
636
|
+
> [data-part-label] {
|
|
643
637
|
cursor: not-allowed;
|
|
644
638
|
}
|
|
645
639
|
|
|
646
|
-
[data-ui
|
|
647
|
-
> [data-part
|
|
640
|
+
[data-ui-switch][data-part-root]:is([data-disabled], :has(> [data-part-control]:disabled))
|
|
641
|
+
> [data-part-track] {
|
|
648
642
|
background-color: var(
|
|
649
643
|
--slotted-switch-disabled-background,
|
|
650
644
|
var(--slotted-disabled-background, ButtonFace)
|
|
@@ -653,13 +647,13 @@
|
|
|
653
647
|
}
|
|
654
648
|
|
|
655
649
|
/**
|
|
656
|
-
* Muted to the
|
|
650
|
+
* Muted to the color the theme measures rather than faded by opacity: a
|
|
657
651
|
* setting nobody can read is a setting nobody can check, and a disabled form
|
|
658
652
|
* still has to say what it holds.
|
|
659
653
|
*/
|
|
660
|
-
[data-ui
|
|
661
|
-
> [data-part
|
|
662
|
-
> [data-part
|
|
654
|
+
[data-ui-switch][data-part-root]:is([data-disabled], :has(> [data-part-control]:disabled))
|
|
655
|
+
> [data-part-track]
|
|
656
|
+
> [data-part-thumb] {
|
|
663
657
|
/**
|
|
664
658
|
* Grey rather than white. The knob is the brightest thing in the family,
|
|
665
659
|
* and a bright knob on a grey track reads as a control still waiting to be
|
|
@@ -673,29 +667,29 @@
|
|
|
673
667
|
box-shadow: none;
|
|
674
668
|
}
|
|
675
669
|
|
|
676
|
-
[data-ui
|
|
677
|
-
> [data-part
|
|
678
|
-
> [data-part
|
|
679
|
-
> [data-ui
|
|
670
|
+
[data-ui-switch][data-part-root]:is([data-disabled], :has(> [data-part-control]:disabled))
|
|
671
|
+
> [data-part-track]
|
|
672
|
+
> [data-part-thumb]
|
|
673
|
+
> [data-ui-icon] {
|
|
680
674
|
color: var(--slotted-switch-disabled-mark-color, var(--slotted-disabled-background));
|
|
681
675
|
}
|
|
682
676
|
|
|
683
|
-
[data-ui
|
|
684
|
-
> [data-part
|
|
685
|
-
[data-ui
|
|
686
|
-
> [data-part
|
|
677
|
+
[data-ui-switch][data-part-root]:is([data-disabled], :has(> [data-part-control]:disabled))
|
|
678
|
+
> [data-part-label],
|
|
679
|
+
[data-ui-switch][data-part-root]:is([data-disabled], :has(> [data-part-control]:disabled))
|
|
680
|
+
> [data-part-description] {
|
|
687
681
|
color: var(--slotted-switch-disabled-color, var(--slotted-disabled-foreground, GrayText));
|
|
688
682
|
}
|
|
689
683
|
|
|
690
684
|
/*
|
|
691
|
-
* Forced
|
|
685
|
+
* Forced colors remove every box shadow, and the edge with them. The width
|
|
692
686
|
* comes back as an outline inside the border, on the
|
|
693
687
|
* track and on the thumb; the focus ring takes the track and the thumb keeps
|
|
694
688
|
* its edge.
|
|
695
689
|
*/
|
|
696
690
|
@media (forced-colors: active) {
|
|
697
|
-
[data-ui
|
|
698
|
-
[data-ui
|
|
691
|
+
[data-ui-switch][data-part-root][data-invalid] > [data-part-track],
|
|
692
|
+
[data-ui-switch][data-part-root][data-invalid] > [data-part-track] > [data-part-thumb] {
|
|
699
693
|
outline: var(--_invalid-edge-width) solid CanvasText;
|
|
700
694
|
outline-offset: calc(-1 * (var(--_border) + var(--_invalid-edge-width)));
|
|
701
695
|
}
|