@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
package/src/button/button.css
CHANGED
|
@@ -13,14 +13,14 @@
|
|
|
13
13
|
*
|
|
14
14
|
* The tone roles travel through private properties because three variants
|
|
15
15
|
* paint the same roles differently; naming them once per tone is what keeps
|
|
16
|
-
* the variant rules from repeating five
|
|
16
|
+
* the variant rules from repeating five color maps each.
|
|
17
17
|
*
|
|
18
18
|
* Nothing in this sheet changes a size when a state changes. Every state is
|
|
19
|
-
* a
|
|
19
|
+
* a color; the only one drawn outside the border box is focus, which is an
|
|
20
20
|
* outline. The rebuild that preceded this one thickened the border on a
|
|
21
21
|
* pressed toggle, which moved every control beside it by two pixels.
|
|
22
22
|
*/
|
|
23
|
-
[data-ui
|
|
23
|
+
[data-ui-button] {
|
|
24
24
|
--_solid: var(--slotted-tone-accent-solid);
|
|
25
25
|
--_solid-hover: var(--slotted-tone-accent-solid-hover);
|
|
26
26
|
--_solid-active: var(--slotted-tone-accent-solid-active);
|
|
@@ -128,14 +128,14 @@
|
|
|
128
128
|
/* The press below moves the control, and the release eases it back. */ transform
|
|
129
129
|
var(--slotted-control-transition-duration) var(--slotted-control-transition-easing);
|
|
130
130
|
user-select: none;
|
|
131
|
-
/* A control written inside a sentence sits on the text's
|
|
131
|
+
/* A control written inside a sentence sits on the text's center, not on its baseline. */
|
|
132
132
|
vertical-align: middle;
|
|
133
133
|
-webkit-tap-highlight-color: transparent;
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
/* ── Tone: which of the five semantic
|
|
136
|
+
/* ── Tone: which of the five semantic colors the control speaks in ───── */
|
|
137
137
|
|
|
138
|
-
[data-ui
|
|
138
|
+
[data-ui-button][data-tone='secondary'] {
|
|
139
139
|
--_solid: var(--slotted-tone-secondary-solid);
|
|
140
140
|
--_solid-hover: var(--slotted-tone-secondary-solid-hover);
|
|
141
141
|
--_solid-active: var(--slotted-tone-secondary-solid-active);
|
|
@@ -163,7 +163,7 @@
|
|
|
163
163
|
* with the inverse text. A product that keeps the accent for data draws its
|
|
164
164
|
* primary action in it.
|
|
165
165
|
*/
|
|
166
|
-
[data-ui
|
|
166
|
+
[data-ui-button][data-tone='neutral'] {
|
|
167
167
|
--_solid: var(--slotted-tone-neutral-solid);
|
|
168
168
|
--_solid-hover: var(--slotted-tone-neutral-solid-hover);
|
|
169
169
|
--_solid-active: var(--slotted-tone-neutral-solid-active);
|
|
@@ -171,7 +171,7 @@
|
|
|
171
171
|
--_text: var(--slotted-tone-neutral-text);
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
-
[data-ui
|
|
174
|
+
[data-ui-button][data-tone='success'] {
|
|
175
175
|
--_solid: var(--slotted-tone-success-solid);
|
|
176
176
|
--_solid-hover: var(--slotted-tone-success-solid-hover);
|
|
177
177
|
--_solid-active: var(--slotted-tone-success-solid-active);
|
|
@@ -179,7 +179,15 @@
|
|
|
179
179
|
--_text: var(--slotted-tone-success-text);
|
|
180
180
|
}
|
|
181
181
|
|
|
182
|
-
[data-ui
|
|
182
|
+
[data-ui-button][data-tone='info'] {
|
|
183
|
+
--_solid: var(--slotted-tone-info-solid);
|
|
184
|
+
--_solid-hover: var(--slotted-tone-info-solid-hover);
|
|
185
|
+
--_solid-active: var(--slotted-tone-info-solid-active);
|
|
186
|
+
--_on-solid: var(--slotted-tone-info-on-solid);
|
|
187
|
+
--_text: var(--slotted-tone-info-text);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
[data-ui-button][data-tone='warning'] {
|
|
183
191
|
--_solid: var(--slotted-tone-warning-solid);
|
|
184
192
|
--_solid-hover: var(--slotted-tone-warning-solid-hover);
|
|
185
193
|
--_solid-active: var(--slotted-tone-warning-solid-active);
|
|
@@ -187,17 +195,22 @@
|
|
|
187
195
|
--_text: var(--slotted-tone-warning-text);
|
|
188
196
|
}
|
|
189
197
|
|
|
190
|
-
[data-ui
|
|
198
|
+
[data-ui-button][data-tone='danger'] {
|
|
191
199
|
--_solid: var(--slotted-tone-danger-solid);
|
|
192
200
|
--_solid-hover: var(--slotted-tone-danger-solid-hover);
|
|
193
201
|
--_solid-active: var(--slotted-tone-danger-solid-active);
|
|
194
202
|
--_on-solid: var(--slotted-tone-danger-on-solid);
|
|
195
203
|
--_text: var(--slotted-tone-danger-text);
|
|
204
|
+
/* A destructive action is the one bare control that leaves the neutral edge and ground. The
|
|
205
|
+
ground is the solid as a tint: a fixed dark step under the ink reads as a hole, not as danger. */
|
|
206
|
+
--_bare-edge: var(--slotted-tone-danger-border);
|
|
207
|
+
--_bare-hover: color-mix(in oklab, var(--slotted-tone-danger-solid) 12%, transparent);
|
|
208
|
+
--_bare-active: color-mix(in oklab, var(--slotted-tone-danger-solid) 20%, transparent);
|
|
196
209
|
}
|
|
197
210
|
|
|
198
211
|
/* ── Size: the control scale, one step of it per member instance ──────── */
|
|
199
212
|
|
|
200
|
-
[data-ui
|
|
213
|
+
[data-ui-button][data-size='sm'] {
|
|
201
214
|
--_height: var(--slotted-control-height-sm, 30px);
|
|
202
215
|
--_padding-inline: var(--slotted-control-padding-inline-sm, 10px);
|
|
203
216
|
--_font-size: var(--slotted-control-font-size-sm, 12px);
|
|
@@ -205,7 +218,7 @@
|
|
|
205
218
|
--_gap: var(--slotted-control-gap-sm, 6px);
|
|
206
219
|
}
|
|
207
220
|
|
|
208
|
-
[data-ui
|
|
221
|
+
[data-ui-button][data-size='lg'] {
|
|
209
222
|
--_height: var(--slotted-control-height-lg, 38px);
|
|
210
223
|
--_padding-inline: var(--slotted-control-padding-inline-lg, 16px);
|
|
211
224
|
--_font-size: var(--slotted-control-font-size-lg, 14px);
|
|
@@ -247,7 +260,7 @@
|
|
|
247
260
|
* sheet carried the shadow on the base rule for one release and every
|
|
248
261
|
* member inherited it, which is the defect this split exists to close.
|
|
249
262
|
*/
|
|
250
|
-
[data-ui
|
|
263
|
+
[data-ui-button][data-variant='solid'] {
|
|
251
264
|
background: var(--_solid, ButtonFace);
|
|
252
265
|
border-color: var(--_edge, ButtonBorder);
|
|
253
266
|
box-shadow: var(--slotted-control-shadow, none);
|
|
@@ -257,20 +270,20 @@
|
|
|
257
270
|
/**
|
|
258
271
|
* The edge of an outline button is neutral and its label carries the tone.
|
|
259
272
|
* A saturated border on all five tones turned a row of actions into a row
|
|
260
|
-
* of status chips: the eye read five different
|
|
273
|
+
* of status chips: the eye read five different colors of rectangle before
|
|
261
274
|
* it read a single word. The edge is the control step, the one a field
|
|
262
275
|
* carries at rest: reading `--slotted-border-strong` here made the outline
|
|
263
276
|
* button the darkest line on the form, and the foundation now keeps that
|
|
264
277
|
* step for the line between two surfaces.
|
|
265
278
|
*/
|
|
266
|
-
[data-ui
|
|
279
|
+
[data-ui-button][data-variant='outline'] {
|
|
267
280
|
background: transparent;
|
|
268
|
-
border-color: var(--slotted-control-border-color, ButtonBorder);
|
|
281
|
+
border-color: var(--_bare-edge, var(--slotted-control-border-color, ButtonBorder));
|
|
269
282
|
box-shadow: var(--slotted-control-shadow, none);
|
|
270
283
|
color: var(--_text, ButtonText);
|
|
271
284
|
}
|
|
272
285
|
|
|
273
|
-
[data-ui
|
|
286
|
+
[data-ui-button][data-variant='ghost'] {
|
|
274
287
|
background: transparent;
|
|
275
288
|
border-color: transparent;
|
|
276
289
|
color: var(--_text, ButtonText);
|
|
@@ -279,12 +292,12 @@
|
|
|
279
292
|
/**
|
|
280
293
|
* The half of the pair for a variant with no fill of its own. `secondary` is
|
|
281
294
|
* the third case for the same reason it is the exception to every other fill
|
|
282
|
-
* rule: its solid step is the page's own
|
|
295
|
+
* rule: its solid step is the page's own color, so it takes the band the way
|
|
283
296
|
* a bare control does.
|
|
284
297
|
*/
|
|
285
|
-
[data-ui
|
|
286
|
-
[data-ui
|
|
287
|
-
[data-ui
|
|
298
|
+
[data-ui-button][data-variant='outline'],
|
|
299
|
+
[data-ui-button][data-variant='ghost'],
|
|
300
|
+
[data-ui-button][data-variant='solid'][data-tone='secondary'] {
|
|
288
301
|
--_sweep-strength: 0.18;
|
|
289
302
|
}
|
|
290
303
|
|
|
@@ -294,7 +307,7 @@
|
|
|
294
307
|
* A toggle that is on is a selected thing, and it is painted the way every
|
|
295
308
|
* selected thing in the foundation is (R1): the accent selection ground
|
|
296
309
|
* under the accent text, inside the accent edge — whatever tone and variant
|
|
297
|
-
* the toggle was written as, because "on" is one
|
|
310
|
+
* the toggle was written as, because "on" is one color across the system
|
|
298
311
|
* and not a shade of each control's own. It took the tone's solid fill
|
|
299
312
|
* before this, which made a neutral toggle that was on the same rectangle
|
|
300
313
|
* as one being pressed (`#e2e8f0` for both in `light`) and made a toggle
|
|
@@ -306,7 +319,7 @@
|
|
|
306
319
|
* It sits above hover and below loading and disabled, which is the order
|
|
307
320
|
* `STATE_PRECEDENCE` sets.
|
|
308
321
|
*/
|
|
309
|
-
[data-ui
|
|
322
|
+
[data-ui-button][data-pressed]:not(:disabled):not([data-disabled]) {
|
|
310
323
|
background: var(--slotted-tone-accent-subtle-active, Highlight);
|
|
311
324
|
border-color: var(--slotted-tone-accent-border, Highlight);
|
|
312
325
|
/* A ghost toggle that is on has taken a fill and an edge, so it is a framed
|
|
@@ -340,13 +353,13 @@
|
|
|
340
353
|
* and nothing moves.
|
|
341
354
|
*/
|
|
342
355
|
|
|
343
|
-
[data-ui
|
|
356
|
+
[data-ui-button][data-variant='solid']:hover:not(:disabled):not([data-disabled]):not(
|
|
344
357
|
[data-loading]
|
|
345
358
|
):not([data-pressed]) {
|
|
346
359
|
background: var(--_solid-hover, Highlight);
|
|
347
360
|
}
|
|
348
361
|
|
|
349
|
-
[data-ui
|
|
362
|
+
[data-ui-button][data-variant='solid']:active:not(:disabled):not([data-disabled]):not(
|
|
350
363
|
[data-loading]
|
|
351
364
|
):not([data-pressed]) {
|
|
352
365
|
background: var(--_solid-active, Highlight);
|
|
@@ -355,22 +368,22 @@
|
|
|
355
368
|
transition-duration: var(--slotted-duration-instant);
|
|
356
369
|
}
|
|
357
370
|
|
|
358
|
-
[data-ui
|
|
371
|
+
[data-ui-button][data-variant='outline']:hover:not(:disabled):not([data-disabled]):not(
|
|
359
372
|
[data-loading]
|
|
360
373
|
):not([data-pressed]),
|
|
361
|
-
[data-ui
|
|
374
|
+
[data-ui-button][data-variant='ghost']:hover:not(:disabled):not([data-disabled]):not(
|
|
362
375
|
[data-loading]
|
|
363
376
|
):not([data-pressed]) {
|
|
364
|
-
background: var(--slotted-tone-secondary-subtle-hover, ButtonFace);
|
|
377
|
+
background: var(--_bare-hover, var(--slotted-tone-secondary-subtle-hover, ButtonFace));
|
|
365
378
|
}
|
|
366
379
|
|
|
367
|
-
[data-ui
|
|
380
|
+
[data-ui-button][data-variant='outline']:active:not(:disabled):not([data-disabled]):not(
|
|
368
381
|
[data-loading]
|
|
369
382
|
):not([data-pressed]),
|
|
370
|
-
[data-ui
|
|
383
|
+
[data-ui-button][data-variant='ghost']:active:not(:disabled):not([data-disabled]):not(
|
|
371
384
|
[data-loading]
|
|
372
385
|
):not([data-pressed]) {
|
|
373
|
-
background: var(--slotted-tone-secondary-subtle-active, ButtonFace);
|
|
386
|
+
background: var(--_bare-active, var(--slotted-tone-secondary-subtle-active, ButtonFace));
|
|
374
387
|
transition-duration: var(--slotted-duration-instant);
|
|
375
388
|
}
|
|
376
389
|
|
|
@@ -379,18 +392,18 @@
|
|
|
379
392
|
* ground's own hover step and never on the neutral one a toggle that is off
|
|
380
393
|
* hovers with — the two states share no surface in any of theirs.
|
|
381
394
|
*/
|
|
382
|
-
[data-ui
|
|
395
|
+
[data-ui-button][data-pressed]:hover:not(:disabled):not([data-disabled]):not([data-loading]) {
|
|
383
396
|
background: var(--slotted-tone-accent-subtle-hover, Highlight);
|
|
384
397
|
}
|
|
385
398
|
|
|
386
|
-
[data-ui
|
|
399
|
+
[data-ui-button][data-pressed]:active:not(:disabled):not([data-disabled]):not([data-loading]) {
|
|
387
400
|
background: var(--slotted-tone-accent-subtle-active, Highlight);
|
|
388
401
|
transition-duration: var(--slotted-duration-instant);
|
|
389
402
|
}
|
|
390
403
|
|
|
391
404
|
/* ── Focus ────────────────────────────────────────────────────────────── */
|
|
392
405
|
|
|
393
|
-
[data-ui
|
|
406
|
+
[data-ui-button]:focus-visible {
|
|
394
407
|
outline: var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, Highlight);
|
|
395
408
|
outline-offset: var(--slotted-focus-ring-offset, 2px);
|
|
396
409
|
}
|
|
@@ -400,7 +413,7 @@
|
|
|
400
413
|
*
|
|
401
414
|
* Per variant, because a flat control that fills with grey on the way to
|
|
402
415
|
* being unavailable reads as a different control rather than as the same
|
|
403
|
-
* one unavailable. A ghost button stays flat and loses only its
|
|
416
|
+
* one unavailable. A ghost button stays flat and loses only its color.
|
|
404
417
|
*
|
|
405
418
|
* `[data-disabled]` rather than `:disabled` alone, because a control that
|
|
406
419
|
* keeps its place in the tab sequence carries `aria-disabled` and no
|
|
@@ -408,8 +421,8 @@
|
|
|
408
421
|
* is always there.
|
|
409
422
|
*/
|
|
410
423
|
|
|
411
|
-
[data-ui
|
|
412
|
-
[data-ui
|
|
424
|
+
[data-ui-button]:disabled,
|
|
425
|
+
[data-ui-button][data-disabled] {
|
|
413
426
|
/* Nothing a person cannot reach is lifted off the page — the rule
|
|
414
427
|
`text-field` states for the same shadow. */
|
|
415
428
|
box-shadow: none;
|
|
@@ -417,8 +430,8 @@
|
|
|
417
430
|
cursor: not-allowed;
|
|
418
431
|
}
|
|
419
432
|
|
|
420
|
-
[data-ui
|
|
421
|
-
[data-ui
|
|
433
|
+
[data-ui-button][data-variant='solid']:disabled,
|
|
434
|
+
[data-ui-button][data-variant='solid'][data-disabled] {
|
|
422
435
|
background: var(--slotted-disabled-background, ButtonFace);
|
|
423
436
|
/**
|
|
424
437
|
* The disabled border rather than the disabled surface, because in the
|
|
@@ -428,8 +441,8 @@
|
|
|
428
441
|
border-color: var(--slotted-disabled-border, ButtonBorder);
|
|
429
442
|
}
|
|
430
443
|
|
|
431
|
-
[data-ui
|
|
432
|
-
[data-ui
|
|
444
|
+
[data-ui-button][data-variant='outline']:disabled,
|
|
445
|
+
[data-ui-button][data-variant='outline'][data-disabled] {
|
|
433
446
|
background: transparent;
|
|
434
447
|
border-color: var(--slotted-disabled-border, GrayText);
|
|
435
448
|
}
|
|
@@ -440,8 +453,8 @@
|
|
|
440
453
|
* is `aria-pressed`, which the platform announces whether or not the control
|
|
441
454
|
* can be operated.
|
|
442
455
|
*/
|
|
443
|
-
[data-ui
|
|
444
|
-
[data-ui
|
|
456
|
+
[data-ui-button][data-pressed]:disabled,
|
|
457
|
+
[data-ui-button][data-pressed][data-disabled] {
|
|
445
458
|
background: var(--slotted-disabled-background, ButtonFace);
|
|
446
459
|
border-color: var(--slotted-disabled-border, GrayText);
|
|
447
460
|
color: var(--slotted-disabled-foreground, GrayText);
|
|
@@ -469,18 +482,18 @@
|
|
|
469
482
|
* a natively disabled control keeps the disabled tokens above, and a ghost
|
|
470
483
|
* stays flat and takes only the text.
|
|
471
484
|
*/
|
|
472
|
-
[data-ui
|
|
485
|
+
[data-ui-button][data-disabled]:not(:disabled) {
|
|
473
486
|
color: var(--slotted-text-muted, GrayText);
|
|
474
487
|
}
|
|
475
488
|
|
|
476
|
-
[data-ui
|
|
477
|
-
[data-ui
|
|
489
|
+
[data-ui-button][data-variant='solid'][data-disabled]:not(:disabled),
|
|
490
|
+
[data-ui-button][data-pressed][data-disabled]:not(:disabled) {
|
|
478
491
|
background: var(--slotted-tone-secondary-subtle-hover, ButtonFace);
|
|
479
492
|
border-color: var(--slotted-border-subtle, GrayText);
|
|
480
493
|
color: var(--slotted-text-muted, GrayText);
|
|
481
494
|
}
|
|
482
495
|
|
|
483
|
-
[data-ui
|
|
496
|
+
[data-ui-button][data-variant='outline'][data-disabled]:not(:disabled) {
|
|
484
497
|
border-color: var(--slotted-border-subtle, GrayText);
|
|
485
498
|
}
|
|
486
499
|
|
|
@@ -496,7 +509,7 @@
|
|
|
496
509
|
* A control with a start or end visual keeps its label and gives the ring
|
|
497
510
|
* that one box: the wait is legible, the action stays readable, and the box
|
|
498
511
|
* was already the size of the ring. Primer takes the same decision, and it
|
|
499
|
-
* is the one that stops a loading button from being a
|
|
512
|
+
* is the one that stops a loading button from being a colored rectangle
|
|
500
513
|
* with nothing in it.
|
|
501
514
|
*
|
|
502
515
|
* A control with no visual has nowhere to put the ring but over its own
|
|
@@ -505,11 +518,11 @@
|
|
|
505
518
|
* supplies survives the wait and combines with the indicator's own.
|
|
506
519
|
*/
|
|
507
520
|
|
|
508
|
-
[data-ui
|
|
521
|
+
[data-ui-button][data-loading] {
|
|
509
522
|
cursor: progress;
|
|
510
523
|
}
|
|
511
524
|
|
|
512
|
-
[data-ui
|
|
525
|
+
[data-ui-button][data-loading]:has(> [data-part-indicator]) > :not([data-part-indicator]) {
|
|
513
526
|
opacity: 0;
|
|
514
527
|
}
|
|
515
528
|
|
|
@@ -518,16 +531,37 @@
|
|
|
518
531
|
* that waits. This family only says how big it is — the glyph box of its
|
|
519
532
|
* own step — and where it sits.
|
|
520
533
|
*/
|
|
521
|
-
[data-ui
|
|
534
|
+
[data-ui-button] [data-part-indicator] {
|
|
522
535
|
--slotted-spinner-size: var(--_icon-size);
|
|
523
536
|
|
|
524
537
|
flex: none;
|
|
525
538
|
}
|
|
526
539
|
|
|
540
|
+
/**
|
|
541
|
+
* The ring that stands in for a glyph takes the glyph's box. The glyph stays
|
|
542
|
+
* in the DOM, so the slot keeps its width, and is not drawn: the slot hides
|
|
543
|
+
* what it holds and the ring alone shows again. `IconButton` drew both side
|
|
544
|
+
* by side in a square of one glyph.
|
|
545
|
+
*/
|
|
546
|
+
[data-ui-button] [data-part-start]:has(> [data-part-indicator]),
|
|
547
|
+
[data-ui-button] [data-part-end]:has(> [data-part-indicator]),
|
|
548
|
+
[data-ui-button] [data-part-icon]:has(> [data-part-indicator]) {
|
|
549
|
+
visibility: hidden;
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
[data-ui-button] [data-part-start] > [data-part-indicator],
|
|
553
|
+
[data-ui-button] [data-part-end] > [data-part-indicator],
|
|
554
|
+
[data-ui-button] [data-part-icon] > [data-part-indicator] {
|
|
555
|
+
inset: 0;
|
|
556
|
+
margin: auto;
|
|
557
|
+
position: absolute;
|
|
558
|
+
visibility: visible;
|
|
559
|
+
}
|
|
560
|
+
|
|
527
561
|
/* Only the ring that has no visual slot to sit in is placed against the box. */
|
|
528
|
-
[data-ui
|
|
562
|
+
[data-ui-button] > [data-part-indicator] {
|
|
529
563
|
inset: 0;
|
|
530
|
-
/* `inset: 0` with a definite size and automatic margins
|
|
564
|
+
/* `inset: 0` with a definite size and automatic margins centers on both
|
|
531
565
|
axes without naming a physical side. */
|
|
532
566
|
margin: auto;
|
|
533
567
|
position: absolute;
|
|
@@ -559,12 +593,12 @@
|
|
|
559
593
|
* `currentColor` is what makes the band answer every tone and every variant
|
|
560
594
|
* without a token of its own: it is the ink the control is already painting
|
|
561
595
|
* its own label with, so it contrasts with that control's ground by
|
|
562
|
-
* construction — the on-tone
|
|
596
|
+
* construction — the on-tone color over a filled one, the tone itself over
|
|
563
597
|
* a bare one, and whatever the scheme remapped either to.
|
|
564
598
|
*/
|
|
565
599
|
@media (prefers-reduced-motion: no-preference) {
|
|
566
600
|
@media not (forced-colors: active) {
|
|
567
|
-
[data-ui
|
|
601
|
+
[data-ui-button]:not([data-shape])[data-loading]:has([data-part-indicator])::after {
|
|
568
602
|
/**
|
|
569
603
|
* The tile is crossed once per cycle, so the pair sets the speed the
|
|
570
604
|
* band travels rather than the time it takes: two heights per loop
|
|
@@ -588,19 +622,17 @@
|
|
|
588
622
|
* A band that travels against the reading direction reads as undoing
|
|
589
623
|
* rather than as progressing, so it is mirrored rather than reused.
|
|
590
624
|
*/
|
|
591
|
-
[data-ui
|
|
592
|
-
rtl
|
|
593
|
-
)::after {
|
|
625
|
+
[data-ui-button]:not([data-shape])[data-loading]:has([data-part-indicator]):dir(rtl)::after {
|
|
594
626
|
animation-direction: reverse;
|
|
595
627
|
background-image: linear-gradient(to left, transparent, currentColor 40%, transparent 80%);
|
|
596
628
|
}
|
|
597
629
|
|
|
598
|
-
[data-ui
|
|
599
|
-
> :not([data-part
|
|
630
|
+
[data-ui-button]:not([data-shape])[data-loading]:has(> [data-part-indicator])
|
|
631
|
+
> :not([data-part-indicator]) {
|
|
600
632
|
opacity: 1;
|
|
601
633
|
}
|
|
602
634
|
|
|
603
|
-
[data-ui
|
|
635
|
+
[data-ui-button]:not([data-shape])[data-loading] [data-part-indicator] {
|
|
604
636
|
opacity: 0;
|
|
605
637
|
position: absolute;
|
|
606
638
|
}
|
|
@@ -609,9 +641,9 @@
|
|
|
609
641
|
|
|
610
642
|
/* ── Parts ────────────────────────────────────────────────────────────── */
|
|
611
643
|
|
|
612
|
-
[data-ui
|
|
613
|
-
[data-ui
|
|
614
|
-
[data-ui
|
|
644
|
+
[data-ui-button] [data-part-start],
|
|
645
|
+
[data-ui-button] [data-part-end],
|
|
646
|
+
[data-ui-button] [data-part-icon] {
|
|
615
647
|
align-items: center;
|
|
616
648
|
block-size: var(--_icon-size);
|
|
617
649
|
box-sizing: border-box;
|
|
@@ -625,40 +657,61 @@
|
|
|
625
657
|
position: relative;
|
|
626
658
|
}
|
|
627
659
|
|
|
628
|
-
[data-ui
|
|
629
|
-
[data-ui
|
|
630
|
-
[data-ui
|
|
660
|
+
[data-ui-button] [data-part-start] > *:not([data-part-indicator], [data-ui-kbd]),
|
|
661
|
+
[data-ui-button] [data-part-end] > *:not([data-part-indicator], [data-ui-kbd]),
|
|
662
|
+
[data-ui-button] [data-part-icon] > *:not([data-part-indicator]) {
|
|
631
663
|
block-size: 100%;
|
|
632
664
|
display: block;
|
|
633
665
|
inline-size: 100%;
|
|
634
666
|
}
|
|
635
667
|
|
|
636
668
|
/**
|
|
637
|
-
*
|
|
638
|
-
*
|
|
639
|
-
*
|
|
669
|
+
* A key in a slot is sized by its own family. The slot above is a glyph's
|
|
670
|
+
* box: it stated `display: block` on the key, which put the legend on a line
|
|
671
|
+
* box's baseline instead of the key's center, sixteen pixels square, and the
|
|
672
|
+
* icon's font size, which `size="inherit"` read as the text's. Measured, a
|
|
673
|
+
* `Kbd` legend stood 1.5px above the label's center and a `Shortcut` 1.5px
|
|
674
|
+
* below it. Here the slot takes the key's measure and the label's type, and
|
|
675
|
+
* the flex container centers the key on the label.
|
|
640
676
|
*/
|
|
641
|
-
[data-ui
|
|
677
|
+
[data-ui-button] :is([data-part-start], [data-part-end]):has(> [data-ui-kbd]) {
|
|
678
|
+
block-size: auto;
|
|
679
|
+
font-size: inherit;
|
|
680
|
+
inline-size: auto;
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
/**
|
|
684
|
+
* The label is one line at its own width. It broke anywhere once, which made
|
|
685
|
+
* a button in a row as narrow as one letter: squeezed, "Corrigir" became
|
|
686
|
+
* three lines and broke inside the word. A row of buttons now overflows, or
|
|
687
|
+
* a toolbar folds what does not fit; a control held narrower than its label
|
|
688
|
+
* by its container — `max-inline-size: 100%` — cuts the label with an
|
|
689
|
+
* ellipsis rather than spilling it past the border. The line height is the
|
|
690
|
+
* text step's, which the trim below reads.
|
|
691
|
+
*/
|
|
692
|
+
[data-ui-button] [data-part-label] {
|
|
642
693
|
line-height: var(--slotted-line-height-sm, 1.45);
|
|
643
694
|
min-inline-size: 0;
|
|
644
|
-
overflow
|
|
695
|
+
overflow: hidden;
|
|
696
|
+
text-overflow: ellipsis;
|
|
697
|
+
white-space: nowrap;
|
|
645
698
|
}
|
|
646
699
|
|
|
647
700
|
/**
|
|
648
|
-
* A flex container
|
|
701
|
+
* A flex container centers the line box, and a line box is not symmetric
|
|
649
702
|
* around the letters inside it. Measured on this family, the word sat 1.2
|
|
650
|
-
* pixels above the
|
|
703
|
+
* pixels above the center of the glyph beside it at every step of every
|
|
651
704
|
* density except the two where the rounding of the font size made it 0.92
|
|
652
|
-
* and 0.16 — the label and the icon were
|
|
705
|
+
* and 0.16 — the label and the icon were centerd against different things.
|
|
653
706
|
* `text-box` trims the line to the cap and the baseline, so what the flex
|
|
654
|
-
* container
|
|
707
|
+
* container centers is the ink, and the offset is 0 everywhere.
|
|
655
708
|
*
|
|
656
709
|
* The trim is paid for rather than taken. Trimming a label that wraps also
|
|
657
710
|
* takes the half-leading off the top and bottom of the whole block, which is
|
|
658
711
|
* the only thing keeping a wrapped word off the border — measured, a
|
|
659
712
|
* two-line control lost 8.39 pixels of height and its descenders fell two
|
|
660
713
|
* pixels below the edge. The padding gives that leading back symmetrically,
|
|
661
|
-
* so the ink stays
|
|
714
|
+
* so the ink stays centerd and the control is the height it was: 36.77
|
|
662
715
|
* pixels against 36.78 for the same two lines.
|
|
663
716
|
*
|
|
664
717
|
* Both terms are proportions of the type rather than steps of a scale.
|
|
@@ -669,9 +722,9 @@
|
|
|
669
722
|
* of a pixel, which is the only thing the term governs.
|
|
670
723
|
*/
|
|
671
724
|
@supports (text-box: trim-both cap alphabetic) {
|
|
672
|
-
[data-ui
|
|
725
|
+
[data-ui-button] [data-part-label] {
|
|
673
726
|
padding-block: calc((var(--slotted-line-height-sm, 1.45) * 1em - 0.75em) / 2);
|
|
674
|
-
text-box: trim-both cap alphabetic;
|
|
727
|
+
text-box: trim-both var(--slotted-text-box-edge, cap alphabetic);
|
|
675
728
|
}
|
|
676
729
|
}
|
|
677
730
|
|
|
@@ -680,40 +733,159 @@
|
|
|
680
733
|
* letter. An icon-only control is exempt, because both of its sides hold
|
|
681
734
|
* the same glyph and its inset is zero.
|
|
682
735
|
*/
|
|
683
|
-
[data-ui
|
|
736
|
+
[data-ui-button]:not([data-shape]):has(> [data-part-start]) {
|
|
684
737
|
padding-inline-start: var(--_padding-inline-visual);
|
|
685
738
|
}
|
|
686
739
|
|
|
687
|
-
[data-ui
|
|
740
|
+
[data-ui-button]:not([data-shape]):has(> [data-part-end]) {
|
|
688
741
|
padding-inline-end: var(--_padding-inline-visual);
|
|
689
742
|
}
|
|
690
743
|
|
|
691
744
|
/* ── Inline size ──────────────────────────────────────────────────────── */
|
|
692
745
|
|
|
693
|
-
[data-ui
|
|
746
|
+
[data-ui-button][data-full-width] {
|
|
694
747
|
inline-size: 100%;
|
|
695
748
|
}
|
|
696
749
|
|
|
750
|
+
/**
|
|
751
|
+
* ── Flush ──────────────────────────────────────────────────────────────
|
|
752
|
+
*
|
|
753
|
+
* A boxless button as the first line of a stacked cell: its label starts
|
|
754
|
+
* one inset after the line under it. `flush` pulls the button out by its own
|
|
755
|
+
* inset and edge on the stated side, so the label stands on the edge of the
|
|
756
|
+
* text around it and the hover ground, the target and the focus ring extend
|
|
757
|
+
* past that edge. The inset is the one in force: the glyph side's when a
|
|
758
|
+
* slot holds one.
|
|
759
|
+
*/
|
|
760
|
+
[data-ui-button]:not([data-shape], [data-inline]):is([data-flush='start'], [data-flush='both']) {
|
|
761
|
+
margin-inline-start: calc(
|
|
762
|
+
-1 * (var(--_padding-inline) + var(--slotted-control-border-width, 1px))
|
|
763
|
+
);
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
[data-ui-button]:not([data-shape], [data-inline]):is([data-flush='end'], [data-flush='both']) {
|
|
767
|
+
margin-inline-end: calc(
|
|
768
|
+
-1 * (var(--_padding-inline) + var(--slotted-control-border-width, 1px))
|
|
769
|
+
);
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
[data-ui-button]:not([data-shape], [data-inline]):is(
|
|
773
|
+
[data-flush='start'],
|
|
774
|
+
[data-flush='both']
|
|
775
|
+
):has(> [data-part-start]) {
|
|
776
|
+
margin-inline-start: calc(
|
|
777
|
+
-1 * (var(--_padding-inline-visual) + var(--slotted-control-border-width, 1px))
|
|
778
|
+
);
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
[data-ui-button]:not([data-shape], [data-inline]):is([data-flush='end'], [data-flush='both']):has(
|
|
782
|
+
> [data-part-end]
|
|
783
|
+
) {
|
|
784
|
+
margin-inline-end: calc(
|
|
785
|
+
-1 * (var(--_padding-inline-visual) + var(--slotted-control-border-width, 1px))
|
|
786
|
+
);
|
|
787
|
+
}
|
|
788
|
+
|
|
697
789
|
/**
|
|
698
790
|
* A field trigger: the label at the start and `end` at the inline end. The
|
|
699
791
|
* label takes the free space, so `start` stays beside it and the end slot is
|
|
700
792
|
* pushed to the edge; flex follows the writing direction, so it mirrors.
|
|
701
793
|
*/
|
|
702
|
-
[data-ui
|
|
794
|
+
[data-ui-button][data-justify='between'] {
|
|
703
795
|
justify-content: space-between;
|
|
704
796
|
}
|
|
705
797
|
|
|
706
|
-
[data-ui
|
|
798
|
+
[data-ui-button][data-justify='between'] > [data-part-label] {
|
|
707
799
|
flex: 1 1 auto;
|
|
708
800
|
text-align: start;
|
|
709
801
|
}
|
|
710
802
|
|
|
711
803
|
/* What a trigger holds at its end — a shortcut, a count — is as wide as it is. */
|
|
712
|
-
[data-ui
|
|
804
|
+
[data-ui-button][data-justify='between'] > [data-part-end] {
|
|
713
805
|
inline-size: auto;
|
|
714
806
|
min-inline-size: var(--_icon-size);
|
|
715
807
|
}
|
|
716
808
|
|
|
809
|
+
/**
|
|
810
|
+
* ── Widest ─────────────────────────────────────────────────────────────
|
|
811
|
+
*
|
|
812
|
+
* `widest` reserves the width of the whole content with the widest text the
|
|
813
|
+
* label can show, so a stepper's arrow stays under the pointer as the label
|
|
814
|
+
* changes. The control is a grid of one row: the start slot, the label and
|
|
815
|
+
* the end slot at their own widths, between two tracks that share the room
|
|
816
|
+
* left over, so what is visible is centered whatever is missing. `::before`
|
|
817
|
+
* crosses every track and gives the row its width: the texts from an
|
|
818
|
+
* attribute, one per line, with no height and no paint, so out of the
|
|
819
|
+
* accessible name and of the text content, and the room of a start and an
|
|
820
|
+
* end that are part of the control. A start that renders nothing is drawn at
|
|
821
|
+
* no width and stays in that room.
|
|
822
|
+
*
|
|
823
|
+
* shortcut: a slot wider than its icon box (a key) is reserved at the icon's
|
|
824
|
+
* width, reserve its own measure when a stepper holds one.
|
|
825
|
+
*/
|
|
826
|
+
[data-ui-button][data-widest] {
|
|
827
|
+
--_reserve-start: 0px;
|
|
828
|
+
--_reserve-end: 0px;
|
|
829
|
+
|
|
830
|
+
column-gap: 0;
|
|
831
|
+
display: inline-grid;
|
|
832
|
+
font-variant-numeric: tabular-nums;
|
|
833
|
+
grid-template-columns: minmax(0, 1fr) auto minmax(0, auto) auto minmax(0, 1fr);
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
[data-ui-button][data-widest]:has(> [data-part-start]) {
|
|
837
|
+
--_reserve-start: calc(var(--slotted-button-widest-start, var(--_icon-size)) + var(--_gap));
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
[data-ui-button][data-widest]:has(> [data-part-end]) {
|
|
841
|
+
--_reserve-end: calc(var(--_icon-size) + var(--_gap));
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
[data-ui-button][data-widest][data-justify='between'] {
|
|
845
|
+
grid-template-columns: 0 auto minmax(0, 1fr) auto 0;
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
/* One inset on both sides: the smaller one beside a glyph would move the center. */
|
|
849
|
+
[data-ui-button][data-widest]:not([data-shape], [data-inline]) {
|
|
850
|
+
padding-inline: var(--_padding-inline);
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
[data-ui-button][data-widest]::before {
|
|
854
|
+
block-size: 0;
|
|
855
|
+
box-sizing: border-box;
|
|
856
|
+
content: attr(data-widest);
|
|
857
|
+
grid-area: 1 / 1 / 2 / -1;
|
|
858
|
+
min-inline-size: 0;
|
|
859
|
+
overflow: hidden;
|
|
860
|
+
padding-inline: var(--_reserve-start) var(--_reserve-end);
|
|
861
|
+
visibility: hidden;
|
|
862
|
+
white-space: pre;
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
[data-ui-button][data-widest] > [data-part-start] {
|
|
866
|
+
grid-area: 1 / 2;
|
|
867
|
+
margin-inline-end: var(--_gap);
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
/* As wide as the mark it holds, up to the glyph's box, so the group starts where the mark does. */
|
|
871
|
+
[data-ui-button][data-widest] > [data-part-start]:not(:has(> [data-ui-kbd])) {
|
|
872
|
+
inline-size: fit-content;
|
|
873
|
+
max-inline-size: var(--_icon-size);
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
[data-ui-button][data-widest] > [data-part-start]:empty {
|
|
877
|
+
display: none;
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
[data-ui-button][data-widest] > [data-part-label] {
|
|
881
|
+
grid-area: 1 / 3;
|
|
882
|
+
}
|
|
883
|
+
|
|
884
|
+
[data-ui-button][data-widest] > [data-part-end] {
|
|
885
|
+
grid-area: 1 / 4;
|
|
886
|
+
margin-inline-start: var(--_gap);
|
|
887
|
+
}
|
|
888
|
+
|
|
717
889
|
/**
|
|
718
890
|
* An icon-only control is square from the control height, so its visual box
|
|
719
891
|
* and its target are the same box. The two minimums are the WCAG 2.2 floor
|
|
@@ -721,7 +893,7 @@
|
|
|
721
893
|
* small in one axis is the family's to correct, and theme validation only
|
|
722
894
|
* guarantees the block axis.
|
|
723
895
|
*/
|
|
724
|
-
[data-ui
|
|
896
|
+
[data-ui-button][data-shape] {
|
|
725
897
|
aspect-ratio: 1;
|
|
726
898
|
inline-size: var(--_height);
|
|
727
899
|
min-block-size: max(var(--_height), var(--slotted-target-min, 24px));
|
|
@@ -730,12 +902,155 @@
|
|
|
730
902
|
padding-inline: 0;
|
|
731
903
|
}
|
|
732
904
|
|
|
733
|
-
[data-ui
|
|
905
|
+
[data-ui-button][data-shape='circle'] {
|
|
734
906
|
border-radius: var(--slotted-radius-full, 9999px);
|
|
735
907
|
}
|
|
736
908
|
|
|
737
909
|
/**
|
|
738
|
-
*
|
|
910
|
+
* A text action inside a line — "show details" in a sentence, "split" in a
|
|
911
|
+
* dense table cell — is a word of that line. It takes the font, weight and
|
|
912
|
+
* line height around it, or the step of the text scale its `size` names, draws
|
|
913
|
+
* no box in any variant, stands on the baseline and is underlined in its tone's
|
|
914
|
+
* text color, so the row keeps its height and the word lines up with its
|
|
915
|
+
* neighbours. WCAG 2.5.8 exempts a target inside a sentence from the 24px
|
|
916
|
+
* minimum.
|
|
917
|
+
*/
|
|
918
|
+
[data-ui-button][data-inline]:not([data-shape]) {
|
|
919
|
+
background: transparent;
|
|
920
|
+
border-color: transparent;
|
|
921
|
+
border-radius: var(--slotted-radius-sm, 2px);
|
|
922
|
+
border-width: 0;
|
|
923
|
+
box-shadow: none;
|
|
924
|
+
color: var(--_text, LinkText);
|
|
925
|
+
font: inherit;
|
|
926
|
+
gap: 0.25em;
|
|
927
|
+
min-block-size: 0;
|
|
928
|
+
padding-inline: 0;
|
|
929
|
+
text-decoration-line: underline;
|
|
930
|
+
text-decoration-thickness: from-font;
|
|
931
|
+
text-underline-offset: 0.2em;
|
|
932
|
+
vertical-align: baseline;
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
/* The root writes no size of its own here: only one the consumer stated. */
|
|
936
|
+
[data-ui-button][data-inline]:not([data-shape])[data-size='sm'] {
|
|
937
|
+
font-size: var(--slotted-font-size-sm, 0.8125rem);
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
[data-ui-button][data-inline]:not([data-shape])[data-size='md'] {
|
|
941
|
+
font-size: var(--slotted-font-size-md, 0.875rem);
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
[data-ui-button][data-inline]:not([data-shape])[data-size='lg'] {
|
|
945
|
+
font-size: var(--slotted-font-size-lg, 1rem);
|
|
946
|
+
}
|
|
947
|
+
|
|
948
|
+
[data-ui-button][data-inline]:not([data-shape]) [data-part-label] {
|
|
949
|
+
line-height: inherit;
|
|
950
|
+
padding-block: 0;
|
|
951
|
+
text-box: normal;
|
|
952
|
+
}
|
|
953
|
+
|
|
954
|
+
[data-ui-button][data-inline]:not([data-shape]):hover:not(:disabled):not([data-disabled]):not(
|
|
955
|
+
[data-loading]
|
|
956
|
+
):not([data-pressed]),
|
|
957
|
+
[data-ui-button][data-inline]:not([data-shape]):active:not(:disabled):not([data-disabled]):not(
|
|
958
|
+
[data-loading]
|
|
959
|
+
):not([data-pressed]) {
|
|
960
|
+
background: transparent;
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
[data-ui-button][data-inline]:not([data-shape]):disabled,
|
|
964
|
+
[data-ui-button][data-inline]:not([data-shape])[data-disabled] {
|
|
965
|
+
color: var(--slotted-disabled-foreground, GrayText);
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
/**
|
|
969
|
+
* An icon-only control inside a line of text — a help trigger beside a term
|
|
970
|
+
* — is a mark on the capital beside it. The icon is the capital height
|
|
971
|
+
* rounded to a pixel and two pixels more at each end, and it hangs those two
|
|
972
|
+
* below the baseline: text and icon snap to the pixel grid each on its own,
|
|
973
|
+
* and an icon a whole even number of pixels taller than the capital snaps
|
|
974
|
+
* with it wherever the line stands.
|
|
975
|
+
*
|
|
976
|
+
* The icon's box is the capital alone and the two pixels hang outside it, so
|
|
977
|
+
* the control's baseline is the text's in a line and in a flex row that aligns
|
|
978
|
+
* baselines. The ground is one line tall; margins take back what of it passes
|
|
979
|
+
* the capital, so the line keeps its height. A pseudo-element outside layout
|
|
980
|
+
* keeps the target at the WCAG 2.2 minimum.
|
|
981
|
+
*/
|
|
982
|
+
[data-ui-button][data-shape][data-inline] {
|
|
983
|
+
--_capital: round(1cap, 1px);
|
|
984
|
+
block-size: 1lh;
|
|
985
|
+
font: inherit;
|
|
986
|
+
inline-size: 1lh;
|
|
987
|
+
margin-block: calc((var(--_capital) - 1lh) / 2);
|
|
988
|
+
margin-inline-start: 0.25em;
|
|
989
|
+
min-block-size: 0;
|
|
990
|
+
min-inline-size: 0;
|
|
991
|
+
position: relative;
|
|
992
|
+
vertical-align: baseline;
|
|
993
|
+
}
|
|
994
|
+
|
|
995
|
+
[data-ui-button][data-shape][data-inline] [data-part-icon] {
|
|
996
|
+
--_icon-size: calc(var(--_capital) + 4px);
|
|
997
|
+
block-size: var(--_capital);
|
|
998
|
+
font-size: inherit;
|
|
999
|
+
inline-size: var(--_capital);
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
[data-ui-button][data-shape][data-inline] [data-part-icon] > *:not([data-part-indicator]) {
|
|
1003
|
+
block-size: calc(100% + 4px);
|
|
1004
|
+
inline-size: calc(100% + 4px);
|
|
1005
|
+
inset-block-start: -2px;
|
|
1006
|
+
inset-inline-start: -2px;
|
|
1007
|
+
position: absolute;
|
|
1008
|
+
}
|
|
1009
|
+
|
|
1010
|
+
[data-ui-button][data-shape][data-inline]::before {
|
|
1011
|
+
content: '';
|
|
1012
|
+
/* Measured from the padding edge, so the border is taken back as well. */
|
|
1013
|
+
inset: calc(
|
|
1014
|
+
min(0px, (1lh - var(--slotted-target-min, 24px)) / 2) -
|
|
1015
|
+
var(--slotted-control-border-width, 1px)
|
|
1016
|
+
);
|
|
1017
|
+
position: absolute;
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1020
|
+
/**
|
|
1021
|
+
* In ghost it is a mark on the text rather than a control beside it: no
|
|
1022
|
+
* ground under the pointer. In the secondary tone it is quieter than the
|
|
1023
|
+
* term it explains, and takes the text color while it is being read.
|
|
1024
|
+
*/
|
|
1025
|
+
[data-ui-button][data-shape][data-inline][data-variant='ghost']:hover:not(:disabled):not(
|
|
1026
|
+
[data-disabled]
|
|
1027
|
+
):not([data-loading]):not([data-pressed]),
|
|
1028
|
+
[data-ui-button][data-shape][data-inline][data-variant='ghost']:active:not(:disabled):not(
|
|
1029
|
+
[data-disabled]
|
|
1030
|
+
):not([data-loading]):not([data-pressed]) {
|
|
1031
|
+
background: transparent;
|
|
1032
|
+
}
|
|
1033
|
+
|
|
1034
|
+
[data-ui-button][data-shape][data-inline][data-variant='ghost'][data-tone='secondary']:not(
|
|
1035
|
+
:disabled
|
|
1036
|
+
):not([data-disabled]):not([data-pressed]) {
|
|
1037
|
+
color: var(--slotted-text-muted, GrayText);
|
|
1038
|
+
}
|
|
1039
|
+
|
|
1040
|
+
[data-ui-button][data-shape][data-inline][data-variant='ghost'][data-tone='secondary']:hover:not(
|
|
1041
|
+
:disabled
|
|
1042
|
+
):not([data-disabled]):not([data-loading]):not([data-pressed]),
|
|
1043
|
+
[data-ui-button][data-shape][data-inline][data-variant='ghost'][data-tone='secondary']:focus-visible:not(
|
|
1044
|
+
:disabled
|
|
1045
|
+
):not([data-disabled]):not([data-pressed]),
|
|
1046
|
+
[data-ui-button][data-shape][data-inline][data-variant='ghost'][data-tone='secondary'][data-open]:not(
|
|
1047
|
+
:disabled
|
|
1048
|
+
):not([data-disabled]):not([data-pressed]) {
|
|
1049
|
+
color: var(--slotted-text, CanvasText);
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1052
|
+
/**
|
|
1053
|
+
* ── Forced colors ────────────────────────────────────────────────────
|
|
739
1054
|
*
|
|
740
1055
|
* The theme remaps every token it owns, so this block exists only for what
|
|
741
1056
|
* the family paints itself: the transparent border of `ghost` and of a
|
|
@@ -744,16 +1059,16 @@
|
|
|
744
1059
|
* for a fill the system has flattened.
|
|
745
1060
|
*/
|
|
746
1061
|
@media (forced-colors: active) {
|
|
747
|
-
[data-ui
|
|
1062
|
+
[data-ui-button] {
|
|
748
1063
|
border-color: ButtonBorder;
|
|
749
1064
|
}
|
|
750
1065
|
|
|
751
|
-
[data-ui
|
|
1066
|
+
[data-ui-button][data-pressed] {
|
|
752
1067
|
border-color: Highlight;
|
|
753
1068
|
}
|
|
754
1069
|
|
|
755
|
-
[data-ui
|
|
756
|
-
[data-ui
|
|
1070
|
+
[data-ui-button]:disabled,
|
|
1071
|
+
[data-ui-button][data-disabled] {
|
|
757
1072
|
border-color: GrayText;
|
|
758
1073
|
color: GrayText;
|
|
759
1074
|
}
|
|
@@ -764,7 +1079,7 @@
|
|
|
764
1079
|
* shows the wait, and the sweep above is the loop this sheet owns.
|
|
765
1080
|
*/
|
|
766
1081
|
@media (prefers-reduced-motion: reduce) {
|
|
767
|
-
[data-ui
|
|
1082
|
+
[data-ui-button] [data-part-indicator] {
|
|
768
1083
|
animation: none;
|
|
769
1084
|
}
|
|
770
1085
|
}
|