@slotted/styles 0.1.0-beta.4 → 0.1.0-beta.40
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 +21 -1
- package/src/accordion/accordion.css +31 -13
- package/src/accordion/accordion.tokens.json +2 -0
- 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 +97 -97
- package/src/alert/alert.tokens.json +6 -1
- package/src/app-shell/app-shell.css +472 -342
- package/src/app-shell/app-shell.tokens.json +6 -3
- package/src/aspect-ratio/aspect-ratio.css +24 -23
- package/src/attachment/attachment.css +118 -114
- package/src/avatar/avatar.css +97 -67
- package/src/avatar/avatar.tokens.json +8 -0
- package/src/avatar-group/avatar-group.css +22 -23
- package/src/badge/badge.css +58 -47
- package/src/badge/badge.tokens.json +6 -0
- package/src/breadcrumb/breadcrumb.css +52 -52
- package/src/button/button.css +408 -93
- package/src/button/button.tokens.json +13 -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 +594 -267
- package/src/calendar/calendar.tokens.json +35 -3
- package/src/card/card.css +133 -70
- package/src/card/card.tokens.json +1 -0
- package/src/carousel/carousel.css +158 -169
- package/src/cascader/cascader.css +174 -159
- package/src/cascader/cascader.tokens.json +2 -0
- package/src/chart/chart.css +300 -271
- package/src/chart/chart.tokens.json +5 -0
- package/src/checkbox/checkbox.css +190 -148
- package/src/checkbox/checkbox.tokens.json +4 -0
- package/src/checkbox-group/checkbox-group.css +7 -7
- package/src/clock/clock.css +246 -0
- package/src/clock/clock.tokens.json +44 -0
- package/src/code-block/code-block.css +85 -89
- package/src/collapsible/collapsible.css +273 -85
- package/src/collapsible/collapsible.tokens.json +6 -0
- package/src/color-picker/color-picker.css +106 -114
- package/src/column-manager/column-manager.css +111 -119
- package/src/combobox/combobox.css +219 -132
- package/src/combobox/combobox.tokens.json +4 -0
- package/src/command-palette/command-palette.css +214 -102
- package/src/command-palette/command-palette.tokens.json +4 -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 +231 -115
- package/src/dashboard-grid/dashboard-grid.tokens.json +3 -1
- package/src/data-grid/data-grid.css +637 -496
- package/src/data-grid/data-grid.tokens.json +5 -1
- package/src/data-list/data-list.css +93 -76
- 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 +31 -269
- package/src/date-picker/date-picker.tokens.json +1 -21
- package/src/date-range-picker/date-range-picker.css +72 -528
- package/src/date-range-picker/date-range-picker.tokens.json +1 -37
- 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 +49 -711
- package/src/datetime-picker/datetime-picker.tokens.json +1 -50
- package/src/datetime-range-picker/datetime-range-picker.css +60 -985
- package/src/datetime-range-picker/datetime-range-picker.tokens.json +1 -67
- package/src/description-list/description-list.css +120 -76
- 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 +462 -199
- package/src/dialog/dialog.tokens.json +10 -0
- package/src/divider/divider.css +20 -20
- package/src/drawer/drawer.css +736 -237
- package/src/drawer/drawer.tokens.json +15 -0
- package/src/entity-picker/entity-picker.css +402 -272
- package/src/entity-picker/entity-picker.tokens.json +6 -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 +58 -38
- package/src/field-group/field-group.tokens.json +3 -0
- package/src/filter-bar/filter-bar.css +224 -216
- package/src/floating-panel/floating-panel.css +147 -0
- package/src/floating-panel/floating-panel.tokens.json +32 -0
- package/src/form/form.css +103 -26
- package/src/form/form.tokens.json +6 -1
- package/src/fullscreen/fullscreen.css +26 -27
- package/src/grid/grid.css +32 -31
- 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 +147 -168
- package/src/import-export-center/import-export-center.tokens.json +1 -0
- package/src/inline/inline.css +29 -29
- package/src/inline-message/inline-message.css +162 -86
- package/src/inline-message/inline-message.tokens.json +5 -0
- package/src/kbd/kbd.css +63 -51
- package/src/kbd/kbd.tokens.json +4 -0
- package/src/link/link.css +54 -33
- package/src/link/link.tokens.json +4 -0
- package/src/list/list.css +55 -24
- package/src/list/list.tokens.json +2 -0
- package/src/list-item/list-item.css +195 -80
- package/src/list-item/list-item.tokens.json +10 -0
- package/src/listbox/listbox.css +121 -72
- package/src/listbox/listbox.tokens.json +6 -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 +166 -83
- package/src/menu/menu.tokens.json +3 -1
- package/src/menubar/menubar.css +16 -16
- package/src/message/message.css +1296 -1243
- package/src/message/message.tokens.json +14 -0
- package/src/message-scroller/message-scroller.css +323 -320
- package/src/meter/meter.css +136 -0
- package/src/meter/meter.tokens.json +23 -0
- package/src/multi-select/multi-select.css +246 -174
- package/src/multi-select/multi-select.tokens.json +3 -0
- package/src/navigation-menu/navigation-menu.css +170 -191
- package/src/navigation-menu/navigation-menu.tokens.json +1 -0
- package/src/notification-center/notification-center.css +155 -163
- package/src/notification-center/notification-center.tokens.json +4 -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 +109 -31
- package/src/page/page.tokens.json +8 -0
- package/src/page-header/page-header.css +342 -287
- package/src/page-header/page-header.tokens.json +6 -1
- package/src/pagination/pagination.css +75 -79
- package/src/picker-panel/picker-panel.css +1074 -0
- package/src/picker-panel/picker-panel.tokens.json +77 -0
- package/src/popover/popover.css +85 -65
- package/src/popover/popover.tokens.json +2 -0
- package/src/progress-indicator/progress-indicator.css +194 -137
- package/src/progress-indicator/progress-indicator.tokens.json +1 -0
- package/src/prompt-composer/prompt-composer.css +274 -116
- 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 +147 -143
- package/src/rating/rating.tokens.json +2 -0
- package/src/result-state/result-state.css +95 -102
- package/src/result-state/result-state.tokens.json +1 -0
- package/src/runtime-properties.mjs +44 -6
- package/src/saved-views/saved-views.css +43 -49
- package/src/scroll-area/scroll-area.css +50 -37
- package/src/section/section.css +311 -46
- package/src/section/section.tokens.json +13 -1
- package/src/segmented-control/segmented-control.css +221 -133
- package/src/segmented-control/segmented-control.tokens.json +7 -11
- package/src/select/select.css +226 -149
- package/src/select/select.tokens.json +4 -0
- package/src/side-navigation/side-navigation.css +204 -201
- package/src/side-navigation/side-navigation.tokens.json +2 -0
- package/src/skeleton/skeleton.css +76 -58
- package/src/slider/slider.css +108 -104
- package/src/slider/slider.tokens.json +1 -0
- 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 +26 -26
- package/src/stat-card/stat-card.css +420 -245
- package/src/stat-card/stat-card.tokens.json +8 -0
- package/src/status-indicator/status-indicator.css +126 -101
- package/src/status-indicator/status-indicator.tokens.json +0 -3
- package/src/stepper/stepper.css +78 -82
- package/src/switch/switch.css +143 -125
- package/src/switch/switch.tokens.json +4 -0
- package/src/table/table.css +653 -222
- package/src/table/table.tokens.json +10 -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 +113 -89
- package/src/tag/tag.tokens.json +11 -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 +30 -519
- package/src/time-picker/time-picker.tokens.json +1 -38
- package/src/time-range-picker/time-range-picker.css +53 -895
- package/src/time-range-picker/time-range-picker.tokens.json +1 -66
- package/src/timeline/timeline.css +280 -292
- package/src/timeline/timeline.tokens.json +5 -0
- package/src/toast/toast.css +139 -122
- package/src/toast/toast.tokens.json +7 -0
- package/src/toggle/toggle.css +34 -38
- package/src/toggle-group/toggle-group.css +73 -77
- package/src/toolbar/toolbar.css +49 -40
- package/src/toolbar/toolbar.tokens.json +2 -1
- package/src/tooltip/tooltip.css +95 -39
- package/src/tooltip/tooltip.tokens.json +1 -0
- package/src/top-navigation/top-navigation.css +253 -269
- package/src/top-navigation/top-navigation.tokens.json +1 -0
- package/src/tour/tour.css +68 -74
- package/src/tour/tour.tokens.json +1 -0
- package/src/transfer/transfer.css +164 -168
- package/src/tree/tree.css +118 -122
- package/src/typography/typography.css +67 -38
- package/src/typography/typography.tokens.json +2 -0
- package/src/upload/upload.css +256 -257
- package/src/visually-hidden/visually-hidden.css +1 -1
- package/src/wizard/wizard.css +187 -199
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
* the name that says so, which is the convention `docs/build-briefing.md`
|
|
42
42
|
* sets. They are not design tokens and no theme writes them.
|
|
43
43
|
*/
|
|
44
|
-
[data-ui
|
|
44
|
+
[data-ui-segmented-control][data-part-root] {
|
|
45
45
|
--_count: var(--slotted-segmented-control-count, 1);
|
|
46
46
|
--_index: var(--slotted-segmented-control-index, 0);
|
|
47
47
|
--_height: var(--slotted-control-height-md, 34px);
|
|
@@ -59,25 +59,34 @@
|
|
|
59
59
|
--_inset: var(--slotted-segmented-control-inset, var(--slotted-space-1, 0.125rem));
|
|
60
60
|
/** What is left for a segment once the track has taken its edge and ring. */
|
|
61
61
|
--_inner: calc(var(--_height) - (var(--_inset) + var(--_border-width)) * 2);
|
|
62
|
+
/** The space between two segments: the ring's own step. */
|
|
63
|
+
--_spacing: var(--slotted-segmented-control-gap, var(--_inset));
|
|
62
64
|
/** The thumb's corner, kept concentric with the track's own. */
|
|
63
65
|
--_thumb-radius: max(calc(var(--_radius) - var(--_inset)), var(--slotted-radius-xs, 2px));
|
|
64
66
|
/**
|
|
65
67
|
* How long the thumb takes to cross. One step above the control's own
|
|
66
68
|
* interaction feedback, because a thing that travels needs longer than a
|
|
67
|
-
* thing that changes
|
|
69
|
+
* thing that changes color, and every value on the scale collapses to a
|
|
68
70
|
* single frame under `prefers-reduced-motion`.
|
|
69
71
|
*/
|
|
70
72
|
--_travel: var(--slotted-duration-medium);
|
|
71
73
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
74
|
+
/**
|
|
75
|
+
* A neutral track: the page's own ink at a low alpha rather than an opaque
|
|
76
|
+
* fill, so it darkens whatever it stands on — a surface, a sunken panel, a
|
|
77
|
+
* card header — by the same step, and reads as a recess in each. The edge
|
|
78
|
+
* keeps its width and is transparent by default, so the arithmetic below is
|
|
79
|
+
* the same with a theme's edge and without one. An accent track with an
|
|
80
|
+
* accent thumb edge was the first appearance: a colored outline on a row
|
|
81
|
+
* of neutral controls read as an alert before it read as a choice.
|
|
82
|
+
*/
|
|
83
|
+
background: var(
|
|
84
|
+
--slotted-segmented-control-background,
|
|
85
|
+
color-mix(in oklab, var(--slotted-text, CanvasText) 6%, transparent)
|
|
86
|
+
);
|
|
87
|
+
border: var(--_border-width) solid var(--slotted-segmented-control-border-color, transparent);
|
|
79
88
|
border-radius: var(--_radius);
|
|
80
|
-
box-shadow: var(--slotted-segmented-control-shadow,
|
|
89
|
+
box-shadow: var(--slotted-segmented-control-shadow, none);
|
|
81
90
|
box-sizing: border-box;
|
|
82
91
|
display: inline-grid;
|
|
83
92
|
font-family: var(--slotted-control-font-family, system-ui, sans-serif);
|
|
@@ -87,8 +96,15 @@
|
|
|
87
96
|
* sized grid resolves every track to the largest content contribution, so
|
|
88
97
|
* the rule Carbon states — base the width on the longest label, and give
|
|
89
98
|
* every segment that width — falls out of the layout.
|
|
99
|
+
*
|
|
100
|
+
* The column carries the segment's floor, and the segment none of its own:
|
|
101
|
+
* a segment with a minimum inside a column that could shrink below it ran
|
|
102
|
+
* past its column in a narrow container, while the thumb, a column wide,
|
|
103
|
+
* did not — the thumb and its segment no longer matched, and the label
|
|
104
|
+
* overflowed the track.
|
|
90
105
|
*/
|
|
91
|
-
|
|
106
|
+
gap: var(--_spacing);
|
|
107
|
+
grid-auto-columns: minmax(max(var(--_inner), var(--slotted-target-min, 24px)), 1fr);
|
|
92
108
|
grid-auto-flow: column;
|
|
93
109
|
isolation: isolate;
|
|
94
110
|
min-inline-size: 0;
|
|
@@ -96,13 +112,13 @@
|
|
|
96
112
|
position: relative;
|
|
97
113
|
}
|
|
98
114
|
|
|
99
|
-
[data-ui
|
|
115
|
+
[data-ui-segmented-control][data-part-root]:empty {
|
|
100
116
|
display: none;
|
|
101
117
|
}
|
|
102
118
|
|
|
103
119
|
/* ── Size ─────────────────────────────────────────────────────────────── */
|
|
104
120
|
|
|
105
|
-
[data-ui
|
|
121
|
+
[data-ui-segmented-control][data-part-root][data-size='sm'] {
|
|
106
122
|
--_height: var(--slotted-control-height-sm, 30px);
|
|
107
123
|
--_padding-inline: var(--slotted-control-padding-inline-sm, 10px);
|
|
108
124
|
--_font-size: var(--slotted-control-font-size-sm, 12px);
|
|
@@ -110,7 +126,7 @@
|
|
|
110
126
|
--_gap: var(--slotted-control-gap-sm, 6px);
|
|
111
127
|
}
|
|
112
128
|
|
|
113
|
-
[data-ui
|
|
129
|
+
[data-ui-segmented-control][data-part-root][data-size='lg'] {
|
|
114
130
|
--_height: var(--slotted-control-height-lg, 38px);
|
|
115
131
|
--_padding-inline: var(--slotted-control-padding-inline-lg, 16px);
|
|
116
132
|
--_font-size: var(--slotted-control-font-size-lg, 14px);
|
|
@@ -120,13 +136,13 @@
|
|
|
120
136
|
|
|
121
137
|
/* ── Orientation and width ────────────────────────────────────────────── */
|
|
122
138
|
|
|
123
|
-
[data-ui
|
|
139
|
+
[data-ui-segmented-control][data-part-root][data-orientation='vertical'] {
|
|
124
140
|
grid-auto-columns: auto;
|
|
125
141
|
grid-auto-flow: row;
|
|
126
142
|
grid-auto-rows: minmax(0, 1fr);
|
|
127
143
|
}
|
|
128
144
|
|
|
129
|
-
[data-ui
|
|
145
|
+
[data-ui-segmented-control][data-part-root][data-full-width] {
|
|
130
146
|
display: grid;
|
|
131
147
|
inline-size: 100%;
|
|
132
148
|
}
|
|
@@ -148,16 +164,27 @@
|
|
|
148
164
|
* words at a width it chose for itself is a question with no answer — it
|
|
149
165
|
* chose a width that fits them.
|
|
150
166
|
*/
|
|
151
|
-
[data-ui
|
|
167
|
+
[data-ui-segmented-control][data-part-root][data-condense='icons'] {
|
|
152
168
|
container-name: slotted-segmented-control;
|
|
153
169
|
container-type: inline-size;
|
|
154
170
|
display: grid;
|
|
155
171
|
inline-size: 100%;
|
|
156
172
|
}
|
|
157
173
|
|
|
174
|
+
/**
|
|
175
|
+
* A control told to condense to a column takes the width its parent gives,
|
|
176
|
+
* for the same reason: the binding compares that width with the width its
|
|
177
|
+
* labels need, and writes `data-orientation="vertical"` below it, which
|
|
178
|
+
* draws the column and moves the thumb on that axis.
|
|
179
|
+
*/
|
|
180
|
+
[data-ui-segmented-control][data-part-root][data-condense='vertical'] {
|
|
181
|
+
display: grid;
|
|
182
|
+
inline-size: 100%;
|
|
183
|
+
}
|
|
184
|
+
|
|
158
185
|
/* ── The segment ──────────────────────────────────────────────────────── */
|
|
159
186
|
|
|
160
|
-
[data-ui
|
|
187
|
+
[data-ui-segmented-control] [data-part-item] {
|
|
161
188
|
align-items: center;
|
|
162
189
|
block-size: var(--_inner);
|
|
163
190
|
border-radius: var(--_thumb-radius);
|
|
@@ -172,7 +199,10 @@
|
|
|
172
199
|
color: var(--slotted-segmented-control-color, var(--slotted-text, ButtonText));
|
|
173
200
|
cursor: pointer;
|
|
174
201
|
display: flex;
|
|
175
|
-
font-weight: var(
|
|
202
|
+
font-weight: var(
|
|
203
|
+
--slotted-segmented-control-font-weight,
|
|
204
|
+
var(--slotted-font-weight-medium, 500)
|
|
205
|
+
);
|
|
176
206
|
gap: var(--_gap);
|
|
177
207
|
justify-content: center;
|
|
178
208
|
letter-spacing: var(--slotted-control-letter-spacing, 0);
|
|
@@ -180,66 +210,95 @@
|
|
|
180
210
|
/**
|
|
181
211
|
* The thumb is shorter than the control it lives in, so at the smallest
|
|
182
212
|
* step and the tightest density it is eighteen pixels tall. The WCAG
|
|
183
|
-
* minimum is the floor across the segment, and the radio below
|
|
184
|
-
* track's own edge to meet it in the other axis.
|
|
213
|
+
* minimum is the column's floor across the segment, and the radio below
|
|
214
|
+
* reaches the track's own edge to meet it in the other axis.
|
|
185
215
|
*/
|
|
186
|
-
min-inline-size:
|
|
216
|
+
min-inline-size: 0;
|
|
187
217
|
padding-inline: var(--_padding-inline);
|
|
218
|
+
/**
|
|
219
|
+
* Positioned without a `z-index`: the segment paints after the thumb, which
|
|
220
|
+
* comes first in the DOM, so its words lie over the thumb, and its divider
|
|
221
|
+
* and its hover ground — pseudo-elements at `z-index: -1` — lie under it.
|
|
222
|
+
* A segment at `z-index: 1` lifted both over the thumb as well, and a thumb
|
|
223
|
+
* crossing a hovered segment or a divider lost part of its edge for the
|
|
224
|
+
* length of the slide.
|
|
225
|
+
*/
|
|
188
226
|
position: relative;
|
|
189
|
-
transition:
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
227
|
+
transition: color var(--slotted-control-transition-duration)
|
|
228
|
+
var(--slotted-control-transition-easing);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/** The hover and press ground, under the thumb; see the segment above. */
|
|
232
|
+
[data-ui-segmented-control] [data-part-item]::after {
|
|
233
|
+
background: transparent;
|
|
234
|
+
border-radius: inherit;
|
|
235
|
+
content: '';
|
|
236
|
+
inset: 0;
|
|
237
|
+
position: absolute;
|
|
238
|
+
transition: background-color var(--slotted-control-transition-duration)
|
|
239
|
+
var(--slotted-control-transition-easing);
|
|
240
|
+
z-index: -1;
|
|
195
241
|
}
|
|
196
242
|
|
|
197
243
|
/* An empty label is no label: a binding that always renders the span must
|
|
198
244
|
not leave a flex gap after the icon of a segment without words. */
|
|
199
|
-
[data-ui
|
|
245
|
+
[data-ui-segmented-control] [data-part-item]:not(:has([data-part-label]:not(:empty))) {
|
|
200
246
|
padding-inline: 0;
|
|
201
247
|
}
|
|
202
248
|
|
|
203
|
-
[data-ui
|
|
249
|
+
[data-ui-segmented-control] [data-part-label]:empty {
|
|
204
250
|
display: none;
|
|
205
251
|
}
|
|
206
252
|
|
|
207
253
|
/**
|
|
208
|
-
* ──
|
|
254
|
+
* ── Between two segments ──────────────────────────────────────────────
|
|
255
|
+
*
|
|
256
|
+
* Segments stand apart by the same step as the ring of track around them,
|
|
257
|
+
* so each one — its hover ground, the thumb on it — is a shape of its own
|
|
258
|
+
* on the track, and a rule in the middle of that room says the control is
|
|
259
|
+
* divided: a track of words with nothing between them reads as a sentence.
|
|
209
260
|
*
|
|
210
|
-
*
|
|
211
|
-
*
|
|
212
|
-
*
|
|
213
|
-
*
|
|
214
|
-
*
|
|
215
|
-
*
|
|
261
|
+
* The rule is centerd in the gap rather than on a segment's edge, half the
|
|
262
|
+
* segment's height, rounded at its ends, in a light tint of the ink rather
|
|
263
|
+
* than an opaque border color. It gives way wherever it would touch a
|
|
264
|
+
* shape: beside the thumb, and beside the segment under the pointer, whose
|
|
265
|
+
* ground would otherwise meet it. It lies under the thumb, so a thumb that
|
|
266
|
+
* crosses it while sliding passes over it.
|
|
216
267
|
*/
|
|
217
|
-
[data-ui
|
|
218
|
-
/* No system
|
|
268
|
+
[data-ui-segmented-control] [data-part-item] + [data-part-item]::before {
|
|
269
|
+
/* No system color behind it: an unthemed decoration disappears rather
|
|
219
270
|
than shouting, which is what `fallbacks.test.mjs` holds a pseudo-element
|
|
220
|
-
to.
|
|
221
|
-
|
|
222
|
-
|
|
271
|
+
to. In forced colors the thumb's own edge is what divides. */
|
|
272
|
+
background: var(
|
|
273
|
+
--slotted-segmented-control-divider-color,
|
|
274
|
+
color-mix(in oklab, var(--slotted-text) 14%, transparent)
|
|
275
|
+
);
|
|
276
|
+
border-radius: var(--slotted-radius-full, 9999px);
|
|
223
277
|
content: '';
|
|
224
278
|
inline-size: var(--_border-width);
|
|
225
|
-
inset-block:
|
|
226
|
-
inset-inline-start:
|
|
279
|
+
inset-block: 25%;
|
|
280
|
+
inset-inline-start: calc((var(--_spacing) + var(--_border-width)) / -2);
|
|
227
281
|
position: absolute;
|
|
228
282
|
transition: opacity var(--_travel) var(--slotted-easing-standard);
|
|
283
|
+
z-index: -1;
|
|
229
284
|
}
|
|
230
285
|
|
|
231
|
-
[data-ui
|
|
232
|
-
[data-part
|
|
233
|
-
+ [data-part
|
|
286
|
+
[data-ui-segmented-control][data-part-root][data-orientation='vertical']
|
|
287
|
+
[data-part-item]
|
|
288
|
+
+ [data-part-item]::before {
|
|
234
289
|
block-size: var(--_border-width);
|
|
235
290
|
inline-size: auto;
|
|
236
|
-
inset-block: auto;
|
|
237
|
-
inset-
|
|
238
|
-
inset-inline: 22%;
|
|
291
|
+
inset-block: calc((var(--_spacing) + var(--_border-width)) / -2) auto;
|
|
292
|
+
inset-inline: 25%;
|
|
239
293
|
}
|
|
240
294
|
|
|
241
|
-
[data-ui
|
|
242
|
-
[data-ui
|
|
295
|
+
[data-ui-segmented-control] [data-part-item][data-checked]::before,
|
|
296
|
+
[data-ui-segmented-control] [data-part-item][data-checked] + [data-part-item]::before,
|
|
297
|
+
[data-ui-segmented-control][data-part-root]:not([data-readonly])
|
|
298
|
+
[data-part-item]:hover:has([data-part-control]:enabled)::before,
|
|
299
|
+
[data-ui-segmented-control][data-part-root]:not([data-readonly])
|
|
300
|
+
[data-part-item]:hover:has([data-part-control]:enabled)
|
|
301
|
+
+ [data-part-item]::before {
|
|
243
302
|
opacity: 0;
|
|
244
303
|
}
|
|
245
304
|
|
|
@@ -250,21 +309,23 @@
|
|
|
250
309
|
* thumb's — which is what keeps the smallest step at the tightest density
|
|
251
310
|
* above the WCAG minimum.
|
|
252
311
|
*/
|
|
253
|
-
[data-ui
|
|
312
|
+
[data-ui-segmented-control] [data-part-control] {
|
|
254
313
|
appearance: none;
|
|
255
314
|
background: none;
|
|
256
315
|
border: 0;
|
|
257
316
|
border-radius: inherit;
|
|
258
317
|
cursor: inherit;
|
|
259
318
|
inset-block: calc(-1 * (var(--_inset) + var(--_border-width)));
|
|
260
|
-
|
|
319
|
+
/* Half the space on each side, so the room between two segments is not a
|
|
320
|
+
place a press lands on nothing. */
|
|
321
|
+
inset-inline: calc(var(--_spacing) / -2);
|
|
261
322
|
margin: 0;
|
|
262
323
|
opacity: 0;
|
|
263
324
|
padding: 0;
|
|
264
325
|
position: absolute;
|
|
265
326
|
}
|
|
266
327
|
|
|
267
|
-
[data-ui
|
|
328
|
+
[data-ui-segmented-control] [data-part-icon] {
|
|
268
329
|
block-size: var(--_icon-size);
|
|
269
330
|
display: inline-flex;
|
|
270
331
|
flex: none;
|
|
@@ -276,8 +337,13 @@
|
|
|
276
337
|
* narrow clips rather than wrapping the segment onto a second line. The
|
|
277
338
|
* string stays whole in the DOM: truncation never removes content.
|
|
278
339
|
*/
|
|
279
|
-
[data-ui
|
|
280
|
-
|
|
340
|
+
[data-ui-segmented-control] [data-part-label] {
|
|
341
|
+
/* Clipped along the line only: `hidden` on a one-line box cut the
|
|
342
|
+
descenders and the accents above the cap height. A clipped box is not a
|
|
343
|
+
scroll container, so the flex minimum is given back by hand, or the words
|
|
344
|
+
would hold their full width and run into the next segment. */
|
|
345
|
+
min-inline-size: 0;
|
|
346
|
+
overflow-x: clip;
|
|
281
347
|
text-overflow: ellipsis;
|
|
282
348
|
white-space: nowrap;
|
|
283
349
|
}
|
|
@@ -299,28 +365,41 @@
|
|
|
299
365
|
* The movement is the one thing in this family a reader's eye follows: it
|
|
300
366
|
* says which segment was left, which a fill appearing in a new place does
|
|
301
367
|
* not. It takes a step above the control's own transition, because a thing
|
|
302
|
-
* that travels needs longer than a thing that changes
|
|
368
|
+
* that travels needs longer than a thing that changes color, and the theme
|
|
303
369
|
* collapses every step to a single frame under `prefers-reduced-motion`.
|
|
304
370
|
*
|
|
305
371
|
* The thumb is absent while nothing is checked, so the first selection fades
|
|
306
372
|
* it in where it belongs rather than sliding it from an edge the reader has
|
|
307
373
|
* never seen — which is what Mantine does.
|
|
308
374
|
*/
|
|
309
|
-
[data-ui
|
|
375
|
+
[data-ui-segmented-control] [data-part-indicator] {
|
|
376
|
+
/* A raised surface with a hairline and the lightest elevation: the chosen
|
|
377
|
+
segment sits on the track rather than being painted into it. In a dark
|
|
378
|
+
scheme the raised surface is darker than the tinted track, and a thumb
|
|
379
|
+
darker than its track reads as a hole, so it takes a step of the ink. */
|
|
310
380
|
background: var(
|
|
311
381
|
--slotted-segmented-control-indicator-background,
|
|
312
|
-
|
|
382
|
+
light-dark(
|
|
383
|
+
var(--slotted-surface-raised, Canvas),
|
|
384
|
+
color-mix(
|
|
385
|
+
in oklab,
|
|
386
|
+
var(--slotted-text, CanvasText) 14%,
|
|
387
|
+
var(--slotted-surface-raised, Canvas)
|
|
388
|
+
)
|
|
389
|
+
)
|
|
313
390
|
);
|
|
314
391
|
block-size: calc(100% - var(--_inset) * 2);
|
|
315
392
|
border: var(--_border-width) solid
|
|
316
393
|
var(
|
|
317
394
|
--slotted-segmented-control-indicator-border-color,
|
|
318
|
-
var(--slotted-
|
|
395
|
+
color-mix(in oklab, var(--slotted-text, CanvasText) 10%, transparent)
|
|
319
396
|
);
|
|
320
397
|
border-radius: var(--_thumb-radius);
|
|
321
|
-
box-shadow: var(--slotted-control-shadow, none);
|
|
398
|
+
box-shadow: var(--slotted-segmented-control-indicator-shadow, var(--slotted-shadow-xs, none));
|
|
322
399
|
box-sizing: border-box;
|
|
323
|
-
inline-size: calc(
|
|
400
|
+
inline-size: calc(
|
|
401
|
+
(100% - var(--_inset) * 2 - var(--_spacing) * (var(--_count) - 1)) / var(--_count)
|
|
402
|
+
);
|
|
324
403
|
inset-block-start: var(--_inset);
|
|
325
404
|
inset-inline-start: var(--_inset);
|
|
326
405
|
pointer-events: none;
|
|
@@ -328,7 +407,7 @@
|
|
|
328
407
|
transition:
|
|
329
408
|
opacity var(--slotted-control-transition-duration) var(--slotted-easing-standard),
|
|
330
409
|
translate var(--_travel) var(--slotted-easing-standard);
|
|
331
|
-
translate: calc(var(--_index) * 100%);
|
|
410
|
+
translate: calc(var(--_index) * (100% + var(--_spacing)));
|
|
332
411
|
z-index: 0;
|
|
333
412
|
|
|
334
413
|
@starting-style {
|
|
@@ -336,15 +415,16 @@
|
|
|
336
415
|
}
|
|
337
416
|
}
|
|
338
417
|
|
|
339
|
-
[data-ui
|
|
340
|
-
translate: calc(var(--_index) * -100%);
|
|
418
|
+
[data-ui-segmented-control] [data-part-indicator]:dir(rtl) {
|
|
419
|
+
translate: calc(var(--_index) * (-100% - var(--_spacing)));
|
|
341
420
|
}
|
|
342
421
|
|
|
343
|
-
[data-ui
|
|
344
|
-
|
|
345
|
-
|
|
422
|
+
[data-ui-segmented-control][data-part-root][data-orientation='vertical'] [data-part-indicator] {
|
|
423
|
+
block-size: calc(
|
|
424
|
+
(100% - var(--_inset) * 2 - var(--_spacing) * (var(--_count) - 1)) / var(--_count)
|
|
425
|
+
);
|
|
346
426
|
inline-size: calc(100% - var(--_inset) * 2);
|
|
347
|
-
translate: 0 calc(var(--_index) * 100%);
|
|
427
|
+
translate: 0 calc(var(--_index) * (100% + var(--_spacing)));
|
|
348
428
|
}
|
|
349
429
|
|
|
350
430
|
/**
|
|
@@ -355,11 +435,8 @@
|
|
|
355
435
|
* was, because a label that thickens when it is chosen moves every label
|
|
356
436
|
* beside it.
|
|
357
437
|
*/
|
|
358
|
-
[data-ui
|
|
359
|
-
color: var(
|
|
360
|
-
--slotted-segmented-control-checked-color,
|
|
361
|
-
var(--slotted-tone-accent-text, HighlightText)
|
|
362
|
-
);
|
|
438
|
+
[data-ui-segmented-control] [data-part-item][data-checked] {
|
|
439
|
+
color: var(--slotted-segmented-control-checked-color, var(--slotted-text, CanvasText));
|
|
363
440
|
}
|
|
364
441
|
|
|
365
442
|
/* ── Hover and press, held back for every stronger state ──────────────── */
|
|
@@ -367,19 +444,19 @@
|
|
|
367
444
|
/**
|
|
368
445
|
* A segment that is not checked answers the pointer with a ground rather
|
|
369
446
|
* than with a shade of its own ink. Ink alone was the first attempt: with
|
|
370
|
-
* the unchecked label already at the page's own
|
|
447
|
+
* the unchecked label already at the page's own color there was nowhere
|
|
371
448
|
* darker for it to go, and a hover that changes nothing is a hover a reader
|
|
372
449
|
* cannot see. The ground is the neutral one, for the reason `button`
|
|
373
450
|
* records — a tinted hover on a row of choices reads as a row of status
|
|
374
451
|
* chips before it reads as one of them being pointed at.
|
|
375
452
|
*/
|
|
376
|
-
[data-ui
|
|
377
|
-
[data-part
|
|
378
|
-
[data-part
|
|
379
|
-
) {
|
|
453
|
+
[data-ui-segmented-control][data-part-root]:not([data-readonly])
|
|
454
|
+
[data-part-item]:hover:not([data-disabled]):not([data-checked]):has(
|
|
455
|
+
[data-part-control]:enabled
|
|
456
|
+
)::after {
|
|
380
457
|
background: var(
|
|
381
458
|
--slotted-segmented-control-hover-background,
|
|
382
|
-
var(--slotted-
|
|
459
|
+
color-mix(in oklab, var(--slotted-text) 5%, transparent)
|
|
383
460
|
);
|
|
384
461
|
}
|
|
385
462
|
|
|
@@ -388,13 +465,13 @@
|
|
|
388
465
|
* own pace, which is the rule every activating family here writes: the
|
|
389
466
|
* duration belongs to the state being entered.
|
|
390
467
|
*/
|
|
391
|
-
[data-ui
|
|
392
|
-
[data-part
|
|
393
|
-
[data-part
|
|
394
|
-
) {
|
|
468
|
+
[data-ui-segmented-control][data-part-root]:not([data-readonly])
|
|
469
|
+
[data-part-item]:active:not([data-disabled]):not([data-checked]):has(
|
|
470
|
+
[data-part-control]:enabled
|
|
471
|
+
)::after {
|
|
395
472
|
background: var(
|
|
396
473
|
--slotted-segmented-control-active-background,
|
|
397
|
-
var(--slotted-
|
|
474
|
+
color-mix(in oklab, var(--slotted-text) 9%, transparent)
|
|
398
475
|
);
|
|
399
476
|
transition-duration: var(--slotted-duration-instant);
|
|
400
477
|
}
|
|
@@ -404,7 +481,7 @@
|
|
|
404
481
|
/**
|
|
405
482
|
* The element holding focus is the radio, and the ring belongs around the
|
|
406
483
|
* segment. A family that moves its ring has to put out the one the browser
|
|
407
|
-
* draws where focus actually is, or it paints two rings in two
|
|
484
|
+
* draws where focus actually is, or it paints two rings in two colors —
|
|
408
485
|
* the rule `checkbox`, `switch` and `radio-group` each record.
|
|
409
486
|
*
|
|
410
487
|
* The ring is drawn *inside* the segment, with its outer edge on the
|
|
@@ -421,13 +498,13 @@
|
|
|
421
498
|
* it, so a segment that is both checked and focused shows one ring rather
|
|
422
499
|
* than a ring and a border a pixel apart.
|
|
423
500
|
*/
|
|
424
|
-
[data-ui
|
|
501
|
+
[data-ui-segmented-control] [data-part-item]:has([data-part-control]:focus-visible) {
|
|
425
502
|
outline: var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, Highlight);
|
|
426
503
|
outline-offset: calc(-1 * var(--slotted-focus-ring-width, 2px));
|
|
427
504
|
z-index: 2;
|
|
428
505
|
}
|
|
429
506
|
|
|
430
|
-
[data-ui
|
|
507
|
+
[data-ui-segmented-control] [data-part-control]:focus-visible {
|
|
431
508
|
outline: none;
|
|
432
509
|
}
|
|
433
510
|
|
|
@@ -436,9 +513,9 @@
|
|
|
436
513
|
/**
|
|
437
514
|
* The ring is retargeted on the element rather than repainted in every rule
|
|
438
515
|
* that draws one, which is what `--slotted-focus-ring-color-invalid` exists
|
|
439
|
-
* for and what keeps the outline and its shadow the same
|
|
516
|
+
* for and what keeps the outline and its shadow the same color.
|
|
440
517
|
*/
|
|
441
|
-
[data-ui
|
|
518
|
+
[data-ui-segmented-control][data-part-root][data-invalid] {
|
|
442
519
|
--slotted-focus-ring-color: var(
|
|
443
520
|
--slotted-segmented-control-invalid-focus-ring-color,
|
|
444
521
|
var(--slotted-focus-ring-color-invalid, Highlight)
|
|
@@ -449,7 +526,7 @@
|
|
|
449
526
|
var(--slotted-tone-danger-border, ButtonBorder)
|
|
450
527
|
);
|
|
451
528
|
/*
|
|
452
|
-
* Width as well as
|
|
529
|
+
* Width as well as color (WCAG 1.4.1), the edge `text-field` draws: in
|
|
453
530
|
* `high-contrast` the danger border is the resting edge's black. The line
|
|
454
531
|
* is a shadow inside the border, so neither the track nor a segment moves,
|
|
455
532
|
* and it takes the resting lift's place. Focus is the segment's ring, so
|
|
@@ -470,18 +547,18 @@
|
|
|
470
547
|
/* ── Read-only ────────────────────────────────────────────────────────── */
|
|
471
548
|
|
|
472
549
|
/**
|
|
473
|
-
* A read-only control keeps its
|
|
550
|
+
* A read-only control keeps its colors and loses its cursor: it is still
|
|
474
551
|
* legible, still focusable and still copyable, and it must not be mistaken
|
|
475
552
|
* for a disabled one — which is what `docs/component-features.md` §2.5 asks.
|
|
476
553
|
*/
|
|
477
|
-
[data-ui
|
|
478
|
-
[data-ui
|
|
554
|
+
[data-ui-segmented-control][data-part-root][data-readonly] [data-part-item],
|
|
555
|
+
[data-ui-segmented-control][data-part-root][data-readonly] [data-part-control] {
|
|
479
556
|
cursor: default;
|
|
480
557
|
}
|
|
481
558
|
|
|
482
559
|
/* ── Disabled ─────────────────────────────────────────────────────────── */
|
|
483
560
|
|
|
484
|
-
[data-ui
|
|
561
|
+
[data-ui-segmented-control] [data-part-item][data-disabled] {
|
|
485
562
|
color: var(
|
|
486
563
|
--slotted-segmented-control-disabled-color,
|
|
487
564
|
var(--slotted-disabled-foreground, GrayText)
|
|
@@ -489,26 +566,26 @@
|
|
|
489
566
|
cursor: default;
|
|
490
567
|
}
|
|
491
568
|
|
|
492
|
-
[data-ui
|
|
569
|
+
[data-ui-segmented-control] [data-part-control]:disabled {
|
|
493
570
|
cursor: default;
|
|
494
571
|
}
|
|
495
572
|
|
|
496
573
|
/**
|
|
497
574
|
* A whole control that is unavailable greys its edge and its words and keeps
|
|
498
575
|
* its track. Painting the track in the disabled ground as well was the first
|
|
499
|
-
* attempt, and it made the thumb the same
|
|
576
|
+
* attempt, and it made the thumb the same color as what it sits on: the
|
|
500
577
|
* reader could no longer tell which of the three had been chosen. The track
|
|
501
578
|
* is the ground the thumb is read against, so it is the one thing that has
|
|
502
579
|
* to stay.
|
|
503
580
|
*/
|
|
504
|
-
[data-ui
|
|
581
|
+
[data-ui-segmented-control][data-part-root][data-disabled] {
|
|
505
582
|
border-color: var(
|
|
506
583
|
--slotted-segmented-control-disabled-border-color,
|
|
507
584
|
var(--slotted-disabled-border, GrayText)
|
|
508
585
|
);
|
|
509
586
|
}
|
|
510
587
|
|
|
511
|
-
[data-ui
|
|
588
|
+
[data-ui-segmented-control][data-part-root][data-disabled] [data-part-indicator] {
|
|
512
589
|
background: var(
|
|
513
590
|
--slotted-segmented-control-disabled-indicator-background,
|
|
514
591
|
var(--slotted-disabled-background, ButtonFace)
|
|
@@ -524,12 +601,12 @@
|
|
|
524
601
|
* ── Underline ──────────────────────────────────────────────────────────
|
|
525
602
|
*
|
|
526
603
|
* The same radio group with no track: the words alone, sized to their own
|
|
527
|
-
* width, the chosen one in the text
|
|
528
|
-
* is muted and takes the text
|
|
604
|
+
* width, the chosen one in the text color and underlined. Every other word
|
|
605
|
+
* is muted and takes the text color under the pointer. No thumb, no
|
|
529
606
|
* dividers, no ground — the underline is the mark, and it sits under the
|
|
530
607
|
* word rather than on an edge of a box (R1).
|
|
531
608
|
*/
|
|
532
|
-
[data-ui
|
|
609
|
+
[data-ui-segmented-control][data-part-root][data-variant='underline'] {
|
|
533
610
|
--_inner: var(--_height);
|
|
534
611
|
|
|
535
612
|
background: none;
|
|
@@ -541,62 +618,63 @@
|
|
|
541
618
|
padding: 0;
|
|
542
619
|
}
|
|
543
620
|
|
|
544
|
-
[data-ui
|
|
545
|
-
[data-ui
|
|
546
|
-
[data-part
|
|
547
|
-
+ [data-part
|
|
621
|
+
[data-ui-segmented-control][data-part-root][data-variant='underline'] [data-part-indicator],
|
|
622
|
+
[data-ui-segmented-control][data-part-root][data-variant='underline']
|
|
623
|
+
[data-part-item]
|
|
624
|
+
+ [data-part-item]::before,
|
|
625
|
+
[data-ui-segmented-control][data-part-root][data-variant='underline'] [data-part-item]::after {
|
|
548
626
|
display: none;
|
|
549
627
|
}
|
|
550
628
|
|
|
551
|
-
[data-ui
|
|
629
|
+
[data-ui-segmented-control][data-part-root][data-variant='underline'] [data-part-item] {
|
|
552
630
|
color: var(--slotted-segmented-control-underline-color, var(--slotted-text-muted, GrayText));
|
|
553
631
|
font-weight: var(--slotted-font-weight-medium, 500);
|
|
554
632
|
min-inline-size: var(--slotted-target-min, 24px);
|
|
555
633
|
padding-inline: 0;
|
|
556
634
|
}
|
|
557
635
|
|
|
558
|
-
[data-ui
|
|
559
|
-
[data-part
|
|
636
|
+
[data-ui-segmented-control][data-part-root][data-variant='underline']
|
|
637
|
+
[data-part-item][data-checked] {
|
|
560
638
|
color: var(
|
|
561
639
|
--slotted-segmented-control-underline-checked-color,
|
|
562
640
|
var(--slotted-text, CanvasText)
|
|
563
641
|
);
|
|
564
642
|
}
|
|
565
643
|
|
|
566
|
-
[data-ui
|
|
567
|
-
[data-part
|
|
568
|
-
[data-part
|
|
644
|
+
[data-ui-segmented-control][data-part-root][data-variant='underline']
|
|
645
|
+
[data-part-item][data-checked]
|
|
646
|
+
[data-part-label] {
|
|
569
647
|
text-decoration-color: currentColor;
|
|
570
648
|
text-decoration-line: underline;
|
|
571
649
|
text-decoration-thickness: var(--slotted-border-width-thick, 2px);
|
|
572
650
|
text-underline-offset: 0.35em;
|
|
573
651
|
}
|
|
574
652
|
|
|
575
|
-
[data-ui
|
|
576
|
-
[data-part
|
|
577
|
-
[data-part
|
|
653
|
+
[data-ui-segmented-control][data-part-root][data-variant='underline'][data-invalid]
|
|
654
|
+
[data-part-item][data-checked]
|
|
655
|
+
[data-part-label] {
|
|
578
656
|
text-decoration-color: var(--slotted-tone-danger-border, CanvasText);
|
|
579
657
|
}
|
|
580
658
|
|
|
581
|
-
[data-ui
|
|
582
|
-
[data-part
|
|
583
|
-
[data-part
|
|
659
|
+
[data-ui-segmented-control][data-part-root][data-variant='underline']:not([data-readonly])
|
|
660
|
+
[data-part-item]:hover:not([data-disabled]):not([data-checked]):has(
|
|
661
|
+
[data-part-control]:enabled
|
|
584
662
|
),
|
|
585
|
-
[data-ui
|
|
586
|
-
[data-part
|
|
587
|
-
[data-part
|
|
663
|
+
[data-ui-segmented-control][data-part-root][data-variant='underline']:not([data-readonly])
|
|
664
|
+
[data-part-item]:active:not([data-disabled]):not([data-checked]):has(
|
|
665
|
+
[data-part-control]:enabled
|
|
588
666
|
) {
|
|
589
667
|
background: none;
|
|
590
668
|
color: var(--slotted-text, CanvasText);
|
|
591
669
|
}
|
|
592
670
|
|
|
593
|
-
[data-ui
|
|
594
|
-
[data-part
|
|
671
|
+
[data-ui-segmented-control][data-part-root][data-variant='underline']
|
|
672
|
+
[data-part-item]:has([data-part-control]:focus-visible) {
|
|
595
673
|
outline-offset: var(--slotted-focus-ring-offset, 2px);
|
|
596
674
|
}
|
|
597
675
|
|
|
598
|
-
[data-ui
|
|
599
|
-
[data-part
|
|
676
|
+
[data-ui-segmented-control][data-part-root][data-variant='underline']
|
|
677
|
+
[data-part-item][data-disabled] {
|
|
600
678
|
color: var(--slotted-disabled-foreground, GrayText);
|
|
601
679
|
}
|
|
602
680
|
|
|
@@ -613,9 +691,9 @@
|
|
|
613
691
|
* because `@container (max-inline-size: var(--x))` is invalid CSS.
|
|
614
692
|
*/
|
|
615
693
|
@container slotted-segmented-control (max-inline-size: 20rem) {
|
|
616
|
-
[data-ui
|
|
617
|
-
[data-part
|
|
618
|
-
[data-part
|
|
694
|
+
[data-ui-segmented-control][data-part-root][data-condense='icons']
|
|
695
|
+
[data-part-item]:has([data-part-icon])
|
|
696
|
+
[data-part-label] {
|
|
619
697
|
block-size: 1px;
|
|
620
698
|
clip-path: inset(50%);
|
|
621
699
|
inline-size: 1px;
|
|
@@ -624,19 +702,29 @@
|
|
|
624
702
|
white-space: nowrap;
|
|
625
703
|
}
|
|
626
704
|
|
|
627
|
-
[data-ui
|
|
628
|
-
[data-part
|
|
705
|
+
[data-ui-segmented-control][data-part-root][data-condense='icons']
|
|
706
|
+
[data-part-item]:has([data-part-icon]) {
|
|
629
707
|
padding-inline: 0;
|
|
630
708
|
}
|
|
631
709
|
}
|
|
632
710
|
|
|
633
711
|
/*
|
|
634
|
-
* Forced
|
|
712
|
+
* Forced colors remove every box shadow, and the edge with them. The width
|
|
635
713
|
* comes back as an outline inside the border; the
|
|
636
714
|
* ring belongs to a segment and leaves it alone.
|
|
637
715
|
*/
|
|
638
716
|
@media (forced-colors: active) {
|
|
639
|
-
|
|
717
|
+
/* The neutral track is a tint, and a tint flattens to Canvas: the edge
|
|
718
|
+
says where the control is, and the thumb's edge says which is chosen. */
|
|
719
|
+
[data-ui-segmented-control][data-part-root]:not([data-variant='underline']) {
|
|
720
|
+
border-color: ButtonBorder;
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
[data-ui-segmented-control] [data-part-indicator] {
|
|
724
|
+
border-color: Highlight;
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
[data-ui-segmented-control][data-part-root][data-invalid] {
|
|
640
728
|
outline: var(--_invalid-edge-width) solid CanvasText;
|
|
641
729
|
outline-offset: calc(-1 * (var(--_border-width) + var(--_invalid-edge-width)));
|
|
642
730
|
}
|