@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
|
@@ -5,15 +5,20 @@
|
|
|
5
5
|
"--slotted-control-font-size-sm",
|
|
6
6
|
"--slotted-disabled-foreground",
|
|
7
7
|
"--slotted-duration-loop-fast",
|
|
8
|
+
"--slotted-inline-message-actions-gap",
|
|
9
|
+
"--slotted-inline-message-actions-offset",
|
|
8
10
|
"--slotted-inline-message-column-gap",
|
|
9
11
|
"--slotted-inline-message-font-family",
|
|
10
12
|
"--slotted-inline-message-line-height",
|
|
11
13
|
"--slotted-line-height-md",
|
|
12
14
|
"--slotted-radius-full",
|
|
15
|
+
"--slotted-space-2",
|
|
13
16
|
"--slotted-space-4",
|
|
17
|
+
"--slotted-text-box-edge",
|
|
14
18
|
"--slotted-text-muted",
|
|
15
19
|
"--slotted-tone-accent-text",
|
|
16
20
|
"--slotted-tone-danger-text",
|
|
21
|
+
"--slotted-tone-info-text",
|
|
17
22
|
"--slotted-tone-success-text",
|
|
18
23
|
"--slotted-tone-warning-text"
|
|
19
24
|
]
|
package/src/kbd/kbd.css
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* The same length is the minimum inline size, which is what makes a
|
|
20
20
|
* one-letter cap square instead of a slot.
|
|
21
21
|
*/
|
|
22
|
-
[data-ui
|
|
22
|
+
[data-ui-kbd] {
|
|
23
23
|
/**
|
|
24
24
|
* The height comes from the space scale — 16, 20, 24, 28 — and not from
|
|
25
25
|
* the control geometry. A cap on its own is a glyph box, not a control,
|
|
@@ -59,6 +59,13 @@
|
|
|
59
59
|
--_block-size: var(--slotted-control-inner-size, var(--_size));
|
|
60
60
|
|
|
61
61
|
/**
|
|
62
|
+
* `--slotted-kbd-surface`, `--slotted-kbd-border-color` and
|
|
63
|
+
* `--slotted-kbd-color` are the family's own handle on its ground, rim and
|
|
64
|
+
* ink: a theme that re-tints the tone tokens inside a region (a translucent
|
|
65
|
+
* glass scope) sets them to keep a key cap opaque, while the tone tokens
|
|
66
|
+
* keep driving buttons and the other families. `outline` and `plain` own
|
|
67
|
+
* no ground, so they read the rim and the ink, and `plain` only the ink.
|
|
68
|
+
*
|
|
62
69
|
* The ground, the rim and the ink. `raised` is the default: the rim a
|
|
63
70
|
* control draws on three sides, and `--slotted-border-strong` below, the
|
|
64
71
|
* one border token the theme holds to 3:1 against the surface. The strong
|
|
@@ -66,14 +73,14 @@
|
|
|
66
73
|
* it is the shadow a key casts, and it is still the signal that says the
|
|
67
74
|
* word inside is a key.
|
|
68
75
|
*/
|
|
69
|
-
--_background: var(--slotted-surface-raised, Canvas);
|
|
76
|
+
--_background: var(--slotted-kbd-surface, var(--slotted-surface-raised, Canvas));
|
|
70
77
|
--_face: none;
|
|
71
|
-
--_border: var(--slotted-control-border-color, ButtonBorder);
|
|
78
|
+
--_border: var(--slotted-kbd-border-color, var(--slotted-control-border-color, ButtonBorder));
|
|
72
79
|
--_base: var(--slotted-border-strong, ButtonBorder);
|
|
73
|
-
--_color: var(--slotted-text, CanvasText);
|
|
80
|
+
--_color: var(--slotted-kbd-color, var(--slotted-text, CanvasText));
|
|
74
81
|
}
|
|
75
82
|
|
|
76
|
-
[data-ui
|
|
83
|
+
[data-ui-kbd][data-part-root] {
|
|
77
84
|
background-color: var(--_background);
|
|
78
85
|
background-image: var(--_face);
|
|
79
86
|
/**
|
|
@@ -88,8 +95,8 @@
|
|
|
88
95
|
box-sizing: border-box;
|
|
89
96
|
color: var(--_color);
|
|
90
97
|
/**
|
|
91
|
-
* One cell, and the legend
|
|
92
|
-
*
|
|
98
|
+
* One cell, and the legend centerd in it on both axes. A grid of one cell
|
|
99
|
+
* centers what is inside it against the cell rather than against the line
|
|
93
100
|
* box the text opened, which is the half of the fix that keeps a symbol
|
|
94
101
|
* from sitting low once the box stops following it.
|
|
95
102
|
*/
|
|
@@ -119,7 +126,7 @@
|
|
|
119
126
|
line-height: 1;
|
|
120
127
|
min-inline-size: var(--_block-size);
|
|
121
128
|
place-items: center;
|
|
122
|
-
/* The stated height holds the air; the cell
|
|
129
|
+
/* The stated height holds the air; the cell centers the legend in it. */
|
|
123
130
|
padding-block: 0;
|
|
124
131
|
padding-inline: var(--_inset-inline);
|
|
125
132
|
/**
|
|
@@ -128,7 +135,7 @@
|
|
|
128
135
|
* whole and the combination around it is what breaks.
|
|
129
136
|
*/
|
|
130
137
|
white-space: nowrap;
|
|
131
|
-
/* Written inside a sentence, a key sits on the text's
|
|
138
|
+
/* Written inside a sentence, a key sits on the text's center. */
|
|
132
139
|
vertical-align: middle;
|
|
133
140
|
/**
|
|
134
141
|
* The one state pair this family has. A menu row that becomes unavailable
|
|
@@ -150,11 +157,11 @@
|
|
|
150
157
|
* The legend has a box of its own, as the words do in `button` and `badge`,
|
|
151
158
|
* and that box is what makes the family's one typographic problem solvable.
|
|
152
159
|
*
|
|
153
|
-
* The cell
|
|
160
|
+
* The cell centers the *line box*, and a line box is not symmetric around the
|
|
154
161
|
* letters inside it: the ascender reaches further above the cap than the
|
|
155
162
|
* descender reaches below the baseline. `text-box` trims the line to
|
|
156
|
-
* the cap and the baseline, so what is
|
|
157
|
-
* font's metrics, and `K`, `Esc` and `
|
|
163
|
+
* the cap and the baseline, so what is centerd is the ink rather than the
|
|
164
|
+
* font's metrics, and `K`, `Esc` and `Åpy` all sit the same way.
|
|
158
165
|
*
|
|
159
166
|
* It is applied here rather than on the root because `text-box-trim` needs a
|
|
160
167
|
* block container and a grid container has none: its own text lives in an
|
|
@@ -167,19 +174,19 @@
|
|
|
167
174
|
* so the trim moves the ink and never the box.
|
|
168
175
|
*/
|
|
169
176
|
@supports (text-box: trim-both cap alphabetic) {
|
|
170
|
-
[data-ui
|
|
171
|
-
text-box: trim-both cap alphabetic;
|
|
177
|
+
[data-ui-kbd] [data-part-legend] {
|
|
178
|
+
text-box: trim-both var(--slotted-text-box-edge, cap alphabetic);
|
|
172
179
|
}
|
|
173
180
|
|
|
174
181
|
/**
|
|
175
182
|
* A mark is not trimmed, and this is the half of the rule that had to be
|
|
176
183
|
* looked at rather than reasoned out. `cap alphabetic` are Latin metrics: a
|
|
177
|
-
* box trimmed to them
|
|
184
|
+
* box trimmed to them centers the cap band, and `⌘`, `↩` and `⌫` have no
|
|
178
185
|
* relation to a cap height or an alphabetic baseline — measured here, all
|
|
179
|
-
* three sat visibly high in the cap. Left untrimmed, what gets
|
|
186
|
+
* three sat visibly high in the cap. Left untrimmed, what gets centerd is
|
|
180
187
|
* the em box, which is where a mark is drawn.
|
|
181
188
|
*/
|
|
182
|
-
[data-ui
|
|
189
|
+
[data-ui-kbd] [data-part-legend][data-legend='symbol'] {
|
|
183
190
|
text-box: normal;
|
|
184
191
|
}
|
|
185
192
|
}
|
|
@@ -193,7 +200,7 @@
|
|
|
193
200
|
* below the cap height of `K`, and at 1.15em `⌫` stood wider than the
|
|
194
201
|
* `Esc` beside it.
|
|
195
202
|
*/
|
|
196
|
-
[data-ui
|
|
203
|
+
[data-ui-kbd] [data-part-legend][data-legend='symbol'] {
|
|
197
204
|
font-family: var(--slotted-kbd-symbol-font-family, var(--slotted-font-family-sans, sans-serif));
|
|
198
205
|
font-size: 1.1em;
|
|
199
206
|
}
|
|
@@ -208,7 +215,7 @@
|
|
|
208
215
|
* whose accessible name disappears when a consumer forgets an import has no
|
|
209
216
|
* accessible name.
|
|
210
217
|
*/
|
|
211
|
-
[data-ui
|
|
218
|
+
[data-ui-kbd] [data-part-name] {
|
|
212
219
|
block-size: 1px;
|
|
213
220
|
border: 0;
|
|
214
221
|
clip-path: inset(50%);
|
|
@@ -233,10 +240,14 @@
|
|
|
233
240
|
* pinned. A key legend written in Arabic still renders right-to-left within
|
|
234
241
|
* its own cap, because that is a run of its own.
|
|
235
242
|
*/
|
|
236
|
-
[data-ui
|
|
243
|
+
[data-ui-kbd][data-part-shortcut] {
|
|
237
244
|
align-items: center;
|
|
238
245
|
direction: ltr;
|
|
239
246
|
display: inline-flex;
|
|
247
|
+
/* The root is a `kbd`: without these it keeps the user agent's monospace
|
|
248
|
+
face and its line box, which a key in the combination does not share. */
|
|
249
|
+
font-family: var(--slotted-kbd-font-family, var(--slotted-control-font-family, sans-serif));
|
|
250
|
+
line-height: 1;
|
|
240
251
|
/**
|
|
241
252
|
* A shortcut wider than its column wraps between caps and never inside
|
|
242
253
|
* one. The row gets taller; no instruction gets shorter.
|
|
@@ -262,11 +273,11 @@
|
|
|
262
273
|
* `⌥⇧⌘P` and `⌘K` read as one run of six keys. One step tighter is what says
|
|
263
274
|
* these caps are one shortcut. Everywhere else the `+` says it instead.
|
|
264
275
|
*/
|
|
265
|
-
[data-ui
|
|
276
|
+
[data-ui-kbd][data-part-shortcut][data-platform='mac'] {
|
|
266
277
|
--_gap: var(--slotted-space-1, 0.125rem);
|
|
267
278
|
}
|
|
268
279
|
|
|
269
|
-
[data-ui
|
|
280
|
+
[data-ui-kbd][data-part-shortcut][data-platform='mac'][data-size='inherit'] {
|
|
270
281
|
--_gap: 0.125em;
|
|
271
282
|
}
|
|
272
283
|
|
|
@@ -277,7 +288,7 @@
|
|
|
277
288
|
* announce for the same shortcut. The word is not hidden: it is the only
|
|
278
289
|
* thing that tells a sequence from a combination.
|
|
279
290
|
*/
|
|
280
|
-
[data-ui
|
|
291
|
+
[data-ui-kbd] [data-part-separator] {
|
|
281
292
|
color: var(--slotted-text-muted, GrayText);
|
|
282
293
|
flex: none;
|
|
283
294
|
font-family: var(--slotted-kbd-font-family, var(--slotted-control-font-family, sans-serif));
|
|
@@ -285,7 +296,7 @@
|
|
|
285
296
|
line-height: 1;
|
|
286
297
|
}
|
|
287
298
|
|
|
288
|
-
[data-ui
|
|
299
|
+
[data-ui-kbd] [data-part-separator][data-separator='then'] {
|
|
289
300
|
font-family: var(--slotted-control-font-family, sans-serif);
|
|
290
301
|
/**
|
|
291
302
|
* A step boundary is a bigger break than a key join, so it gets more air
|
|
@@ -307,7 +318,7 @@
|
|
|
307
318
|
* scale starts at 12px, and 12px in a 16-pixel cap left one pixel of air
|
|
308
319
|
* above an ascender, so this step writes the one size the scale lacks.
|
|
309
320
|
*/
|
|
310
|
-
[data-ui
|
|
321
|
+
[data-ui-kbd][data-size='xs'] {
|
|
311
322
|
--_size: var(--slotted-space-6, 1rem);
|
|
312
323
|
--_font-size: 0.6875rem;
|
|
313
324
|
--_inset-inline: var(--slotted-space-2, 0.25rem);
|
|
@@ -315,13 +326,13 @@
|
|
|
315
326
|
--_gap: var(--slotted-space-1, 0.125rem);
|
|
316
327
|
}
|
|
317
328
|
|
|
318
|
-
[data-ui
|
|
329
|
+
[data-ui-kbd][data-size='sm'] {
|
|
319
330
|
--_size: var(--slotted-space-7, 1.25rem);
|
|
320
331
|
--_font-size: var(--slotted-control-font-size-sm, 12px);
|
|
321
332
|
--_inset-inline: var(--slotted-space-2, 0.25rem);
|
|
322
333
|
}
|
|
323
334
|
|
|
324
|
-
[data-ui
|
|
335
|
+
[data-ui-kbd][data-size='lg'] {
|
|
325
336
|
--_size: calc(var(--slotted-space-8, 1.5rem) + var(--slotted-space-2, 0.25rem));
|
|
326
337
|
--_font-size: var(--slotted-control-font-size-lg, 14px);
|
|
327
338
|
--_inset-inline: var(--slotted-space-4, 0.5rem);
|
|
@@ -341,7 +352,7 @@
|
|
|
341
352
|
* insets plus edges, made 25.8px on 16px text set at 24px lines. The radius
|
|
342
353
|
* is a quarter of that height, the proportion of the absolute steps.
|
|
343
354
|
*/
|
|
344
|
-
[data-ui
|
|
355
|
+
[data-ui-kbd][data-size='inherit'] {
|
|
345
356
|
--_size: 1.5em;
|
|
346
357
|
--_font-size: 0.8em;
|
|
347
358
|
--_inset-inline: 0.4em;
|
|
@@ -351,7 +362,7 @@
|
|
|
351
362
|
|
|
352
363
|
/* A fractional height puts both horizontal edges between pixels. */
|
|
353
364
|
@supports (inline-size: round(nearest, 1.5em, 1px)) {
|
|
354
|
-
[data-ui
|
|
365
|
+
[data-ui-kbd][data-size='inherit'] {
|
|
355
366
|
--_size: round(nearest, 1.5em, 1px);
|
|
356
367
|
}
|
|
357
368
|
}
|
|
@@ -363,14 +374,14 @@
|
|
|
363
374
|
* outlined one, and it is why `raised` is the default: it is the only value
|
|
364
375
|
* that reads as an object rather than as a box drawn round a word.
|
|
365
376
|
*/
|
|
366
|
-
[data-ui
|
|
377
|
+
[data-ui-kbd][data-variant='raised'] {
|
|
367
378
|
--_base-width: var(--slotted-kbd-base-width, var(--slotted-border-width-thick, 2px));
|
|
368
379
|
/**
|
|
369
380
|
* The skirt. The lower part of the face turns a tenth of the way toward
|
|
370
|
-
* the base
|
|
381
|
+
* the base color, so the face runs into the thick edge instead of meeting
|
|
371
382
|
* it at a line: `#ffffff` to `#f1f3f6` in light, `#171719` to `#202023` in
|
|
372
383
|
* dark. The top 40% stays the flat face, which is where the legend's cap
|
|
373
|
-
* band sits. A gradient is an image, so forced
|
|
384
|
+
* band sits. A gradient is an image, so forced colors drop it with the
|
|
374
385
|
* ground and leave the edges, which is the whole key there.
|
|
375
386
|
*/
|
|
376
387
|
--_face: linear-gradient(
|
|
@@ -390,32 +401,33 @@
|
|
|
390
401
|
* survive an unknown surface was the one variant that could not. A box that
|
|
391
402
|
* borrows its ground borrows its foreground with it.
|
|
392
403
|
*/
|
|
393
|
-
[data-ui
|
|
404
|
+
[data-ui-kbd][data-variant='outline'] {
|
|
394
405
|
--_background: transparent;
|
|
395
406
|
/* The edge is all this variant draws, so it is the strong one all round. */
|
|
396
|
-
--_border: var(--slotted-border-strong, ButtonBorder);
|
|
397
|
-
--
|
|
407
|
+
--_border: var(--slotted-kbd-border-color, var(--slotted-border-strong, ButtonBorder));
|
|
408
|
+
--_base: var(--_border);
|
|
409
|
+
--_color: var(--slotted-kbd-color, inherit);
|
|
398
410
|
}
|
|
399
411
|
|
|
400
412
|
/**
|
|
401
413
|
* The tinted chip, painted from the neutral tone rather than from a surface
|
|
402
|
-
* token. `--slotted-surface-sunken` is the page's own
|
|
414
|
+
* token. `--slotted-surface-sunken` is the page's own color on a sunken
|
|
403
415
|
* panel, where a key painted with it would disappear; the neutral tone's
|
|
404
416
|
* surface is the step `badge` calibrated to read on both.
|
|
405
417
|
*/
|
|
406
|
-
[data-ui
|
|
407
|
-
--_background: var(--slotted-tone-secondary-surface);
|
|
418
|
+
[data-ui-kbd][data-variant='soft'] {
|
|
419
|
+
--_background: var(--slotted-kbd-surface, var(--slotted-tone-secondary-surface));
|
|
408
420
|
/**
|
|
409
421
|
* The tinted key draws the tone's own edge, as every `badge` variant does,
|
|
410
422
|
* and it is not decoration here either. In the `high-contrast` scheme the
|
|
411
423
|
* neutral surface is the page's own white: read in that scheme with no
|
|
412
424
|
* edge, the chip was gone outright and `Ctrl + B` was a run of text. The
|
|
413
|
-
* edge is also what carries it through forced
|
|
425
|
+
* edge is also what carries it through forced colors, where the ground
|
|
414
426
|
* flattens to `Canvas` for the same reason.
|
|
415
427
|
*/
|
|
416
|
-
--_border: var(--slotted-tone-secondary-border);
|
|
417
|
-
--_base: var(--
|
|
418
|
-
--_color: var(--slotted-tone-secondary-text);
|
|
428
|
+
--_border: var(--slotted-kbd-border-color, var(--slotted-tone-secondary-border));
|
|
429
|
+
--_base: var(--_border);
|
|
430
|
+
--_color: var(--slotted-kbd-color, var(--slotted-tone-secondary-text));
|
|
419
431
|
}
|
|
420
432
|
|
|
421
433
|
/**
|
|
@@ -424,21 +436,21 @@
|
|
|
424
436
|
* frame, nothing between it and the row it belongs to.
|
|
425
437
|
*/
|
|
426
438
|
/**
|
|
427
|
-
* A key that is only its word, and it takes the
|
|
439
|
+
* A key that is only its word, and it takes the color of the text it sits
|
|
428
440
|
* in rather than choosing one. React Spectrum's `Keyboard` is the surveyed
|
|
429
441
|
* implementation that gets this right — it “provides no specific styling by
|
|
430
442
|
* itself, but receives styling from the parent container” — and inheriting is
|
|
431
443
|
* also what makes the row work: a menu item that dims dims its shortcut with
|
|
432
444
|
* it, with no state to set and nothing left bright at the end of a grey row.
|
|
433
445
|
*/
|
|
434
|
-
[data-ui
|
|
446
|
+
[data-ui-kbd][data-variant='plain'] {
|
|
435
447
|
--_background: transparent;
|
|
436
448
|
--_border: transparent;
|
|
437
449
|
--_base: transparent;
|
|
438
|
-
--_color: inherit;
|
|
450
|
+
--_color: var(--slotted-kbd-color, inherit);
|
|
439
451
|
}
|
|
440
452
|
|
|
441
|
-
[data-ui
|
|
453
|
+
[data-ui-kbd][data-part-root][data-variant='plain'] {
|
|
442
454
|
min-inline-size: 0;
|
|
443
455
|
padding-inline: 0;
|
|
444
456
|
}
|
|
@@ -451,7 +463,7 @@
|
|
|
451
463
|
* belongs to owns the semantics: `kbd` may carry only the global ARIA
|
|
452
464
|
* attributes, and `aria-disabled` is not one of them.
|
|
453
465
|
*/
|
|
454
|
-
[data-ui
|
|
466
|
+
[data-ui-kbd][data-disabled] {
|
|
455
467
|
--_background: var(--slotted-disabled-background, Canvas);
|
|
456
468
|
--_face: none;
|
|
457
469
|
--_border: var(--slotted-disabled-border, GrayText);
|
|
@@ -459,7 +471,7 @@
|
|
|
459
471
|
--_color: var(--slotted-disabled-foreground, GrayText);
|
|
460
472
|
}
|
|
461
473
|
|
|
462
|
-
[data-ui
|
|
474
|
+
[data-ui-kbd][data-disabled] [data-part-separator] {
|
|
463
475
|
color: var(--slotted-disabled-foreground, GrayText);
|
|
464
476
|
}
|
|
465
477
|
|
|
@@ -468,12 +480,12 @@
|
|
|
468
480
|
* that filled itself grey would be a grey rectangle on whatever surface it
|
|
469
481
|
* was placed over, which is the one thing the variant exists to avoid.
|
|
470
482
|
*/
|
|
471
|
-
[data-ui
|
|
472
|
-
[data-ui
|
|
483
|
+
[data-ui-kbd][data-variant='outline'][data-disabled],
|
|
484
|
+
[data-ui-kbd][data-variant='plain'][data-disabled] {
|
|
473
485
|
--_background: transparent;
|
|
474
486
|
}
|
|
475
487
|
|
|
476
|
-
[data-ui
|
|
488
|
+
[data-ui-kbd][data-variant='plain'][data-disabled] {
|
|
477
489
|
--_border: transparent;
|
|
478
490
|
--_base: transparent;
|
|
479
491
|
}
|
package/src/kbd/kbd.tokens.json
CHANGED
|
@@ -16,10 +16,13 @@
|
|
|
16
16
|
"--slotted-font-family-sans",
|
|
17
17
|
"--slotted-font-weight-medium",
|
|
18
18
|
"--slotted-kbd-base-width",
|
|
19
|
+
"--slotted-kbd-border-color",
|
|
19
20
|
"--slotted-kbd-border-width",
|
|
21
|
+
"--slotted-kbd-color",
|
|
20
22
|
"--slotted-kbd-font-family",
|
|
21
23
|
"--slotted-kbd-font-weight",
|
|
22
24
|
"--slotted-kbd-radius",
|
|
25
|
+
"--slotted-kbd-surface",
|
|
23
26
|
"--slotted-kbd-symbol-font-family",
|
|
24
27
|
"--slotted-radius-lg",
|
|
25
28
|
"--slotted-radius-md",
|
|
@@ -33,6 +36,7 @@
|
|
|
33
36
|
"--slotted-space-8",
|
|
34
37
|
"--slotted-surface-raised",
|
|
35
38
|
"--slotted-text",
|
|
39
|
+
"--slotted-text-box-edge",
|
|
36
40
|
"--slotted-text-muted",
|
|
37
41
|
"--slotted-tone-secondary-border",
|
|
38
42
|
"--slotted-tone-secondary-surface",
|
package/src/link/link.css
CHANGED
|
@@ -5,21 +5,21 @@
|
|
|
5
5
|
* and `button` owns the anchor that wants the action surface — `ButtonLink`,
|
|
6
6
|
* the same family, the same geometry.
|
|
7
7
|
*
|
|
8
|
-
* Three values carry every variant: the
|
|
9
|
-
* pointer, and the
|
|
10
|
-
* is the maximum-contrast text
|
|
8
|
+
* Three values carry every variant: the color at rest, the color under the
|
|
9
|
+
* pointer, and the color while it is being pressed. A fourth, `--_strong`,
|
|
10
|
+
* is the maximum-contrast text color of whatever context the link sits in,
|
|
11
11
|
* and it is what hover mixes toward. That indirection is the whole reason
|
|
12
12
|
* this family was rebuilt: the shipped stylesheet painted hover with
|
|
13
|
-
* `--slotted-tone-accent-solid-hover`, which is a fill
|
|
14
|
-
* scheme a fill that darkens is also a text
|
|
13
|
+
* `--slotted-tone-accent-solid-hover`, which is a fill color. In the light
|
|
14
|
+
* scheme a fill that darkens is also a text color that darkens, so the
|
|
15
15
|
* defect never showed. In the dark scheme that token is `#1d4ed8` over a
|
|
16
16
|
* `#131316` ground, and hovering a link made it harder to read than leaving
|
|
17
17
|
* it alone. A ramp built for fills cannot be a ramp for text, and the tone
|
|
18
|
-
* scale has no `text-hover` role to reach for; mixing toward the
|
|
18
|
+
* scale has no `text-hover` role to reach for; mixing toward the color the
|
|
19
19
|
* theme already holds to the highest ratio in each scheme cannot fail the
|
|
20
20
|
* same way.
|
|
21
21
|
*/
|
|
22
|
-
[data-ui
|
|
22
|
+
[data-ui-link] {
|
|
23
23
|
--_strong: var(--slotted-text, CanvasText);
|
|
24
24
|
--_rest: var(--slotted-link-color, var(--slotted-tone-accent-text, LinkText));
|
|
25
25
|
--_hover: var(
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
/**
|
|
38
38
|
* The underline at rest is lighter than the text it belongs to, and
|
|
39
39
|
* reaches full strength from hover onward. That is what gives `inverse` a
|
|
40
|
-
* hover at all: on a solid surface the text
|
|
40
|
+
* hover at all: on a solid surface the text color is already the
|
|
41
41
|
* strongest one available, so the underline is the only property left that
|
|
42
42
|
* can answer the pointer.
|
|
43
43
|
*/
|
|
@@ -75,12 +75,33 @@
|
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
/**
|
|
78
|
-
* The link that takes the
|
|
78
|
+
* The link that takes the color of the text it sits in — a title inside a
|
|
79
79
|
* card, a name inside a table row — and reaches the accent under the
|
|
80
80
|
* pointer. Fluent calls it `subtle`, Primer `muted`, Polaris `monochrome`,
|
|
81
|
-
* and all three describe the same two
|
|
81
|
+
* and all three describe the same two colors.
|
|
82
82
|
*/
|
|
83
|
-
|
|
83
|
+
/**
|
|
84
|
+
* The text size. Unset, a link takes the size an action slot states for the
|
|
85
|
+
* controls it holds (`--slotted-link-font-size`), or else its parent's; a
|
|
86
|
+
* `size` states its own.
|
|
87
|
+
*/
|
|
88
|
+
[data-ui-link] {
|
|
89
|
+
font-size: var(--slotted-link-font-size, inherit);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
[data-ui-link][data-size='xs'] {
|
|
93
|
+
font-size: var(--slotted-font-size-xs, 0.75rem);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
[data-ui-link][data-size='sm'] {
|
|
97
|
+
font-size: var(--slotted-font-size-sm, 0.8125rem);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
[data-ui-link][data-size='md'] {
|
|
101
|
+
font-size: var(--slotted-font-size-md, 0.875rem);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
[data-ui-link][data-variant='neutral'] {
|
|
84
105
|
--_rest: var(--slotted-link-color, currentColor);
|
|
85
106
|
--_hover: var(--slotted-link-color-hover, var(--slotted-tone-accent-text, LinkText));
|
|
86
107
|
--_active: var(
|
|
@@ -90,30 +111,30 @@
|
|
|
90
111
|
}
|
|
91
112
|
|
|
92
113
|
/**
|
|
93
|
-
* The link on a solid or inverse surface. The strong
|
|
114
|
+
* The link on a solid or inverse surface. The strong color changes with the
|
|
94
115
|
* ground, so hover has nowhere further to go and the underline carries the
|
|
95
116
|
* state on its own.
|
|
96
117
|
*/
|
|
97
|
-
[data-ui
|
|
118
|
+
[data-ui-link][data-variant='inverse'] {
|
|
98
119
|
--_strong: var(--slotted-text-inverse, Canvas);
|
|
99
120
|
--_rest: var(--slotted-link-color, var(--slotted-text-inverse, Canvas));
|
|
100
121
|
}
|
|
101
122
|
|
|
102
123
|
/* ── Underline axis ─────────────────────────────────────────────────────
|
|
103
124
|
*
|
|
104
|
-
* `always` is the default because
|
|
105
|
-
* the accent text
|
|
125
|
+
* `always` is the default because color alone does not distinguish a link:
|
|
126
|
+
* the accent text color clears 4.5:1 against the surface and not 3:1
|
|
106
127
|
* against the body text beside it, which is the ratio a link with no second
|
|
107
128
|
* cue has to meet. The other two values are for a link that stands alone,
|
|
108
129
|
* where there is no sentence for it to disappear into.
|
|
109
130
|
*/
|
|
110
131
|
|
|
111
|
-
[data-ui
|
|
112
|
-
[data-ui
|
|
132
|
+
[data-ui-link][data-underline='hover'],
|
|
133
|
+
[data-ui-link][data-underline='none'] {
|
|
113
134
|
text-decoration-line: none;
|
|
114
135
|
}
|
|
115
136
|
|
|
116
|
-
[data-ui
|
|
137
|
+
[data-ui-link][data-underline='hover']:not([data-disabled]):hover {
|
|
117
138
|
text-decoration-line: underline;
|
|
118
139
|
}
|
|
119
140
|
|
|
@@ -122,31 +143,31 @@
|
|
|
122
143
|
* `none` is left alone: it says the underline does not exist, not that it is
|
|
123
144
|
* waiting for something.
|
|
124
145
|
*/
|
|
125
|
-
[data-ui
|
|
146
|
+
[data-ui-link][data-underline='hover']:focus-visible {
|
|
126
147
|
text-decoration-line: underline;
|
|
127
148
|
}
|
|
128
149
|
|
|
129
150
|
/* ── Visited ────────────────────────────────────────────────────────────
|
|
130
151
|
*
|
|
131
152
|
* Opt-in, and declared before the interaction rules so hover still answers a
|
|
132
|
-
* link the reader has already followed. `:visited` accepts
|
|
153
|
+
* link the reader has already followed. `:visited` accepts color and
|
|
133
154
|
* nothing else — the restriction is deliberate, and it is also why no test
|
|
134
155
|
* in this repository can read this rule back.
|
|
135
156
|
*/
|
|
136
157
|
|
|
137
|
-
[data-ui
|
|
158
|
+
[data-ui-link][data-visited]:visited {
|
|
138
159
|
color: var(--_visited);
|
|
139
160
|
}
|
|
140
161
|
|
|
141
162
|
/* ── Hover and press, held back for disabled ────────────────────────────── */
|
|
142
163
|
|
|
143
|
-
[data-ui
|
|
164
|
+
[data-ui-link]:not([data-disabled]):hover {
|
|
144
165
|
--_underline: currentColor;
|
|
145
166
|
|
|
146
167
|
color: var(--_hover);
|
|
147
168
|
}
|
|
148
169
|
|
|
149
|
-
[data-ui
|
|
170
|
+
[data-ui-link]:not([data-disabled]):active {
|
|
150
171
|
--_underline: currentColor;
|
|
151
172
|
|
|
152
173
|
color: var(--_active);
|
|
@@ -159,7 +180,7 @@
|
|
|
159
180
|
* offset reaches into the line above.
|
|
160
181
|
*/
|
|
161
182
|
|
|
162
|
-
[data-ui
|
|
183
|
+
[data-ui-link]:focus-visible {
|
|
163
184
|
outline: var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, Highlight);
|
|
164
185
|
outline-offset: var(--slotted-link-focus-ring-offset, 1px);
|
|
165
186
|
}
|
|
@@ -172,16 +193,16 @@
|
|
|
172
193
|
* reads as a link that is not available rather than as plain text.
|
|
173
194
|
*/
|
|
174
195
|
|
|
175
|
-
[data-ui
|
|
196
|
+
[data-ui-link][data-disabled] {
|
|
176
197
|
color: var(--slotted-link-color-disabled, var(--slotted-disabled-foreground, GrayText));
|
|
177
198
|
cursor: not-allowed;
|
|
178
199
|
}
|
|
179
200
|
|
|
180
201
|
/* ── The external marker ────────────────────────────────────────────────
|
|
181
202
|
*
|
|
182
|
-
* The arrow is the `Glyph` element inside an `icon` box, so it is the
|
|
203
|
+
* The arrow is the `Glyph` element inside an `icon` box, so it is the color
|
|
183
204
|
* of the link at every step of the ramp, in every scheme and under forced
|
|
184
|
-
*
|
|
205
|
+
* colors, and mirrors in a right-to-left document through the box's own
|
|
185
206
|
* `directional`. A character would be a font's opinion of an arrow.
|
|
186
207
|
*
|
|
187
208
|
* The binding writes a word joiner before this element — U+2060, the
|
|
@@ -196,7 +217,7 @@
|
|
|
196
217
|
* `--slotted-icon-size`, which the part states at the size of the text.
|
|
197
218
|
*/
|
|
198
219
|
|
|
199
|
-
[data-ui
|
|
220
|
+
[data-ui-link] [data-part-external-icon] {
|
|
200
221
|
--slotted-icon-size: var(--slotted-link-external-icon-size, 1em);
|
|
201
222
|
|
|
202
223
|
margin-inline-start: var(--slotted-link-external-icon-gap, 0.15em);
|
|
@@ -211,17 +232,17 @@
|
|
|
211
232
|
* nothing at all for the consumer who never adopted the mirror.
|
|
212
233
|
*
|
|
213
234
|
* The destination of a current link is the page the reader is already on, so
|
|
214
|
-
* it stops being an invitation and takes the body
|
|
215
|
-
* stays, because it is still a link and
|
|
235
|
+
* it stops being an invitation and takes the body color. The underline
|
|
236
|
+
* stays, because it is still a link and color alone would not say so. The
|
|
216
237
|
* weight does not change: a nav item that thickens shifts every item beside
|
|
217
238
|
* it.
|
|
218
239
|
*/
|
|
219
240
|
|
|
220
|
-
[data-ui
|
|
241
|
+
[data-ui-link][aria-current]:not([aria-current='false']) {
|
|
221
242
|
--_rest: var(--slotted-link-color-current, var(--slotted-text, CanvasText));
|
|
222
243
|
}
|
|
223
244
|
|
|
224
|
-
/* ── Forced
|
|
245
|
+
/* ── Forced colors ─────────────────────────────────────────────────────
|
|
225
246
|
*
|
|
226
247
|
* The theme remaps every token it owns, so this block covers only what the
|
|
227
248
|
* family paints itself: an underline the axis may have taken away, where a
|
|
@@ -230,7 +251,7 @@
|
|
|
230
251
|
*/
|
|
231
252
|
|
|
232
253
|
@media (forced-colors: active) {
|
|
233
|
-
[data-ui
|
|
254
|
+
[data-ui-link] {
|
|
234
255
|
text-decoration-line: underline;
|
|
235
256
|
}
|
|
236
257
|
}
|
|
@@ -5,6 +5,9 @@
|
|
|
5
5
|
"--slotted-easing-standard",
|
|
6
6
|
"--slotted-focus-ring-color",
|
|
7
7
|
"--slotted-focus-ring-width",
|
|
8
|
+
"--slotted-font-size-md",
|
|
9
|
+
"--slotted-font-size-sm",
|
|
10
|
+
"--slotted-font-size-xs",
|
|
8
11
|
"--slotted-link-color",
|
|
9
12
|
"--slotted-link-color-active",
|
|
10
13
|
"--slotted-link-color-current",
|
|
@@ -14,6 +17,7 @@
|
|
|
14
17
|
"--slotted-link-external-icon-gap",
|
|
15
18
|
"--slotted-link-external-icon-size",
|
|
16
19
|
"--slotted-link-focus-ring-offset",
|
|
20
|
+
"--slotted-link-font-size",
|
|
17
21
|
"--slotted-link-radius",
|
|
18
22
|
"--slotted-link-underline-color",
|
|
19
23
|
"--slotted-link-underline-offset",
|