actual-css 0.20.1 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/CHANGELOG.md +105 -0
  2. package/README.md +6 -6
  3. package/components.json +29 -7
  4. package/dist/actual.full.css +542 -135
  5. package/dist/actual.full.js +2 -2
  6. package/dist/actual.full.min.css +1 -1
  7. package/dist/types/data-flag.d.ts +1 -0
  8. package/dist/types/enhancement-loader-state.d.ts +6 -0
  9. package/dist/types/enhancement-loader.d.ts +0 -2
  10. package/dist/types/parse-config.d.ts +0 -1
  11. package/dist/types/popover-transport.d.ts +2 -0
  12. package/dist/types/status.d.ts +0 -1
  13. package/dist/types/tooltip.d.ts +4 -0
  14. package/dist/types/validation.d.ts +6 -2
  15. package/docs/pages/components/app-navigation.md +67 -0
  16. package/docs/pages/components/button.md +3 -0
  17. package/docs/pages/components/dialog.md +3 -0
  18. package/docs/pages/components/list.md +13 -0
  19. package/docs/pages/components/meter.md +1 -0
  20. package/docs/pages/components/progress.md +1 -0
  21. package/docs/pages/components/segmented.md +7 -4
  22. package/docs/pages/components/table.md +4 -1
  23. package/docs/pages/components/timeline.md +32 -0
  24. package/docs/pages/enhancements/flyout.md +12 -3
  25. package/docs/pages/enhancements/tooltip.md +6 -1
  26. package/docs/pages/examples/overview.md +30 -1
  27. package/docs/pages/forms/combobox.md +14 -10
  28. package/docs/pages/forms/labels.md +7 -0
  29. package/docs/pages/forms/overview.md +13 -10
  30. package/docs/pages/forms/range.md +3 -1
  31. package/docs/pages/forms/validation.md +3 -3
  32. package/docs/pages/foundations/philosophy.md +26 -0
  33. package/docs/pages/foundations/theming.md +80 -7
  34. package/docs/pages/foundations/tokens.md +39 -2
  35. package/docs/pages/guides/coding-agents.md +11 -0
  36. package/docs/pages/guides/introduction.md +1 -1
  37. package/docs/pages/guides/progressive-enhancement.md +109 -19
  38. package/docs/pages/guides/tailwind.md +12 -6
  39. package/docs/pages/guides/upgrading.md +52 -0
  40. package/docs/pages/layout/app-layout.md +50 -1
  41. package/docs/pages/patterns/empty-state.md +48 -10
  42. package/forms.json +325 -0
  43. package/llms.txt +2 -1
  44. package/package.json +3 -1
  45. package/reserved-classes.json +2 -0
  46. package/skills/actual-css/SKILL.md +1 -1
  47. package/skills/actual-css/references/api-and-vocabulary.md +2 -1
  48. package/src/cli/actual-css.js +8 -2
  49. package/src/css/components/app-nav.css +75 -18
  50. package/src/css/components/avatar.css +1 -0
  51. package/src/css/components/badge.css +7 -1
  52. package/src/css/components/button.css +20 -3
  53. package/src/css/components/flyout.css +8 -2
  54. package/src/css/components/list.css +28 -13
  55. package/src/css/components/menu.css +18 -0
  56. package/src/css/components/meter.css +11 -6
  57. package/src/css/components/progress.css +14 -6
  58. package/src/css/components/rating.css +2 -0
  59. package/src/css/components/segmented.css +22 -12
  60. package/src/css/components/table.css +21 -2
  61. package/src/css/components/timeline.css +50 -1
  62. package/src/css/core/theme.css +11 -1
  63. package/src/css/core/tokens.css +20 -2
  64. package/src/css/forms/choice-card.css +6 -4
  65. package/src/css/forms/choice.css +28 -16
  66. package/src/css/forms/control.css +23 -16
  67. package/src/css/forms/custom-select.css +3 -1
  68. package/src/css/forms/form.css +8 -5
  69. package/src/css/forms/otp.css +7 -1
  70. package/src/css/forms/range.css +31 -11
  71. package/src/css/forms/select.css +13 -4
  72. package/src/css/forms/switch.css +11 -5
  73. package/src/css/layout/app-layout.css +104 -5
  74. package/src/js/data-flag.js +4 -0
  75. package/src/js/dialog.js +24 -8
  76. package/src/js/enhancement-loader-state.js +7 -0
  77. package/src/js/enhancement-loader.js +4 -21
  78. package/src/js/keys.js +5 -7
  79. package/src/js/parse-config.js +0 -2
  80. package/src/js/popover-transport.js +18 -0
  81. package/src/js/status.js +0 -2
  82. package/src/js/surface.js +35 -41
  83. package/src/js/tooltip.js +70 -36
  84. package/src/js/validation.js +24 -10
  85. package/src/tooling/css-bundle.js +5 -0
  86. package/src/tooling/design-tokens.js +9 -2
  87. package/src/tooling/theme-contrast.js +45 -17
  88. package/tokens.json +5 -0
package/forms.json ADDED
@@ -0,0 +1,325 @@
1
+ [
2
+ {
3
+ "name": "choice",
4
+ "source": "src/css/forms/choice.css",
5
+ "cssImport": "actual-css/css/forms/choice",
6
+ "docs": "https://lekoala.github.io/actual-css/site/forms/overview.html",
7
+ "classes": [
8
+ "check",
9
+ "choice",
10
+ "radio"
11
+ ],
12
+ "publicHooks": [
13
+ "--choice-control-nudge",
14
+ "--choice-border",
15
+ "--choice-bg",
16
+ "--choice-mark",
17
+ "--choice-control-size"
18
+ ],
19
+ "states": [
20
+ "checked",
21
+ "disabled",
22
+ "indeterminate"
23
+ ],
24
+ "pseudoElements": {
25
+ ".check": [
26
+ "::before"
27
+ ],
28
+ ".radio": [
29
+ "::before"
30
+ ]
31
+ }
32
+ },
33
+ {
34
+ "name": "choice-card",
35
+ "source": "src/css/forms/choice-card.css",
36
+ "cssImport": "actual-css/css/forms/choice-card",
37
+ "docs": "https://lekoala.github.io/actual-css/site/forms/choice-cards.html",
38
+ "classes": [
39
+ "chip",
40
+ "choice-card"
41
+ ],
42
+ "publicHooks": [
43
+ "--choice-card-pad",
44
+ "--choice-card-gap",
45
+ "--choice-card-radius",
46
+ "--choice-card-border",
47
+ "--choice-card-bg",
48
+ "--choice-card-check-size",
49
+ "--choice-chip-dot"
50
+ ],
51
+ "states": [
52
+ "checked",
53
+ "disabled"
54
+ ],
55
+ "pseudoElements": {
56
+ ".choice-card": [
57
+ "::after",
58
+ "::before"
59
+ ]
60
+ }
61
+ },
62
+ {
63
+ "name": "color-swatch",
64
+ "source": "src/css/forms/color-swatch.css",
65
+ "cssImport": "actual-css/css/forms/color-swatch",
66
+ "docs": "https://lekoala.github.io/actual-css/site/forms/color-swatches.html",
67
+ "classes": [
68
+ "color-swatch"
69
+ ],
70
+ "publicHooks": [
71
+ "--color-swatch-value",
72
+ "--color-swatch-size",
73
+ "--color-swatch-radius"
74
+ ],
75
+ "states": [
76
+ "checked",
77
+ "disabled"
78
+ ],
79
+ "pseudoElements": {
80
+ ".color-swatch": [
81
+ "::after",
82
+ "::before"
83
+ ]
84
+ }
85
+ },
86
+ {
87
+ "name": "control",
88
+ "source": "src/css/forms/control.css",
89
+ "cssImport": "actual-css/css/forms/control",
90
+ "docs": "https://lekoala.github.io/actual-css/site/forms/overview.html",
91
+ "classes": [
92
+ "input",
93
+ "textarea"
94
+ ],
95
+ "publicHooks": [
96
+ "--control-border",
97
+ "--control-bg",
98
+ "--control-default-bg",
99
+ "--control-default-border",
100
+ "--control-fg",
101
+ "--control-cursor",
102
+ "--control-shadow",
103
+ "--control-border-block-end-color",
104
+ "--control-border-block-end-width",
105
+ "--control-hover-border",
106
+ "--control-hover-bg"
107
+ ],
108
+ "states": [
109
+ "disabled"
110
+ ]
111
+ },
112
+ {
113
+ "name": "custom-select",
114
+ "source": "src/css/forms/custom-select.css",
115
+ "cssImport": "actual-css/css/forms/custom-select",
116
+ "docs": "https://lekoala.github.io/actual-css/site/forms/overview.html",
117
+ "internalHooks": [
118
+ "--control-bg"
119
+ ],
120
+ "states": [
121
+ "disabled",
122
+ "open"
123
+ ]
124
+ },
125
+ {
126
+ "name": "floating-field",
127
+ "source": "src/css/forms/floating-field.css",
128
+ "cssImport": "actual-css/css/forms/floating-field",
129
+ "docs": "https://lekoala.github.io/actual-css/site/forms/floating-field.html",
130
+ "classes": [
131
+ "floating-field"
132
+ ],
133
+ "publicHooks": [
134
+ "--floating-label-top",
135
+ "--floating-label-opacity",
136
+ "--floating-pad-block-start"
137
+ ]
138
+ },
139
+ {
140
+ "name": "form",
141
+ "source": "src/css/forms/form.css",
142
+ "cssImport": "actual-css/css/forms/form",
143
+ "docs": "https://lekoala.github.io/actual-css/site/forms/overview.html",
144
+ "classes": [
145
+ "field",
146
+ "field-error",
147
+ "field-group",
148
+ "field-help",
149
+ "field-label",
150
+ "flush",
151
+ "required-mark"
152
+ ],
153
+ "publicHooks": [
154
+ "--field-label-scale",
155
+ "--fieldset-legend-padding-inline"
156
+ ]
157
+ },
158
+ {
159
+ "name": "form-actions",
160
+ "source": "src/css/forms/form-actions.css",
161
+ "cssImport": "actual-css/css/forms/form-actions",
162
+ "docs": "https://lekoala.github.io/actual-css/site/forms/form-actions.html",
163
+ "classes": [
164
+ "form-actions",
165
+ "sticky"
166
+ ],
167
+ "publicHooks": [
168
+ "--form-actions-align",
169
+ "--form-actions-justify"
170
+ ],
171
+ "internalHooks": [
172
+ "--form-actions-sticky-block-offset",
173
+ "--form-actions-sticky-inline-offset",
174
+ "--form-actions-sticky-padding"
175
+ ]
176
+ },
177
+ {
178
+ "name": "input-icon",
179
+ "source": "src/css/forms/input-icon.css",
180
+ "cssImport": "actual-css/css/forms/input-icon",
181
+ "docs": "https://lekoala.github.io/actual-css/site/patterns/icon-input.html",
182
+ "classes": [
183
+ "input-icon"
184
+ ],
185
+ "publicHooks": [
186
+ "--input-icon-size"
187
+ ]
188
+ },
189
+ {
190
+ "name": "native",
191
+ "source": "src/css/forms/native.css",
192
+ "cssImport": "actual-css/css/forms/native",
193
+ "docs": "https://lekoala.github.io/actual-css/site/forms/controls.html",
194
+ "classes": [
195
+ "color",
196
+ "file"
197
+ ],
198
+ "publicHooks": [
199
+ "--color-size"
200
+ ],
201
+ "states": [
202
+ "disabled"
203
+ ]
204
+ },
205
+ {
206
+ "name": "otp",
207
+ "source": "src/css/forms/otp.css",
208
+ "cssImport": "actual-css/css/forms/otp",
209
+ "docs": "https://lekoala.github.io/actual-css/site/forms/otp.html",
210
+ "classes": [
211
+ "otp"
212
+ ],
213
+ "publicHooks": [
214
+ "--otp-cell-size",
215
+ "--otp-gap",
216
+ "--otp-font-size"
217
+ ],
218
+ "internalHooks": [
219
+ "--otp-cell-border",
220
+ "--otp-cell-border-width",
221
+ "--otp-cell-bg",
222
+ "--otp-caret-space"
223
+ ],
224
+ "states": [
225
+ "aria-invalid",
226
+ "disabled"
227
+ ]
228
+ },
229
+ {
230
+ "name": "range",
231
+ "source": "src/css/forms/range.css",
232
+ "cssImport": "actual-css/css/forms/range",
233
+ "docs": "https://lekoala.github.io/actual-css/site/forms/range.html",
234
+ "classes": [
235
+ "range"
236
+ ],
237
+ "publicHooks": [
238
+ "--range-thumb-size",
239
+ "--range-thumb-inline-size",
240
+ "--range-thumb-radius",
241
+ "--range-track-height",
242
+ "--range-thumb-bg",
243
+ "--range-track-bg",
244
+ "--range-fill-bg",
245
+ "--range-progress"
246
+ ],
247
+ "states": [
248
+ "disabled"
249
+ ],
250
+ "jsImport": "actual-css/js/range",
251
+ "enhancements": [
252
+ "range"
253
+ ]
254
+ },
255
+ {
256
+ "name": "select",
257
+ "source": "src/css/forms/select.css",
258
+ "cssImport": "actual-css/css/forms/select",
259
+ "docs": "https://lekoala.github.io/actual-css/site/forms/overview.html",
260
+ "classes": [
261
+ "select"
262
+ ],
263
+ "publicHooks": [
264
+ "--select-icon-size",
265
+ "--select-icon-inset"
266
+ ]
267
+ },
268
+ {
269
+ "name": "switch",
270
+ "source": "src/css/forms/switch.css",
271
+ "cssImport": "actual-css/css/forms/switch",
272
+ "docs": "https://lekoala.github.io/actual-css/site/forms/switch.html",
273
+ "classes": [
274
+ "switch"
275
+ ],
276
+ "publicHooks": [
277
+ "--switch-bg",
278
+ "--switch-border",
279
+ "--switch-knob",
280
+ "--switch-width",
281
+ "--switch-block-size",
282
+ "--switch-knob-margin",
283
+ "--switch-knob-size",
284
+ "--switch-knob-inline-size",
285
+ "--switch-travel",
286
+ "--choice-control-size",
287
+ "--control-size"
288
+ ],
289
+ "states": [
290
+ "checked",
291
+ "disabled"
292
+ ],
293
+ "pseudoElements": {
294
+ ".switch": [
295
+ "::before"
296
+ ]
297
+ }
298
+ },
299
+ {
300
+ "name": "validation",
301
+ "source": "src/css/forms/validation.css",
302
+ "cssImport": "actual-css/css/forms/validation",
303
+ "docs": "https://lekoala.github.io/actual-css/site/forms/validation.html",
304
+ "classes": [
305
+ "needs-validation",
306
+ "was-validated"
307
+ ],
308
+ "publicHooks": [
309
+ "--form-invalid-border"
310
+ ],
311
+ "internalHooks": [
312
+ "--choice-bg",
313
+ "--switch-bg"
314
+ ],
315
+ "states": [
316
+ "aria-invalid",
317
+ "checked",
318
+ "indeterminate"
319
+ ],
320
+ "jsImport": "actual-css/js/validation",
321
+ "enhancements": [
322
+ "validation"
323
+ ]
324
+ }
325
+ ]
package/llms.txt CHANGED
@@ -18,7 +18,8 @@ Actual CSS uses a small public grammar: `.component [intent] [variant] [size] [m
18
18
  - `actual-css/js/full` — the complete runtime with all built-in enhancers pre-registered.
19
19
  - `actual-css/reserved-classes.json` — machine-readable list of the framework-owned class namespace. Use it to check whether a class belongs to Actual CSS and to validate claimed framework classes; application-specific classes are expected to exist outside this manifest.
20
20
  - `actual-css/components.json` — machine-readable component index, derived from the sources (CSS headers, selectors, package exports, `src/js`) by `scripts/build-catalog.js` and verified by `check:catalog`. Gives each component its import paths, owned classes, hooks, states, registered enhancement tokens, and published `docs` URL — enough to know what exists and where to read more, not a replacement for the docs pages.
21
- - `actual-css/tokens.json` — the public global tokens (`global`), derived by the same script from `src/css/core`. Use it to check that a `var(--…)` outside a component exists; component hooks are in `components.json`.
21
+ - `actual-css/forms.json` — the same index for `src/css/forms`, one entry per file (`form` → `.field`, `.field-label`…); a class belongs to the file that provides it, not to one that only restyles it (`validation`).
22
+ - `actual-css/tokens.json` — the public global tokens (`global`), derived by the same script from `src/css/core`. Use it to check that a `var(--…)` outside a component exists; component and form hooks are in `components.json` and `forms.json`.
22
23
  - [Starter agent skill](skills/actual-css/SKILL.md) — a copyable skill for building with Actual CSS (vocabulary, hooks, layouts, enhancements); consuming projects extend it with a local `PROJECT.md`; visual direction lives in the project's own `DESIGN.md` ([Coding agents and DESIGN.md](docs/pages/guides/coding-agents.md)).
23
24
  - Individual families and modules are importable separately (`actual-css/css/components`, `actual-css/css/layout/grid`, `actual-css/js/dialog`, …); see [README](README.md) and [Modular imports](docs/pages/guides/modular-import.md).
24
25
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "actual-css",
3
- "version": "0.20.1",
3
+ "version": "0.21.0",
4
4
  "description": "Plain CSS component framework with semantic classes, universal variants, small tokens, theme hooks, and progressive enhancements.",
5
5
  "type": "module",
6
6
  "packageManager": "bun@1.4.4",
@@ -79,6 +79,7 @@
79
79
  "./js/surface": { "types": "./dist/types/surface.d.ts", "default": "./src/js/surface.js" },
80
80
  "./reserved-classes.json": "./reserved-classes.json",
81
81
  "./components.json": "./components.json",
82
+ "./forms.json": "./forms.json",
82
83
  "./tokens.json": "./tokens.json",
83
84
  "./package.json": "./package.json"
84
85
  },
@@ -104,6 +105,7 @@
104
105
  "src/tooling",
105
106
  "reserved-classes.json",
106
107
  "components.json",
108
+ "forms.json",
107
109
  "tokens.json",
108
110
  "docs/pages",
109
111
  "docs/brand",
@@ -148,6 +148,7 @@
148
148
  "media",
149
149
  "menu",
150
150
  "menu-item",
151
+ "menu-item-desc",
151
152
  "menu-item-end",
152
153
  "menu-item-icon",
153
154
  "menu-item-text",
@@ -262,6 +263,7 @@
262
263
  "tight",
263
264
  "timeline",
264
265
  "timeline-dates-end",
266
+ "timeline-dates-start",
265
267
  "tooltip",
266
268
  "topbar",
267
269
  "touch-target",
@@ -15,7 +15,7 @@ The target is not zero application CSS. The target is:
15
15
 
16
16
  Actual CSS may evolve between releases. Resolve uncertain API from the version used by the current project, in this order:
17
17
 
18
- 1. `actual-css/components.json` — component index: classes, public hooks, states, CSS/JS imports, enhancement tokens, docs URL.
18
+ 1. `actual-css/components.json` and `actual-css/forms.json` — component and form indexes: classes, public hooks, states, CSS/JS imports, enhancement tokens, docs URL.
19
19
  2. `actual-css/reserved-classes.json` — framework-owned class namespace.
20
20
  3. `actual-css/tokens.json` — public global tokens; a `var(--…)` outside a component should be one of them.
21
21
  4. `actual-css/package.json#exports` — canonical package entrypoints.
@@ -5,13 +5,14 @@
5
5
  Use the installed version rather than guessing from names:
6
6
 
7
7
  - `components.json` — component classes, hooks, states, CSS/JS imports, enhancement tokens, docs URL.
8
+ - `forms.json` — the same for form files (`form` → `.field`, `.field-label`…).
8
9
  - `reserved-classes.json` — whether Actual CSS owns a class name.
9
10
  - `tokens.json` — public global tokens (`--space-40`, `--shadow`, `--primary`…).
10
11
  - `package.json#exports` — supported package entrypoints.
11
12
  - CSS/JS source — exact behavior and defaults.
12
13
  - docs / `llms.txt` — intended usage and framework map.
13
14
 
14
- `components.json` is an index, not a replacement for component documentation or source.
15
+ `components.json` and `forms.json` are indexes, not a replacement for component documentation or source.
15
16
 
16
17
  ## Class grammar
17
18
 
@@ -32,7 +32,8 @@ function usage() {
32
32
  "scheme it declares: soft ink on its resting and hovered fill, the resting edge",
33
33
  "of a field, checkbox and radio and the track or knob of an unchecked switch, the focus line on --surface",
34
34
  "and --surface-solid, the invalid-field focus line, and the inverse text. Exits 1",
35
- "when a pair misses its threshold. Needs Bun (bunx --bun actual-css contrast ...).",
35
+ "when a pair misses its threshold; a field without a 3:1 edge or fill is a",
36
+ "warning. Needs Bun (bunx --bun actual-css contrast ...).",
36
37
  ].join("\n");
37
38
  }
38
39
 
@@ -152,8 +153,13 @@ async function design({ themeFile, name, out }) {
152
153
  async function contrast({ themeFile, name }) {
153
154
  requireBun("contrast");
154
155
  const { formatContrast, measureThemeFile } = await import("../tooling/theme-contrast.js");
155
- const { text, misses } = formatContrast(await measureThemeFile({ themeFile, name }));
156
+ const { text, misses, warnings } = formatContrast(await measureThemeFile({ themeFile, name }));
156
157
  console.log(text);
158
+ if (warnings > 0) {
159
+ console.error(
160
+ `\n${warnings} field${warnings === 1 ? "" : "s"} without a 3:1 cue (warning, see above).`,
161
+ );
162
+ }
157
163
  if (misses > 0) {
158
164
  console.error(`\n${misses} pair${misses === 1 ? "" : "s"} under threshold.`);
159
165
  process.exitCode = 1;
@@ -5,10 +5,21 @@
5
5
  *
6
6
  * Docs: docs/pages/components/app-navigation.md
7
7
  *
8
+ * Tiles are direct-child links and buttons (a "More" button opening a drawer,
9
+ * a disabled destination). A direct-child header and footer, at most one each,
10
+ * belong to the side presentation only (app-layout.css); the bottom bar has
11
+ * room for destinations alone.
12
+ *
8
13
  * Public hooks:
9
14
  * --app-nav-size
10
15
  * --app-nav-gap
11
16
  * --app-nav-icon-size
17
+ * --app-nav-current-bg (fallback-only: current fill, icon pill or side row)
18
+ * --app-nav-current-fg (fallback-only: ink on that fill)
19
+ *
20
+ * Internal:
21
+ * --app-nav-fill (state fill, read by the icon pill or the whole tile)
22
+ * --app-nav-ink (state ink on that fill)
12
23
  */
13
24
  :where(.app-nav) {
14
25
  --intent: initial;
@@ -39,7 +50,11 @@
39
50
  color: var(--ui-fg, var(--text-muted));
40
51
  }
41
52
 
42
- .app-nav > a {
53
+ .app-nav > :is(header, footer) {
54
+ display: none;
55
+ }
56
+
57
+ .app-nav > :is(a, button) {
43
58
  position: relative;
44
59
  display: grid;
45
60
  grid-template-rows: auto auto;
@@ -61,41 +76,83 @@
61
76
  -webkit-tap-highlight-color: transparent;
62
77
  }
63
78
 
64
- .app-nav > a > :where(svg, img, [aria-hidden="true"]) {
79
+ .app-nav > button {
80
+ border: 0;
81
+ background: none;
82
+ font-family: inherit;
83
+ cursor: pointer;
84
+ }
85
+
86
+ .app-nav > button:disabled {
87
+ cursor: not-allowed;
88
+ opacity: var(--disabled-opacity);
89
+ }
90
+
91
+ /* The fill hugs what it marks. Under a caption, a tile is mostly empty space,
92
+ so its state paints a pill around the icon, not the tile: a full-tile fill
93
+ read as a segmented control. States only set --app-nav-fill and
94
+ --app-nav-ink; the presentation decides what reads them (the labelled side
95
+ navigation paints the whole row, app-layout.css). Every icon carries the
96
+ pill's geometry, so becoming current never moves it. */
97
+ .app-nav > :is(a, button) > :where(svg, img, [aria-hidden="true"]) {
98
+ box-sizing: content-box;
65
99
  inline-size: var(--app-nav-icon-size);
66
100
  block-size: var(--app-nav-icon-size);
101
+ padding: var(--space-10) var(--space-40);
102
+ border-radius: var(--radius-full);
103
+ background: var(--app-nav-fill, transparent);
104
+ color: var(--app-nav-ink, currentColor);
67
105
  font-size: var(--app-nav-icon-size);
68
106
  line-height: 1;
69
107
  }
70
108
 
71
- .app-nav > a:hover {
72
- background: var(--surface-subtle);
109
+ /* A tile without an icon has nothing else to carry its state. Without :has()
110
+ it shows the label color alone, and forced colors keep their frame. */
111
+ .app-nav > :is(a, button):not(:has(> :where(svg, img, [aria-hidden="true"]))) {
112
+ background: var(--app-nav-fill, transparent);
113
+ }
114
+
115
+ /* :where() keeps hover below the current tile, as when tiles were links only:
116
+ :is(button:enabled) would raise hover over a[aria-current] and repaint it. */
117
+ .app-nav > :where(a, button:enabled):hover {
118
+ --app-nav-fill: var(--surface-subtle);
119
+
73
120
  color: var(--text);
74
121
  }
75
122
 
76
123
  /* Same contextual hover as .nav-link (navbar.css): a tint of the tile's ink
77
124
  reads on any --ui-* bar; the baseline keeps a legible light chip. */
78
125
  @supports (color: color-mix(in oklch, red, white)) {
79
- .app-nav > a:hover {
80
- background: color-mix(in oklch, currentColor 10%, transparent);
126
+ .app-nav > :where(a, button:enabled):hover {
127
+ --app-nav-fill: color-mix(in oklch, currentColor 10%, transparent);
128
+
81
129
  color: var(--ui-fg, var(--text));
82
130
  }
83
131
  }
84
132
 
85
- /* Current tile is already a full selected surface. Selection never changes
86
- text metrics: the shared medium weight is kept. The forced-colors cue is a
87
- transparent border on a ::before overlay, not on the tile: an element border
88
- shrinks the content box, and the side layout starts its content at the inline
89
- edge, so the icon and label shifted by --border-width when a tile became
90
- current. The overlay costs no layout, yet forced colors still turn its
91
- transparent border into a system-color frame once --state-selected flattens
92
- to the bar's own Canvas. No forced-colors repaint: a Highlight fill put
93
- HighlightText on Chromium's Canvas backplate, which hid the label. The
133
+ /* Selection never changes text metrics: the shared medium weight is kept. The
134
+ label sits on the bar, not on the fill, so it takes the bar's full ink; the
135
+ selected ink goes to what the fill paints. The forced-colors cue is a
136
+ transparent border on a ::before overlay of the tile, not on the tile: an
137
+ element border shrinks the content box, and the side layout starts its
138
+ content at the inline edge, so the icon and label shifted by --border-width
139
+ when a tile became current. The overlay costs no layout, yet forced colors
140
+ still turn its transparent border into a system-color frame once the fill
141
+ flattens to the bar's own Canvas. No forced-colors repaint: a Highlight fill
142
+ put HighlightText on Chromium's Canvas backplate, which hid the label. The
94
143
  positioning context is on every link so it does not move when one becomes
95
- current or an application places its own decoration. */
144
+ current or an application places its own decoration. A pale
145
+ --app-nav-current-bg must still stand out from the nav surface: its
146
+ contrast is the theme's to keep. */
96
147
  .app-nav > a[aria-current="page"] {
97
- background: var(--state-selected);
98
- color: var(--state-selected-fg);
148
+ --app-nav-fill: var(--app-nav-current-bg, var(--state-selected));
149
+ --app-nav-ink: var(--app-nav-current-fg, var(--state-selected-fg));
150
+
151
+ color: var(--ui-fg, var(--text));
152
+ }
153
+
154
+ .app-nav > a[aria-current="page"]:not(:has(> :where(svg, img, [aria-hidden="true"]))) {
155
+ color: var(--app-nav-ink);
99
156
  }
100
157
 
101
158
  .app-nav > a[aria-current="page"]::before {
@@ -104,6 +104,7 @@
104
104
 
105
105
  button.avatar {
106
106
  appearance: none;
107
+ -webkit-appearance: none;
107
108
  cursor: pointer;
108
109
  }
109
110
 
@@ -156,6 +156,11 @@
156
156
  --ui-border: initial;
157
157
  }
158
158
 
159
+ /* A solid pill takes the theme finish like a solid button. */
160
+ .badge.solid {
161
+ background-image: var(--finish, none);
162
+ }
163
+
159
164
  .badge:empty {
160
165
  --badge-size: var(--badge-dot-size);
161
166
  --badge-bg: var(--intent, var(--neutral));
@@ -223,8 +228,9 @@
223
228
  }
224
229
  }
225
230
 
231
+ /* The color alone: the shorthand would drop a solid pill's finish. */
226
232
  :where(a.badge, button.badge):not(:where(:disabled, [aria-disabled="true"])):hover {
227
- background: var(--ui-hover-bg, var(--badge-default-hover-bg));
233
+ background-color: var(--ui-hover-bg, var(--badge-default-hover-bg));
228
234
  }
229
235
 
230
236
  /* Solid and empty badges keep the overlay darkening on hover; soft badges do
@@ -83,7 +83,16 @@
83
83
  );
84
84
  border-block-end-width: var(--btn-border-block-end-width, var(--border-width));
85
85
  border-radius: var(--btn-radius);
86
- background: var(--btn-bg);
86
+ /* why: the fill is a color and the finish (--finish, the token every solid
87
+ fill reads) an image layered over it, so a theme lights every intent the
88
+ same way without restating its color, and the hover (a background-color
89
+ change under an inset overlay) keeps the finish. --btn-bg must stay a
90
+ color: an image there invalidates the declaration. From the border box,
91
+ so a repeated tile does not show its bottom edge in the transparent
92
+ border along the top. */
93
+ background-color: var(--btn-bg);
94
+ background-image: var(--finish, none);
95
+ background-origin: border-box;
87
96
  color: var(--btn-fg);
88
97
  /* why: an unset hook rather than none, so a theme or container can give
89
98
  every button an elevation the hover overlay composes with instead of
@@ -163,6 +172,14 @@
163
172
  --btn-hover-overlay: transparent;
164
173
  }
165
174
 
175
+ /* A finish lights a solid fill: the recipes without one stay flat. A
176
+ declaration, not a reset of --finish, so the token does not stop at the
177
+ button for its content. A theme that wants a sheen on one of them paints
178
+ its own background-image there. */
179
+ .btn:is(.outline, .ghost, .link, .soft, .surface) {
180
+ background-image: none;
181
+ }
182
+
166
183
  /* Shared hover recipe — sets --ui-hover-bg consumed by the hover rule below.
167
184
  Declared outside :hover: the variables resolve only when the hover rule
168
185
  reads them, so the values are inert until interaction. */
@@ -203,7 +220,7 @@
203
220
  /* The .soft/.outline/.ghost hover recipe (--ui-hover-bg) is set locally above;
204
221
  the overlay darkening for solid is .btn-specific. */
205
222
  .btn:not(:where(:disabled, [aria-disabled="true"])):hover {
206
- background: var(--ui-hover-bg, var(--btn-bg));
223
+ background-color: var(--ui-hover-bg, var(--btn-bg));
207
224
  /* Huge inset spread paints the overlay over any border-radius without a
208
225
  pseudo-element; a plain background would replace the fill instead of
209
226
  darkening it. Listed after --btn-shadow, which it must not drop. */
@@ -243,7 +260,7 @@
243
260
  after components and overrides border-radius at equal specificity. */
244
261
 
245
262
  .btn.link:not(:where(:disabled, [aria-disabled="true"])):hover {
246
- background: transparent;
263
+ background-color: transparent;
247
264
  text-decoration-thickness: 0.12em;
248
265
  }
249
266