hydrateless 0.8.0 → 0.9.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 (45) hide show
  1. package/README.md +120 -0
  2. package/dist/accordion.css +20 -8
  3. package/dist/alert.css +15 -7
  4. package/dist/avatar.css +8 -14
  5. package/dist/badge.css +9 -1
  6. package/dist/breadcrumb.css +7 -3
  7. package/dist/button.css +48 -28
  8. package/dist/card.css +8 -5
  9. package/dist/checkbox.css +31 -22
  10. package/dist/combobox.css +43 -15
  11. package/dist/command-palette.css +123 -0
  12. package/dist/components.css +1103 -566
  13. package/dist/disclosure.css +27 -29
  14. package/dist/drawer.css +76 -48
  15. package/dist/dropdown.css +82 -22
  16. package/dist/field.css +5 -4
  17. package/dist/hydrateless.css +1333 -1321
  18. package/dist/hydrateless.min.css +1 -1
  19. package/dist/input.css +20 -17
  20. package/dist/kbd.css +4 -3
  21. package/dist/menu.css +91 -45
  22. package/dist/modal.css +63 -14
  23. package/dist/pagination.css +20 -11
  24. package/dist/popover.css +34 -12
  25. package/dist/progress.css +23 -12
  26. package/dist/{radio.css → radio-group.css} +23 -16
  27. package/dist/reset.css +7 -2
  28. package/dist/{segmented.css → segmented-control.css} +21 -10
  29. package/dist/select.css +28 -22
  30. package/dist/separator.css +9 -9
  31. package/dist/skeleton.css +18 -10
  32. package/dist/skip-link.css +13 -8
  33. package/dist/slider.css +28 -25
  34. package/dist/spinner.css +17 -14
  35. package/dist/switch.css +55 -18
  36. package/dist/table.css +52 -15
  37. package/dist/tabs.css +35 -11
  38. package/dist/textarea.css +26 -12
  39. package/dist/theme.css +5 -24
  40. package/dist/toast.css +40 -36
  41. package/dist/toc.css +17 -4
  42. package/dist/tokens.css +208 -179
  43. package/dist/tooltip.css +45 -15
  44. package/package.json +4 -4
  45. package/dist/command.css +0 -102
@@ -1,5 +1,11 @@
1
1
  @layer reset, tokens, theme, components;
2
2
 
3
+ /**
4
+ * Reset: a minimal, opinion-light baseline (border-box sizing, no default
5
+ * margins, inherited form typography). Lives in the lowest layer so any
6
+ * component or author rule wins without specificity games.
7
+ */
8
+
3
9
  @layer reset {
4
10
  *,
5
11
  *::before,
@@ -23,7 +29,7 @@
23
29
 
24
30
  html,
25
31
  body {
26
- height: 100%;
32
+ block-size: 100%;
27
33
  }
28
34
 
29
35
  body {
@@ -37,7 +43,7 @@
37
43
  canvas,
38
44
  svg {
39
45
  display: block;
40
- max-width: 100%;
46
+ max-inline-size: 100%;
41
47
  }
42
48
 
43
49
  input,
@@ -61,88 +67,90 @@
61
67
  @layer tokens {
62
68
  :root {
63
69
  /* Neutral / gray */
64
- --hl-gray-50: hsl(210, 40%, 98%);
65
- --hl-gray-100: hsl(210, 40%, 96%);
66
- --hl-gray-200: hsl(214, 32%, 91%);
67
- --hl-gray-300: hsl(213, 27%, 84%);
68
- --hl-gray-400: hsl(215, 20%, 65%);
69
- --hl-gray-500: hsl(215, 16%, 47%);
70
- --hl-gray-600: hsl(215, 19%, 35%);
71
- --hl-gray-700: hsl(215, 25%, 27%);
72
- --hl-gray-800: hsl(217, 33%, 17%);
73
- --hl-gray-900: hsl(222, 47%, 11%);
74
- --hl-gray-950: hsl(229, 41%, 8%);
70
+ --hl-gray-50: hsl(210deg 40% 98%);
71
+ --hl-gray-100: hsl(210deg 40% 96%);
72
+ --hl-gray-200: hsl(214deg 32% 91%);
73
+ --hl-gray-300: hsl(213deg 27% 84%);
74
+ --hl-gray-400: hsl(215deg 20% 65%);
75
+ --hl-gray-500: hsl(215deg 16% 47%);
76
+ --hl-gray-600: hsl(215deg 19% 35%);
77
+ --hl-gray-700: hsl(215deg 25% 27%);
78
+ --hl-gray-800: hsl(217deg 33% 17%);
79
+ --hl-gray-900: hsl(222deg 47% 11%);
80
+ --hl-gray-950: hsl(229deg 41% 8%);
75
81
 
76
82
  /* Brand / primary (blue) */
77
- --hl-brand-50: hsl(214, 100%, 97%);
78
- --hl-brand-100: hsl(214, 95%, 93%);
79
- --hl-brand-200: hsl(213, 97%, 87%);
80
- --hl-brand-300: hsl(212, 96%, 78%);
81
- --hl-brand-400: hsl(213, 94%, 68%);
82
- --hl-brand-500: hsl(217, 91%, 60%);
83
- --hl-brand-600: hsl(221, 83%, 53%);
84
- --hl-brand-700: hsl(224, 76%, 48%);
85
- --hl-brand-800: hsl(226, 71%, 40%);
86
- --hl-brand-900: hsl(224, 64%, 33%);
87
- --hl-brand-950: hsl(226, 57%, 21%);
83
+ --hl-brand-50: hsl(214deg 100% 97%);
84
+ --hl-brand-100: hsl(214deg 95% 93%);
85
+ --hl-brand-200: hsl(213deg 97% 87%);
86
+ --hl-brand-300: hsl(212deg 96% 78%);
87
+ --hl-brand-400: hsl(213deg 94% 68%);
88
+ --hl-brand-500: hsl(217deg 91% 60%);
89
+ --hl-brand-600: hsl(221deg 83% 53%);
90
+ --hl-brand-700: hsl(224deg 76% 48%);
91
+ --hl-brand-800: hsl(226deg 71% 40%);
92
+ --hl-brand-900: hsl(224deg 64% 33%);
93
+ --hl-brand-950: hsl(226deg 57% 21%);
88
94
 
89
95
  /* Danger (red) */
90
- --hl-red-50: hsl(0, 86%, 97%);
91
- --hl-red-100: hsl(0, 93%, 94%);
92
- --hl-red-200: hsl(0, 96%, 89%);
93
- --hl-red-300: hsl(0, 94%, 82%);
94
- --hl-red-400: hsl(0, 91%, 71%);
95
- --hl-red-500: hsl(0, 84%, 60%);
96
- --hl-red-600: hsl(0, 72%, 51%);
97
- --hl-red-700: hsl(0, 74%, 42%);
98
- --hl-red-800: hsl(0, 70%, 35%);
99
- --hl-red-900: hsl(0, 63%, 31%);
100
- --hl-red-950: hsl(0, 75%, 15%);
96
+ --hl-red-50: hsl(0deg 86% 97%);
97
+ --hl-red-100: hsl(0deg 93% 94%);
98
+ --hl-red-200: hsl(0deg 96% 89%);
99
+ --hl-red-300: hsl(0deg 94% 82%);
100
+ --hl-red-400: hsl(0deg 91% 71%);
101
+ --hl-red-500: hsl(0deg 84% 60%);
102
+ --hl-red-600: hsl(0deg 72% 51%);
103
+ --hl-red-700: hsl(0deg 74% 42%);
104
+ --hl-red-800: hsl(0deg 70% 35%);
105
+ --hl-red-900: hsl(0deg 63% 31%);
106
+ --hl-red-950: hsl(0deg 75% 15%);
101
107
 
102
108
  /* Warning (amber) */
103
- --hl-amber-50: hsl(48, 100%, 96%);
104
- --hl-amber-100: hsl(48, 96%, 89%);
105
- --hl-amber-200: hsl(48, 97%, 77%);
106
- --hl-amber-300: hsl(46, 97%, 65%);
107
- --hl-amber-400: hsl(43, 96%, 56%);
108
- --hl-amber-500: hsl(38, 92%, 50%);
109
- --hl-amber-600: hsl(32, 95%, 44%);
110
- --hl-amber-700: hsl(26, 90%, 37%);
111
- --hl-amber-800: hsl(23, 83%, 31%);
112
- --hl-amber-900: hsl(22, 78%, 26%);
113
- --hl-amber-950: hsl(21, 92%, 14%);
109
+ --hl-amber-50: hsl(48deg 100% 96%);
110
+ --hl-amber-100: hsl(48deg 96% 89%);
111
+ --hl-amber-200: hsl(48deg 97% 77%);
112
+ --hl-amber-300: hsl(46deg 97% 65%);
113
+ --hl-amber-400: hsl(43deg 96% 56%);
114
+ --hl-amber-500: hsl(38deg 92% 50%);
115
+ --hl-amber-600: hsl(32deg 95% 44%);
116
+ --hl-amber-700: hsl(26deg 90% 37%);
117
+ --hl-amber-800: hsl(23deg 83% 31%);
118
+ --hl-amber-900: hsl(22deg 78% 26%);
119
+ --hl-amber-950: hsl(21deg 92% 14%);
114
120
 
115
121
  /* Success (green) */
116
- --hl-green-50: hsl(138, 76%, 97%);
117
- --hl-green-100: hsl(141, 84%, 93%);
118
- --hl-green-200: hsl(141, 79%, 85%);
119
- --hl-green-300: hsl(142, 77%, 73%);
120
- --hl-green-400: hsl(142, 69%, 58%);
121
- --hl-green-500: hsl(142, 71%, 45%);
122
- --hl-green-600: hsl(142, 76%, 36%);
123
- --hl-green-700: hsl(142, 72%, 29%);
124
- --hl-green-800: hsl(143, 64%, 24%);
125
- --hl-green-900: hsl(144, 61%, 20%);
126
- --hl-green-950: hsl(145, 80%, 10%);
122
+ --hl-green-50: hsl(138deg 76% 97%);
123
+ --hl-green-100: hsl(141deg 84% 93%);
124
+ --hl-green-200: hsl(141deg 79% 85%);
125
+ --hl-green-300: hsl(142deg 77% 73%);
126
+ --hl-green-400: hsl(142deg 69% 58%);
127
+ --hl-green-500: hsl(142deg 71% 45%);
128
+ --hl-green-600: hsl(142deg 76% 36%);
129
+ --hl-green-700: hsl(142deg 72% 29%);
130
+ --hl-green-800: hsl(143deg 64% 24%);
131
+ --hl-green-900: hsl(144deg 61% 20%);
132
+ --hl-green-950: hsl(145deg 80% 10%);
127
133
 
128
134
  /* Info (sky) */
129
- --hl-sky-50: hsl(204, 100%, 97%);
130
- --hl-sky-100: hsl(204, 94%, 94%);
131
- --hl-sky-200: hsl(201, 94%, 86%);
132
- --hl-sky-300: hsl(199, 95%, 74%);
133
- --hl-sky-400: hsl(198, 93%, 60%);
134
- --hl-sky-500: hsl(199, 89%, 48%);
135
- --hl-sky-600: hsl(200, 98%, 39%);
136
- --hl-sky-700: hsl(201, 96%, 32%);
137
- --hl-sky-800: hsl(201, 90%, 27%);
138
- --hl-sky-900: hsl(202, 80%, 24%);
139
- --hl-sky-950: hsl(202, 80%, 16%);
135
+ --hl-sky-50: hsl(204deg 100% 97%);
136
+ --hl-sky-100: hsl(204deg 94% 94%);
137
+ --hl-sky-200: hsl(201deg 94% 86%);
138
+ --hl-sky-300: hsl(199deg 95% 74%);
139
+ --hl-sky-400: hsl(198deg 93% 60%);
140
+ --hl-sky-500: hsl(199deg 89% 48%);
141
+ --hl-sky-600: hsl(200deg 98% 39%);
142
+ --hl-sky-700: hsl(201deg 96% 32%);
143
+ --hl-sky-800: hsl(201deg 90% 27%);
144
+ --hl-sky-900: hsl(202deg 80% 24%);
145
+ --hl-sky-950: hsl(202deg 80% 16%);
140
146
  }
141
147
  }
142
148
 
143
149
  /**
144
- * Non-color design scales: spacing, radii, typography, elevation, z-index, and
145
- * motion. These are theme-independent and rarely overridden per component.
150
+ * Non-color design scales: spacing, radii, typography, control sizing, z-index,
151
+ * and motion. These are theme-independent and rarely overridden per component.
152
+ * Elevation (shadows) lives in semantic.css because it changes with the color
153
+ * scheme.
146
154
  */
147
155
 
148
156
  @layer tokens {
@@ -180,7 +188,7 @@
180
188
 
181
189
  /* Typography */
182
190
  --hl-font-sans:
183
- ui-sans-serif,system-ui,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans, -apple-system, 'Segoe UI', roboto, helvetica, arial, sans-serif,
191
+ ui-sans-serif, system-ui, -apple-system, 'Segoe UI', roboto, helvetica, arial, sans-serif,
184
192
  'Apple Color Emoji', 'Segoe UI Emoji';
185
193
  --hl-font-mono:
186
194
  ui-monospace, sfmono-regular, 'SF Mono', menlo, consolas, 'Liberation Mono', monospace;
@@ -200,21 +208,30 @@
200
208
  --hl-font-semibold: 600;
201
209
  --hl-font-bold: 700;
202
210
 
203
- /* Elevation (shadows), tuned for light surfaces */
204
- --hl-shadow-xs: 0 1px 2px 0 hsla(222, 47%, 11%, 0.05);
205
- --hl-shadow-sm: 0 1px 3px 0 hsla(222, 47%, 11%, 0.1), 0 1px 2px -1px hsla(222, 47%, 11%, 0.1);
206
- --hl-shadow-md:
207
- 0 4px 6px -1px hsla(222, 47%, 11%, 0.1), 0 2px 4px -2px hsla(222, 47%, 11%, 0.1);
208
- --hl-shadow-lg:
209
- 0 10px 15px -3px hsla(222, 47%, 11%, 0.1), 0 4px 6px -4px hsla(222, 47%, 11%, 0.1);
210
- --hl-shadow-xl:
211
- 0 20px 25px -5px hsla(222, 47%, 11%, 0.1), 0 8px 10px -6px hsla(222, 47%, 11%, 0.1);
212
-
213
211
  /* Control sizing */
212
+
213
+ /* Shared block size of a default (md) control: buttons, inputs, selects, pagination items. */
214
+ --hl-control-block-size: 2.5rem;
214
215
  --hl-control-height-sm: 2rem;
215
- --hl-control-height-md: 2.5rem;
216
+ --hl-control-height-md: var(--hl-control-block-size);
216
217
  --hl-control-height-lg: 3rem;
217
218
 
219
+ /* Overlay sizing */
220
+
221
+ /* Inline size of side surfaces such as the drawer (capped to the viewport in the component). */
222
+ --hl-overlay-inline-size: 28rem;
223
+
224
+ /* Maximum inline size of a centered modal dialog. */
225
+ --hl-modal-inline-size: 32rem;
226
+
227
+ /* Interaction states */
228
+
229
+ /* Opacity applied to disabled controls, options, and items. */
230
+ --hl-disabled-opacity: 0.5;
231
+
232
+ /* Gap between a control and its focus-visible outline. */
233
+ --hl-focus-offset: 2px;
234
+
218
235
  /* Z-index scale */
219
236
  --hl-z-base: 0;
220
237
  --hl-z-dropdown: 1000;
@@ -244,270 +261,244 @@
244
261
 
245
262
  /**
246
263
  * Semantic tokens map the raw palette to roles (surface, text, border, intent
247
- * colors). Components reference only these, so theming and dark mode are a
248
- * matter of remapping a couple dozen variables, never touching component CSS.
264
+ * colors, elevation). Components reference only these, so theming and dark
265
+ * mode are a matter of remapping a couple dozen variables, never touching
266
+ * component CSS.
249
267
  *
250
- * Light is the default in `:root`. Dark applies automatically via
251
- * `prefers-color-scheme` (unless `[data-theme="light"]` opts out) and always
252
- * via `[data-theme="dark"]`.
268
+ * Every color is a `light-dark()` pair resolved by `color-scheme`. The root
269
+ * follows the system preference; `[data-theme="light"]` and
270
+ * `[data-theme="dark"]` pin a scheme on any subtree. This is the single place
271
+ * `color-scheme` is declared, so `theme.css` and components must not repeat it.
253
272
  */
254
273
 
255
274
  @layer tokens {
256
275
  :root {
257
- --hl-bg: var(--hl-gray-50);
258
- --hl-surface: hsl(0, 0%, 100%);
259
- --hl-surface-2: var(--hl-gray-100);
260
- --hl-surface-3: var(--hl-gray-200);
261
- --hl-fg: var(--hl-gray-900);
262
- --hl-fg-muted: var(--hl-gray-600);
276
+ color-scheme: light dark;
277
+
278
+ /* Page and surfaces */
279
+
280
+ /* Document background. */
281
+ --hl-bg: light-dark(var(--hl-gray-50), var(--hl-gray-950));
282
+
283
+ /* Default component surface (cards, inputs, dialogs). */
284
+ --hl-surface: light-dark(hsl(0deg 0% 100%), var(--hl-gray-900));
285
+
286
+ /* One step raised or inset surface (hover, secondary buttons, striped rows). */
287
+ --hl-surface-2: light-dark(var(--hl-gray-100), var(--hl-gray-800));
288
+
289
+ /* Two steps raised or inset surface (tracks, skeletons, active states). */
290
+ --hl-surface-3: light-dark(var(--hl-gray-200), var(--hl-gray-700));
291
+
292
+ /* Text */
293
+
294
+ /* Primary text color. */
295
+ --hl-fg: light-dark(var(--hl-gray-900), var(--hl-gray-50));
296
+
297
+ /* Secondary text (descriptions, captions). */
298
+ --hl-fg-muted: light-dark(var(--hl-gray-600), var(--hl-gray-400));
299
+
300
+ /* Tertiary text (placeholders, separators, disabled hints). */
263
301
  --hl-fg-subtle: var(--hl-gray-500);
264
- --hl-border: var(--hl-gray-200);
265
- --hl-border-strong: var(--hl-gray-300);
266
- --hl-ring: var(--hl-brand-500);
302
+
303
+ /* Borders and focus */
304
+
305
+ /* Default hairline border. */
306
+ --hl-border: light-dark(var(--hl-gray-200), var(--hl-gray-800));
307
+
308
+ /* Border for form controls and emphasized dividers. */
309
+ --hl-border-strong: light-dark(var(--hl-gray-300), var(--hl-gray-700));
310
+
311
+ /* Focus ring color. */
312
+ --hl-ring: light-dark(var(--hl-brand-500), var(--hl-brand-400));
313
+
314
+ /* Complete outline value for `:focus-visible`. */
267
315
  --hl-focus-ring: var(--hl-border-width-2) solid var(--hl-ring);
268
- --hl-primary: var(--hl-brand-600);
269
- --hl-primary-hover: var(--hl-brand-700);
270
- --hl-primary-active: var(--hl-brand-800);
271
- --hl-primary-fg: hsl(0, 0%, 100%);
272
- --hl-primary-subtle: var(--hl-brand-50);
273
- --hl-primary-subtle-fg: var(--hl-brand-700);
316
+
317
+ /* Soft halo used instead of an outline on borderless-focus controls (inputs, sliders). */
318
+ --hl-focus-shadow: 0 0 0 3px color-mix(in oklab, var(--hl-ring) 30%, transparent);
319
+
320
+ /* Intent: primary */
321
+ --hl-primary: light-dark(var(--hl-brand-600), var(--hl-brand-500));
322
+ --hl-primary-hover: light-dark(var(--hl-brand-700), var(--hl-brand-400));
323
+ --hl-primary-active: light-dark(var(--hl-brand-800), var(--hl-brand-300));
324
+ --hl-primary-fg: light-dark(hsl(0deg 0% 100%), var(--hl-gray-950));
325
+ --hl-primary-subtle: light-dark(var(--hl-brand-50), hsl(226deg 57% 21% / 0.5));
326
+ --hl-primary-subtle-fg: light-dark(var(--hl-brand-700), var(--hl-brand-200));
327
+
328
+ /* Intent: danger */
274
329
  --hl-danger: var(--hl-red-600);
275
330
  --hl-danger-hover: var(--hl-red-700);
276
- --hl-danger-fg: hsl(0, 0%, 100%);
277
- --hl-danger-subtle: var(--hl-red-50);
278
- --hl-danger-subtle-fg: var(--hl-red-700);
331
+ --hl-danger-fg: hsl(0deg 0% 100%);
332
+ --hl-danger-subtle: light-dark(var(--hl-red-50), hsl(0deg 63% 31% / 0.35));
333
+ --hl-danger-subtle-fg: light-dark(var(--hl-red-700), var(--hl-red-200));
334
+
335
+ /* Intent: success */
279
336
  --hl-success: var(--hl-green-600);
280
337
  --hl-success-hover: var(--hl-green-700);
281
- --hl-success-fg: hsl(0, 0%, 100%);
282
- --hl-success-subtle: var(--hl-green-50);
283
- --hl-success-subtle-fg: var(--hl-green-700);
338
+ --hl-success-fg: hsl(0deg 0% 100%);
339
+ --hl-success-subtle: light-dark(var(--hl-green-50), hsl(144deg 61% 20% / 0.35));
340
+ --hl-success-subtle-fg: light-dark(var(--hl-green-700), var(--hl-green-200));
341
+
342
+ /* Intent: warning */
284
343
  --hl-warning: var(--hl-amber-500);
285
344
  --hl-warning-hover: var(--hl-amber-600);
286
345
  --hl-warning-fg: var(--hl-gray-950);
287
- --hl-warning-subtle: var(--hl-amber-50);
288
- --hl-warning-subtle-fg: var(--hl-amber-800);
346
+ --hl-warning-subtle: light-dark(var(--hl-amber-50), hsl(22deg 78% 26% / 0.35));
347
+ --hl-warning-subtle-fg: light-dark(var(--hl-amber-800), var(--hl-amber-200));
348
+
349
+ /* Intent: info */
289
350
  --hl-info: var(--hl-sky-600);
290
351
  --hl-info-hover: var(--hl-sky-700);
291
- --hl-info-fg: hsl(0, 0%, 100%);
292
- --hl-info-subtle: var(--hl-sky-50);
293
- --hl-info-subtle-fg: var(--hl-sky-700);
294
- --hl-scrim: hsla(222, 47%, 11%, 0.5);
352
+ --hl-info-fg: hsl(0deg 0% 100%);
353
+ --hl-info-subtle: light-dark(var(--hl-sky-50), hsl(202deg 80% 24% / 0.35));
354
+ --hl-info-subtle-fg: light-dark(var(--hl-sky-700), var(--hl-sky-200));
355
+
356
+ /* Overlays */
357
+
358
+ /* Backdrop behind modal dialogs and drawers. */
359
+ --hl-scrim: light-dark(hsl(222deg 47% 11% / 0.5), hsl(0deg 0% 0% / 0.65));
360
+
361
+ /* Surface of floating layers (menus, popovers, listboxes). */
295
362
  --hl-overlay: var(--hl-surface);
363
+
364
+ /* Shadow of floating layers. */
296
365
  --hl-overlay-shadow: var(--hl-shadow-lg);
366
+
367
+ /* Elevation. `light-dark()` only takes colors, so the scheme-dependent part
368
+ is the shadow color; dark surfaces need denser shadows to read as raised. */
369
+
370
+ /* Shadow color for the faintest elevation step. */
371
+ --hl-shadow-color-faint: light-dark(hsl(222deg 47% 11% / 0.05), hsl(0deg 0% 0% / 0.3));
372
+
373
+ /* Shadow color for every other elevation step. */
374
+ --hl-shadow-color: light-dark(hsl(222deg 47% 11% / 0.1), hsl(0deg 0% 0% / 0.45));
375
+ --hl-shadow-xs: 0 1px 2px 0 var(--hl-shadow-color-faint);
376
+ --hl-shadow-sm: 0 1px 3px 0 var(--hl-shadow-color), 0 1px 2px -1px var(--hl-shadow-color);
377
+ --hl-shadow-md: 0 4px 6px -1px var(--hl-shadow-color), 0 2px 4px -2px var(--hl-shadow-color);
378
+ --hl-shadow-lg: 0 10px 15px -3px var(--hl-shadow-color), 0 4px 6px -4px var(--hl-shadow-color);
379
+ --hl-shadow-xl: 0 20px 25px -5px var(--hl-shadow-color), 0 8px 10px -6px var(--hl-shadow-color);
297
380
  }
298
381
 
299
- /* Dark theme values, shared by auto + manual dark. */
300
- @media (prefers-color-scheme: dark) {
301
- :root:not([data-theme='light']) {
302
- --hl-bg: var(--hl-gray-950);
303
- --hl-surface: var(--hl-gray-900);
304
- --hl-surface-2: var(--hl-gray-800);
305
- --hl-surface-3: var(--hl-gray-700);
306
- --hl-fg: var(--hl-gray-50);
307
- --hl-fg-muted: var(--hl-gray-400);
308
- --hl-fg-subtle: var(--hl-gray-500);
309
- --hl-border: var(--hl-gray-800);
310
- --hl-border-strong: var(--hl-gray-700);
311
- --hl-ring: var(--hl-brand-400);
312
- --hl-primary: var(--hl-brand-500);
313
- --hl-primary-hover: var(--hl-brand-400);
314
- --hl-primary-active: var(--hl-brand-300);
315
- --hl-primary-fg: var(--hl-gray-950);
316
- --hl-primary-subtle: hsla(226, 57%, 21%, 0.5);
317
- --hl-primary-subtle-fg: var(--hl-brand-200);
318
- --hl-danger-subtle: hsla(0, 63%, 31%, 0.35);
319
- --hl-danger-subtle-fg: var(--hl-red-200);
320
- --hl-success-subtle: hsla(144, 61%, 20%, 0.35);
321
- --hl-success-subtle-fg: var(--hl-green-200);
322
- --hl-warning-subtle: hsla(22, 78%, 26%, 0.35);
323
- --hl-warning-subtle-fg: var(--hl-amber-200);
324
- --hl-info-subtle: hsla(202, 80%, 24%, 0.35);
325
- --hl-info-subtle-fg: var(--hl-sky-200);
326
- --hl-scrim: hsla(0, 0%, 0%, 0.65);
327
- --hl-shadow-xs: 0 1px 2px 0 hsla(0, 0%, 0%, 0.3);
328
- --hl-shadow-sm: 0 1px 3px 0 hsla(0, 0%, 0%, 0.4), 0 1px 2px -1px hsla(0, 0%, 0%, 0.4);
329
- --hl-shadow-md: 0 4px 6px -1px hsla(0, 0%, 0%, 0.45), 0 2px 4px -2px hsla(0, 0%, 0%, 0.45);
330
- --hl-shadow-lg: 0 10px 15px -3px hsla(0, 0%, 0%, 0.5), 0 4px 6px -4px hsla(0, 0%, 0%, 0.5);
331
- --hl-shadow-xl:
332
- 0 20px 25px -5px hsla(0, 0%, 0%, 0.55), 0 8px 10px -6px hsla(0, 0%, 0%, 0.55);
333
- }
382
+ /* Pin a scheme for a subtree; `light-dark()` picks the matching side. */
383
+ [data-theme='light'] {
384
+ color-scheme: light;
334
385
  }
335
386
 
336
387
  [data-theme='dark'] {
337
- --hl-bg: var(--hl-gray-950);
338
- --hl-surface: var(--hl-gray-900);
339
- --hl-surface-2: var(--hl-gray-800);
340
- --hl-surface-3: var(--hl-gray-700);
341
- --hl-fg: var(--hl-gray-50);
342
- --hl-fg-muted: var(--hl-gray-400);
343
- --hl-fg-subtle: var(--hl-gray-500);
344
- --hl-border: var(--hl-gray-800);
345
- --hl-border-strong: var(--hl-gray-700);
346
- --hl-ring: var(--hl-brand-400);
347
- --hl-primary: var(--hl-brand-500);
348
- --hl-primary-hover: var(--hl-brand-400);
349
- --hl-primary-active: var(--hl-brand-300);
350
- --hl-primary-fg: var(--hl-gray-950);
351
- --hl-primary-subtle: hsla(226, 57%, 21%, 0.5);
352
- --hl-primary-subtle-fg: var(--hl-brand-200);
353
- --hl-danger-subtle: hsla(0, 63%, 31%, 0.35);
354
- --hl-danger-subtle-fg: var(--hl-red-200);
355
- --hl-success-subtle: hsla(144, 61%, 20%, 0.35);
356
- --hl-success-subtle-fg: var(--hl-green-200);
357
- --hl-warning-subtle: hsla(22, 78%, 26%, 0.35);
358
- --hl-warning-subtle-fg: var(--hl-amber-200);
359
- --hl-info-subtle: hsla(202, 80%, 24%, 0.35);
360
- --hl-info-subtle-fg: var(--hl-sky-200);
361
- --hl-scrim: hsla(0, 0%, 0%, 0.65);
362
- --hl-shadow-xs: 0 1px 2px 0 hsla(0, 0%, 0%, 0.3);
363
- --hl-shadow-sm: 0 1px 3px 0 hsla(0, 0%, 0%, 0.4), 0 1px 2px -1px hsla(0, 0%, 0%, 0.4);
364
- --hl-shadow-md: 0 4px 6px -1px hsla(0, 0%, 0%, 0.45), 0 2px 4px -2px hsla(0, 0%, 0%, 0.45);
365
- --hl-shadow-lg: 0 10px 15px -3px hsla(0, 0%, 0%, 0.5), 0 4px 6px -4px hsla(0, 0%, 0%, 0.5);
366
- --hl-shadow-xl: 0 20px 25px -5px hsla(0, 0%, 0%, 0.55), 0 8px 10px -6px hsla(0, 0%, 0%, 0.55);
367
- }
368
-
369
- /* Windows High Contrast / forced-colors: defer to system colors. */
388
+ color-scheme: dark;
389
+ }
390
+
391
+ /* Windows High Contrast / forced-colors: defer to system colors so every
392
+ role stays legible against the user's palette. Components add borders
393
+ where they normally rely on fills alone. */
370
394
  @media (forced-colors: active) {
371
395
  :root {
396
+ --hl-bg: Canvas;
397
+ --hl-surface: Canvas;
398
+ --hl-surface-2: Canvas;
399
+ --hl-surface-3: Canvas;
400
+ --hl-fg: CanvasText;
401
+ --hl-fg-muted: CanvasText;
402
+ --hl-fg-subtle: GrayText;
372
403
  --hl-border: CanvasText;
373
404
  --hl-border-strong: CanvasText;
374
405
  --hl-ring: Highlight;
406
+ --hl-focus-shadow: 0 0 0 3px Highlight;
375
407
  --hl-primary: Highlight;
376
- --hl-primary-fg: Canvas;
408
+ --hl-primary-fg: HighlightText;
409
+ --hl-primary-subtle: Highlight;
410
+ --hl-primary-subtle-fg: HighlightText;
411
+ --hl-scrim: Canvas;
377
412
  }
378
413
  }
379
414
  }
380
415
 
381
- @layer theme {
382
- :root {
383
- --csstools-color-scheme--light: initial;
384
- color-scheme: light dark;
385
- }
386
- @media (prefers-color-scheme: dark){
387
- :root {
388
- --csstools-color-scheme--light: ;
389
- }
390
- }
391
-
392
- [data-theme='light'] {
393
- --csstools-color-scheme--light: initial;
394
- color-scheme: light;
395
- }
396
-
397
- [data-theme='dark'] {
398
- --csstools-color-scheme--light: ;
399
- color-scheme: dark;
400
- }
416
+ /**
417
+ * Theme: document-level defaults built on the semantic tokens. `color-scheme`
418
+ * and the `[data-theme]` switches live in tokens/semantic.css so this file
419
+ * only has to apply the resolved colors and type to the page.
420
+ */
401
421
 
422
+ @layer theme {
402
423
  body {
403
- background-color: hsl(210, 40%, 98%);
404
424
  background-color: var(--hl-bg);
405
- color: hsl(222, 47%, 11%);
406
425
  color: var(--hl-fg);
407
- font-family: ui-sans-serif,system-ui,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans, -apple-system, 'Segoe UI', roboto, helvetica, arial, sans-serif,
408
- 'Apple Color Emoji', 'Segoe UI Emoji';
409
426
  font-family: var(--hl-font-sans);
410
- font-size: 1rem;
411
427
  font-size: var(--hl-text-base);
412
- line-height: 1.5;
413
428
  line-height: var(--hl-leading-normal);
414
429
  -webkit-font-smoothing: antialiased;
415
430
  }
416
431
 
417
- ::-moz-selection {
418
- background-color: rgba(36, 99, 235, 0.3);
419
- }
420
-
421
432
  ::selection {
422
- background-color: rgba(36, 99, 235, 0.3);
423
- }
424
-
425
- @supports (color: color-mix(in lch, red, blue)){
426
- ::-moz-selection {
427
- background-color: color-mix(in oklab, var(--hl-primary) 30%, transparent);
428
- }
429
- ::selection {
430
433
  background-color: color-mix(in oklab, var(--hl-primary) 30%, transparent);
431
434
  }
432
435
  }
433
- }
434
436
 
435
437
  /* Disclosure & layout */
436
438
 
437
439
  /**
438
440
  * Disclosure: a styled native `<details>`. The class and the `data-hl-disclosure`
439
441
  * attribute (which also opts into the state enhancer) are interchangeable, so
440
- * plain HTML needs only one of them. Exclusive groups need no JavaScript:
441
- * give related disclosures the same `name` attribute.
442
+ * plain HTML needs only one of them.
443
+ *
444
+ * No-JS baseline: fully functional; exclusive groups need only a shared `name`
445
+ * attribute. The enhancer mirrors open state into its API and reads no other
446
+ * attributes.
442
447
  */
443
448
 
444
449
  @layer components {
445
- details.hl-disclosure, details[data-hl-disclosure] {
446
- border: 1px solid hsl(214, 32%, 91%);
447
- border: 1px solid var(--hl-border);
448
- border-radius: 0.5rem;
450
+ details:is(.hl-disclosure, [data-hl-disclosure]) {
451
+ border: var(--hl-border-width) solid var(--hl-border);
449
452
  border-radius: var(--hl-radius-lg);
450
- background: hsl(0, 0%, 100%);
451
453
  background: var(--hl-surface);
452
454
  }
453
455
 
454
- details.hl-disclosure > summary, details[data-hl-disclosure] > summary {
456
+ details:is(.hl-disclosure, [data-hl-disclosure]) > summary {
457
+ display: flex;
458
+ align-items: center;
459
+ gap: var(--hl-space-2);
455
460
  list-style: none;
456
461
  cursor: pointer;
457
- padding: 0.75rem 1rem;
458
462
  padding: var(--hl-space-3) var(--hl-space-4);
459
463
  }
460
464
 
461
- details.hl-disclosure > summary::-webkit-details-marker {
462
- display: none;
463
- }
464
-
465
- details[data-hl-disclosure] > summary::-webkit-details-marker {
465
+ details:is(.hl-disclosure, [data-hl-disclosure]) > summary::-webkit-details-marker {
466
466
  display: none;
467
467
  }
468
468
 
469
- details.hl-disclosure > summary:focus-visible {
470
- outline: 2px solid hsl(217, 91%, 60%);
471
- outline: var(--hl-focus-ring);
472
- outline-offset: 2px;
473
- }
474
-
475
- details[data-hl-disclosure] > summary:focus-visible {
476
- outline: 2px solid hsl(217, 91%, 60%);
469
+ details:is(.hl-disclosure, [data-hl-disclosure]) > summary:focus-visible {
477
470
  outline: var(--hl-focus-ring);
478
- outline-offset: 2px;
471
+ outline-offset: var(--hl-focus-offset);
479
472
  }
480
473
 
481
- details.hl-disclosure > summary::after {
474
+ /* The marker sits at the inline end so it lands on the left under RTL. */
475
+ details:is(.hl-disclosure, [data-hl-disclosure]) > summary::after {
482
476
  content: '\25B8';
483
- float: right;
484
- transition: transform 120ms cubic-bezier(0.2, 0, 0, 1);
485
- transition: transform var(--hl-duration-fast) var(--hl-ease-standard);
477
+ margin-inline-start: auto;
478
+ transition: rotate var(--hl-duration-fast) var(--hl-ease-standard);
486
479
  }
487
480
 
488
- details[data-hl-disclosure] > summary::after {
489
- content: '\25B8';
490
- float: right;
491
- transition: transform 120ms cubic-bezier(0.2, 0, 0, 1);
492
- transition: transform var(--hl-duration-fast) var(--hl-ease-standard);
481
+ details:is(.hl-disclosure, [data-hl-disclosure])[open] > summary::after {
482
+ rotate: 90deg;
493
483
  }
494
484
 
495
- details.hl-disclosure[open] > summary::after {
496
- transform: rotate(90deg);
485
+ /* Mirror the marker under RTL so it points into the reading direction, and
486
+ rotate the other way so the open state still points down. */
487
+ details:is(.hl-disclosure, [data-hl-disclosure]):dir(rtl) > summary::after {
488
+ scale: -1 1;
497
489
  }
498
490
 
499
- details[data-hl-disclosure][open] > summary::after {
500
- transform: rotate(90deg);
491
+ details:is(.hl-disclosure, [data-hl-disclosure])[open]:dir(rtl) > summary::after {
492
+ rotate: -90deg;
501
493
  }
502
494
 
503
- details.hl-disclosure > .hl-disclosure-panel, details[data-hl-disclosure] > .hl-disclosure-panel {
504
- padding: 0.75rem 1rem 1rem;
495
+ details:is(.hl-disclosure, [data-hl-disclosure]) > .hl-disclosure-panel {
505
496
  padding: var(--hl-space-3) var(--hl-space-4) var(--hl-space-4);
506
497
  }
507
498
  }
508
499
 
509
500
  /**
510
- * Tabs. Two markups are supported and styled together:
501
+ * Tabs: `<div data-hl-tabs>`. Two markups are supported and styled together:
511
502
  *
512
503
  * - CSS-only baseline: `.hl-tablist` of `<label class="hl-tab">` wrapping a
513
504
  * radio, then a `.hl-tabpanels` of `.hl-tabpanel`s. `:has(input:checked)`
@@ -515,40 +506,45 @@
515
506
  * - Enhanced: the enhancer adds `role="tab"`/`tabpanel`, roving focus, and
516
507
  * `aria-selected`, toggles `[hidden]` on panels, and marks the root
517
508
  * `data-hl-ready`, at which point the no-JS rules below stand down.
509
+ * data-hl-tabs: root
510
+ * data-hl-ready: set by the enhancer
511
+ * `aria-orientation="vertical"` on the tablist stacks the tabs at the
512
+ * inline start of the panels.
518
513
  */
519
514
 
520
515
  @layer components {
521
516
  [data-hl-tabs] {
522
- border: 1px solid hsl(214, 32%, 91%);
523
517
  border: var(--hl-border-width) solid var(--hl-border);
524
- border-radius: 0.5rem;
525
518
  border-radius: var(--hl-radius-lg);
526
519
  }
527
520
 
528
521
  .hl-tablist,
529
522
  [data-hl-tabs] [role='tablist'] {
530
523
  display: flex;
531
- gap: 0.5rem;
532
524
  gap: var(--hl-space-2);
533
- padding: 0.5rem;
534
525
  padding: var(--hl-space-2);
535
- border-bottom: 1px solid hsl(214, 32%, 91%);
536
- border-bottom: var(--hl-border-width) solid var(--hl-border);
526
+ border-block-end: var(--hl-border-width) solid var(--hl-border);
527
+ }
528
+
529
+ [data-hl-tabs]:has(> [role='tablist'][aria-orientation='vertical']) {
530
+ display: flex;
531
+ }
532
+
533
+ [data-hl-tabs] [role='tablist'][aria-orientation='vertical'] {
534
+ flex-direction: column;
535
+ border-block-end: 0;
536
+ border-inline-end: var(--hl-border-width) solid var(--hl-border);
537
537
  }
538
538
 
539
539
  .hl-tab,
540
540
  [data-hl-tabs] [role='tab'] {
541
541
  position: relative;
542
- -webkit-appearance: none;
543
- -moz-appearance: none;
544
- appearance: none;
542
+ appearance: none;
545
543
  display: inline-flex;
546
544
  align-items: center;
547
545
  background: transparent;
548
546
  border: 0;
549
- border-radius: 0.25rem;
550
547
  border-radius: var(--hl-radius-sm);
551
- padding: 0.5rem 0.75rem;
552
548
  padding: var(--hl-space-2) var(--hl-space-3);
553
549
  color: inherit;
554
550
  font: inherit;
@@ -558,10 +554,7 @@
558
554
  /* The baseline keeps selection in a visually hidden radio per tab label. */
559
555
  .hl-tab > input[type='radio'] {
560
556
  position: absolute;
561
- top: 0;
562
- right: 0;
563
- bottom: 0;
564
- left: 0;
557
+ inset: 0;
565
558
  margin: 0;
566
559
  opacity: 0;
567
560
  cursor: pointer;
@@ -569,27 +562,24 @@
569
562
 
570
563
  .hl-tab:has(input:checked),
571
564
  [data-hl-tabs] [role='tab'][aria-selected='true'] {
572
- background: hsl(210, 40%, 96%);
573
565
  background: var(--hl-surface-2);
574
566
  }
575
567
 
576
568
  .hl-tab:has(input:focus-visible),
577
569
  [data-hl-tabs] [role='tab']:focus-visible {
578
- outline: 2px solid hsl(217, 91%, 60%);
579
570
  outline: var(--hl-focus-ring);
580
- outline-offset: 2px;
571
+ outline-offset: var(--hl-focus-offset);
581
572
  }
582
573
 
583
574
  .hl-tab:has(input:disabled),
584
575
  [data-hl-tabs] [role='tab'][disabled],
585
576
  [data-hl-tabs] [role='tab'][aria-disabled='true'] {
586
- opacity: 0.5;
577
+ opacity: var(--hl-disabled-opacity);
587
578
  cursor: not-allowed;
588
579
  }
589
580
 
590
581
  .hl-tabpanel,
591
582
  [data-hl-tabs] [role='tabpanel'] {
592
- padding: 1rem;
593
583
  padding: var(--hl-space-4);
594
584
  }
595
585
 
@@ -643,29 +633,53 @@
643
633
  [data-hl-tabs]:not([data-hl-ready]) [role='tabpanel'] ~ [role='tabpanel'] {
644
634
  display: none;
645
635
  }
636
+
637
+ /* Selection is a fill, which forced colors flatten; use the system highlight
638
+ and give every tab an edge. */
639
+ @media (forced-colors: active) {
640
+ .hl-tab,
641
+ [data-hl-tabs] [role='tab'] {
642
+ border: var(--hl-border-width) solid ButtonBorder;
643
+ }
644
+
645
+ .hl-tab:has(input:checked),
646
+ [data-hl-tabs] [role='tab'][aria-selected='true'] {
647
+ background: Highlight;
648
+ color: HighlightText;
649
+ }
650
+ }
646
651
  }
647
652
 
653
+ /**
654
+ * Accordion: `<div data-hl-accordion>` of native `<details>` items, each with a
655
+ * `<summary>` header and an `.hl-accordion-panel` body.
656
+ *
657
+ * No-JS baseline: `<details>` opens and closes on its own; exclusive groups
658
+ * need only a shared `name` attribute. The enhancer adds arrow-key movement
659
+ * between headers and the value API, and reads nothing else from the markup.
660
+ * data-hl-accordion: root (opts into the enhancer)
661
+ */
662
+
648
663
  @layer components {
649
664
  [data-hl-accordion] {
650
- border: 1px solid hsl(214, 32%, 91%);
651
- border: 1px solid var(--hl-border);
652
- border-radius: 0.5rem;
665
+ border: var(--hl-border-width) solid var(--hl-border);
653
666
  border-radius: var(--hl-radius-lg);
654
667
  }
655
668
 
656
669
  [data-hl-accordion] > details {
657
- border-top: 1px solid hsl(214, 32%, 91%);
658
- border-top: 1px solid var(--hl-border);
670
+ border-block-start: var(--hl-border-width) solid var(--hl-border);
659
671
  }
660
672
 
661
673
  [data-hl-accordion] > details:first-child {
662
- border-top: 0;
674
+ border-block-start: 0;
663
675
  }
664
676
 
665
677
  [data-hl-accordion] > details > summary {
678
+ display: flex;
679
+ align-items: center;
680
+ gap: var(--hl-space-2);
666
681
  list-style: none;
667
682
  cursor: pointer;
668
- padding: 0.75rem 1rem;
669
683
  padding: var(--hl-space-3) var(--hl-space-4);
670
684
  }
671
685
 
@@ -674,36 +688,38 @@
674
688
  }
675
689
 
676
690
  [data-hl-accordion] > details > summary:focus-visible {
677
- outline: 2px solid hsl(217, 91%, 60%);
678
691
  outline: var(--hl-focus-ring);
679
- outline-offset: 2px;
692
+ outline-offset: var(--hl-focus-offset);
680
693
  }
681
694
 
695
+ /* The chevron sits at the inline end so it lands on the left under RTL. */
682
696
  [data-hl-accordion] > details > summary::after {
683
697
  content: '\25BE';
684
- float: right;
685
- transform: rotate(0deg);
686
- transition: transform 120ms cubic-bezier(0.2, 0, 0, 1);
687
- transition: transform var(--hl-duration-fast) var(--hl-ease-standard);
698
+ margin-inline-start: auto;
699
+ transition: rotate var(--hl-duration-fast) var(--hl-ease-standard);
688
700
  }
689
701
 
690
702
  [data-hl-accordion] > details[open] > summary::after {
691
- transform: rotate(180deg);
703
+ rotate: 180deg;
692
704
  }
693
705
 
694
706
  [data-hl-accordion] > details > .hl-accordion-panel {
695
- padding: 0.75rem 1rem 1rem;
696
707
  padding: var(--hl-space-3) var(--hl-space-4) var(--hl-space-4);
697
708
  }
698
709
  }
699
710
 
711
+ /**
712
+ * Table of contents: `<nav data-hl-toc>` with nested `<ul>` lists of anchor
713
+ * links. With no JavaScript it is a plain link list; the enhancer marks the
714
+ * link for the heading in view with `aria-current="true"`.
715
+ * data-hl-toc: the nav
716
+ * data-hl-toc-content: optional element whose headings are observed
717
+ */
718
+
700
719
  @layer components {
701
720
  nav[data-hl-toc] {
702
- border: 1px solid hsl(214, 32%, 91%);
703
- border: 1px solid var(--hl-border);
704
- border-radius: 0.5rem;
721
+ border: var(--hl-border-width) solid var(--hl-border);
705
722
  border-radius: var(--hl-radius-lg);
706
- padding: 0.75rem;
707
723
  padding: var(--hl-space-3);
708
724
  }
709
725
 
@@ -720,32 +736,40 @@
720
736
 
721
737
  nav[data-hl-toc] a {
722
738
  display: block;
723
- padding: 0.25rem 0.5rem;
724
739
  padding: var(--hl-space-1) var(--hl-space-2);
725
- border-radius: 0.25rem;
726
740
  border-radius: var(--hl-radius-sm);
727
741
  color: inherit;
728
- -webkit-text-decoration: none;
729
742
  text-decoration: none;
730
743
  }
731
744
 
732
745
  nav[data-hl-toc] a:focus-visible {
733
- outline: 2px solid hsl(217, 91%, 60%);
734
746
  outline: var(--hl-focus-ring);
735
- outline-offset: -2px;
747
+ outline-offset: calc(var(--hl-focus-offset) * -1);
736
748
  }
737
749
 
738
750
  nav[data-hl-toc] a[aria-current='true'] {
739
- background: hsl(210, 40%, 96%);
740
751
  background: var(--hl-surface-2);
741
752
  }
742
753
 
743
754
  nav[data-hl-toc] ul ul {
744
- padding-left: 0.75rem;
745
- padding-left: var(--hl-space-3);
755
+ padding-inline-start: var(--hl-space-3);
756
+ }
757
+
758
+ @media (forced-colors: active) {
759
+ nav[data-hl-toc] a[aria-current='true'] {
760
+ background: Highlight;
761
+ color: HighlightText;
762
+ }
746
763
  }
747
764
  }
748
765
 
766
+ /**
767
+ * Breadcrumb: `<nav data-hl-breadcrumb aria-label="Breadcrumb">` wrapping an
768
+ * `<ol>` of links; the current page carries `aria-current="page"`. Pure CSS;
769
+ * there is no enhancer. Order follows the writing direction, so the trail
770
+ * reads right to left under RTL.
771
+ */
772
+
749
773
  @layer components {
750
774
  nav[data-hl-breadcrumb] ol {
751
775
  display: flex;
@@ -754,45 +778,36 @@
754
778
  list-style: none;
755
779
  margin: 0;
756
780
  padding: 0;
757
- gap: 0.25rem;
758
781
  gap: var(--hl-space-1);
759
782
  }
760
783
 
761
784
  nav[data-hl-breadcrumb] li {
762
785
  display: flex;
763
786
  align-items: center;
764
- gap: 0.25rem;
765
787
  gap: var(--hl-space-1);
766
788
  }
767
789
 
768
790
  nav[data-hl-breadcrumb] li + li::before {
769
791
  content: '/';
770
- color: hsl(215, 16%, 47%);
771
792
  color: var(--hl-fg-subtle);
772
793
  }
773
794
 
774
795
  nav[data-hl-breadcrumb] a {
775
- color: hsl(221, 83%, 53%);
776
796
  color: var(--hl-primary);
777
- -webkit-text-decoration: none;
778
797
  text-decoration: none;
779
- border-radius: 0.25rem;
780
798
  border-radius: var(--hl-radius-sm);
781
799
  }
782
800
 
783
801
  nav[data-hl-breadcrumb] a:hover {
784
- -webkit-text-decoration: underline;
785
802
  text-decoration: underline;
786
803
  }
787
804
 
788
805
  nav[data-hl-breadcrumb] a:focus-visible {
789
- outline: 2px solid hsl(217, 91%, 60%);
790
806
  outline: var(--hl-focus-ring);
791
- outline-offset: 2px;
807
+ outline-offset: var(--hl-focus-offset);
792
808
  }
793
809
 
794
810
  nav[data-hl-breadcrumb] [aria-current='page'] {
795
- color: hsl(222, 47%, 11%);
796
811
  color: var(--hl-fg);
797
812
  }
798
813
  }
@@ -800,7 +815,8 @@
800
815
  /**
801
816
  * Pagination: `<nav class="hl-pagination" aria-label="Pagination">` wrapping a
802
817
  * list of `.hl-pagination-item` links/buttons; mark the active page with
803
- * `aria-current="page"` and use `.hl-pagination-ellipsis` for gaps.
818
+ * `aria-current="page"` and use `.hl-pagination-ellipsis` for gaps. Pure CSS;
819
+ * there is no enhancer. Item order follows the writing direction.
804
820
  */
805
821
 
806
822
  @layer components {
@@ -808,7 +824,6 @@
808
824
  display: flex;
809
825
  flex-wrap: wrap;
810
826
  align-items: center;
811
- gap: 0.25rem;
812
827
  gap: var(--hl-space-1);
813
828
  margin: 0;
814
829
  padding: 0;
@@ -819,54 +834,39 @@
819
834
  display: inline-flex;
820
835
  align-items: center;
821
836
  justify-content: center;
822
- gap: 0.25rem;
823
837
  gap: var(--hl-space-1);
824
- min-width: 2.25rem;
825
- height: 2.25rem;
826
- padding-left: 0.5rem;
827
- padding-right: 0.5rem;
828
- padding-left: var(--hl-space-2);
829
- padding-right: var(--hl-space-2);
830
- border: 1px solid transparent;
838
+ min-inline-size: var(--hl-control-block-size);
839
+ block-size: var(--hl-control-block-size);
840
+ padding-inline: var(--hl-space-2);
831
841
  border: var(--hl-border-width) solid transparent;
832
- border-radius: 0.375rem;
833
842
  border-radius: var(--hl-radius-md);
834
843
  background: transparent;
835
- color: hsl(222, 47%, 11%);
836
844
  color: var(--hl-fg);
837
845
  font: inherit;
838
- font-size: 0.875rem;
839
846
  font-size: var(--hl-text-sm);
840
- -webkit-text-decoration: none;
841
847
  text-decoration: none;
842
848
  cursor: pointer;
843
- transition: background-color 120ms cubic-bezier(0.2, 0, 0, 1);
844
849
  transition: background-color var(--hl-duration-fast) var(--hl-ease-standard);
845
850
  }
846
851
 
847
852
  .hl-pagination-item:hover {
848
- background: hsl(210, 40%, 96%);
849
853
  background: var(--hl-surface-2);
850
854
  }
851
855
 
852
856
  .hl-pagination-item:focus-visible {
853
- outline: 2px solid hsl(217, 91%, 60%);
854
857
  outline: var(--hl-focus-ring);
855
- outline-offset: 2px;
858
+ outline-offset: var(--hl-focus-offset);
856
859
  }
857
860
 
858
861
  .hl-pagination-item[aria-current='page'] {
859
- background: hsl(221, 83%, 53%);
860
862
  background: var(--hl-primary);
861
- color: hsl(0, 0%, 100%);
862
863
  color: var(--hl-primary-fg);
863
- font-weight: 500;
864
864
  font-weight: var(--hl-font-medium);
865
865
  }
866
866
 
867
867
  .hl-pagination-item[aria-disabled='true'],
868
868
  .hl-pagination-item:disabled {
869
- opacity: 0.45;
869
+ opacity: var(--hl-disabled-opacity);
870
870
  pointer-events: none;
871
871
  }
872
872
 
@@ -874,214 +874,279 @@
874
874
  display: inline-flex;
875
875
  align-items: center;
876
876
  justify-content: center;
877
- min-width: 2.25rem;
878
- height: 2.25rem;
879
- color: hsl(215, 16%, 47%);
877
+ min-inline-size: var(--hl-control-block-size);
878
+ block-size: var(--hl-control-block-size);
880
879
  color: var(--hl-fg-subtle);
881
880
  -webkit-user-select: none;
882
- -moz-user-select: none;
883
881
  user-select: none;
884
882
  }
883
+
884
+ @media (forced-colors: active) {
885
+ .hl-pagination-item[aria-current='page'] {
886
+ border-color: Highlight;
887
+ }
888
+
889
+ .hl-pagination-item[aria-disabled='true'],
890
+ .hl-pagination-item:disabled {
891
+ color: GrayText;
892
+ }
893
+ }
885
894
  }
886
895
 
887
896
  /**
888
897
  * Separator: `<hr class="hl-separator">` or
889
898
  * `<div class="hl-separator" role="separator" aria-orientation="vertical">`.
899
+ * Pure CSS; there is no enhancer.
900
+ * data-hl-orientation: vertical (alternative to aria-orientation)
890
901
  */
891
902
 
892
903
  @layer components {
893
904
  .hl-separator {
894
905
  flex: none;
895
906
  border: 0;
896
- background: hsl(214, 32%, 91%);
897
907
  background: var(--hl-border);
898
908
  }
899
909
 
900
- .hl-separator:not([aria-orientation='vertical']):not([data-hl-orientation='vertical']) {
901
- width: 100%;
902
- height: 1px;
903
- height: var(--hl-border-width);
904
- margin-top: 1rem;
905
- margin-bottom: 1rem;
906
- margin-top: var(--hl-space-4);
907
- margin-bottom: var(--hl-space-4);
910
+ .hl-separator:not([aria-orientation='vertical'], [data-hl-orientation='vertical']) {
911
+ inline-size: 100%;
912
+ block-size: var(--hl-border-width);
913
+ margin-block: var(--hl-space-4);
908
914
  }
909
915
 
910
916
  .hl-separator[aria-orientation='vertical'],
911
917
  .hl-separator[data-hl-orientation='vertical'] {
912
918
  align-self: stretch;
913
- width: 1px;
914
- width: var(--hl-border-width);
915
- min-height: 1rem;
916
- margin-left: 1rem;
917
- margin-right: 1rem;
918
- margin-left: var(--hl-space-4);
919
- margin-right: var(--hl-space-4);
919
+ inline-size: var(--hl-border-width);
920
+ min-block-size: 1rem;
921
+ margin-inline: var(--hl-space-4);
920
922
  }
921
923
  }
922
924
 
923
925
  /* Overlays */
924
926
 
927
+ /**
928
+ * Modal: a native `<dialog class="hl-modal">` (or `<dialog data-hl-modal>`)
929
+ * with optional `.hl-modal-header`, `.hl-modal-body`, and `.hl-modal-footer`.
930
+ *
931
+ * No-JS baseline: `<button command="show-modal" commandfor="id">` opens it and
932
+ * `command="close"` closes it; Escape and the backdrop are native. The
933
+ * enhancer only adds focus return, backdrop dismiss, and the open API, and
934
+ * reads nothing beyond `data-hl-modal`.
935
+ */
936
+
925
937
  @layer components {
926
- .hl-modal {
938
+ :is(.hl-modal, dialog[data-hl-modal]) {
939
+ inline-size: min(90vi, var(--hl-modal-inline-size));
940
+ max-inline-size: none;
941
+ padding: 0;
927
942
  border: none;
928
- border-radius: 0.5rem;
929
943
  border-radius: var(--hl-radius-lg);
930
- padding: 0;
931
- max-width: min(90vw, 640px);
932
- width: 100%;
933
- background: hsl(0, 0%, 100%);
934
944
  background: var(--hl-surface);
935
- color: hsl(222, 47%, 11%);
936
945
  color: var(--hl-fg);
937
- box-shadow: 0 10px 15px -3px hsla(222, 47%, 11%, 0.1), 0 4px 6px -4px hsla(222, 47%, 11%, 0.1);
938
946
  box-shadow: var(--hl-overlay-shadow);
947
+ transition:
948
+ opacity var(--hl-duration-base) var(--hl-ease-standard),
949
+ translate var(--hl-duration-base) var(--hl-ease-standard),
950
+ display var(--hl-duration-base) allow-discrete,
951
+ overlay var(--hl-duration-base) allow-discrete;
952
+ }
953
+
954
+ /* Closed state doubles as the exit target of the transition. */
955
+ :is(.hl-modal, dialog[data-hl-modal]):not([open]) {
956
+ opacity: 0;
957
+ translate: 0 var(--hl-space-2);
958
+ }
959
+
960
+ @starting-style {
961
+ :is(.hl-modal, dialog[data-hl-modal])[open] {
962
+ opacity: 0;
963
+ translate: 0 var(--hl-space-2);
964
+ }
939
965
  }
940
966
 
941
- .hl-modal::backdrop {
942
- background: hsla(222, 47%, 11%, 0.5);
967
+ :is(.hl-modal, dialog[data-hl-modal])::backdrop {
943
968
  background: var(--hl-scrim);
969
+ opacity: 0;
970
+ transition:
971
+ opacity var(--hl-duration-base) var(--hl-ease-standard),
972
+ display var(--hl-duration-base) allow-discrete,
973
+ overlay var(--hl-duration-base) allow-discrete;
974
+ }
975
+
976
+ :is(.hl-modal, dialog[data-hl-modal])[open]::backdrop {
977
+ opacity: 1;
978
+ }
979
+
980
+ @starting-style {
981
+ :is(.hl-modal, dialog[data-hl-modal])[open]::backdrop {
982
+ opacity: 0;
983
+ }
944
984
  }
945
985
 
946
- .hl-modal .hl-modal-header,
947
- .hl-modal .hl-modal-body,
948
- .hl-modal .hl-modal-footer {
949
- padding: 1rem;
986
+ :is(.hl-modal, dialog[data-hl-modal]) :is(.hl-modal-header, .hl-modal-body, .hl-modal-footer) {
950
987
  padding: var(--hl-space-4);
951
988
  }
952
989
 
953
- .hl-modal .hl-modal-header {
954
- border-bottom: 1px solid hsl(214, 32%, 91%);
955
- border-bottom: 1px solid var(--hl-border);
990
+ :is(.hl-modal, dialog[data-hl-modal]) .hl-modal-header {
991
+ border-block-end: var(--hl-border-width) solid var(--hl-border);
956
992
  }
957
993
 
958
- .hl-modal .hl-modal-footer {
959
- border-top: 1px solid hsl(214, 32%, 91%);
960
- border-top: 1px solid var(--hl-border);
994
+ :is(.hl-modal, dialog[data-hl-modal]) .hl-modal-footer {
995
+ border-block-start: var(--hl-border-width) solid var(--hl-border);
961
996
  }
962
997
 
963
- .hl-modal [command='close']:focus-visible {
964
- outline: 2px solid hsl(217, 91%, 60%);
998
+ /* Interactive children inside the dialog get the standard ring. */
999
+ :is(.hl-modal, dialog[data-hl-modal])
1000
+ :is(a, button, input, select, textarea, [tabindex]):focus-visible {
965
1001
  outline: var(--hl-focus-ring);
966
- outline-offset: 2px;
1002
+ outline-offset: var(--hl-focus-offset);
1003
+ }
1004
+
1005
+ /* The dialog loses its shadow in forced colors; a border keeps its edge. */
1006
+ @media (forced-colors: active) {
1007
+ :is(.hl-modal, dialog[data-hl-modal]) {
1008
+ border: var(--hl-border-width) solid CanvasText;
1009
+ }
967
1010
  }
968
1011
  }
969
1012
 
1013
+ /**
1014
+ * Drawer: a native `<dialog class="hl-drawer">` (or `<dialog data-hl-drawer>`)
1015
+ * pinned to one inline edge of the viewport, with optional `.hl-drawer-header`,
1016
+ * `.hl-drawer-body`, and `.hl-drawer-footer`.
1017
+ *
1018
+ * No-JS baseline: `<button command="show-modal" commandfor="id">` opens it and
1019
+ * `command="close"` closes it; Escape is native. The enhancer only adds focus
1020
+ * return, backdrop dismiss, and the open API.
1021
+ * data-hl-side: start | end (default). Logical edges, so they flip under RTL.
1022
+ */
1023
+
970
1024
  @layer components {
971
- dialog.hl-drawer {
972
- border: none;
973
- padding: 0;
974
- width: min(90vw, 360px);
975
- max-height: 100dvh;
1025
+ :is(.hl-drawer, dialog[data-hl-drawer]) {
1026
+ --_slide: 100%;
1027
+
1028
+ inset-block: 0;
1029
+ inset-inline: auto 0;
1030
+ inline-size: min(90vi, var(--hl-overlay-inline-size));
1031
+ block-size: 100dvb;
1032
+ max-block-size: 100dvb;
1033
+ max-inline-size: none;
976
1034
  margin: 0;
977
- background: hsl(0, 0%, 100%);
1035
+ padding: 0;
1036
+ border: none;
978
1037
  background: var(--hl-surface);
979
- color: hsl(222, 47%, 11%);
980
1038
  color: var(--hl-fg);
981
- box-shadow: 0 10px 15px -3px hsla(222, 47%, 11%, 0.1), 0 4px 6px -4px hsla(222, 47%, 11%, 0.1);
982
1039
  box-shadow: var(--hl-overlay-shadow);
1040
+ transition:
1041
+ translate var(--hl-duration-slow) var(--hl-ease-emphasized),
1042
+ display var(--hl-duration-slow) allow-discrete,
1043
+ overlay var(--hl-duration-slow) allow-discrete;
983
1044
  }
984
1045
 
985
- dialog.hl-drawer::backdrop {
986
- background: hsla(222, 47%, 11%, 0.5);
987
- background: var(--hl-scrim);
988
- }
1046
+ :is(.hl-drawer, dialog[data-hl-drawer])[data-hl-side='start'] {
1047
+ --_slide: -100%;
989
1048
 
990
- .hl-drawer[open] {
991
- animation: hl-drawer-in-right 180ms cubic-bezier(0.2, 0, 0, 1);
992
- animation: hl-drawer-in-right var(--hl-duration-base) var(--hl-ease-standard);
1049
+ inset-inline: 0 auto;
993
1050
  }
994
1051
 
995
- @keyframes hl-drawer-in-right {
996
- from {
997
- transform: translateX(100%);
998
- }
1052
+ /* `translate` is physical, so the slide direction mirrors under RTL. */
1053
+ :is(.hl-drawer, dialog[data-hl-drawer]):dir(rtl) {
1054
+ --_slide: -100%;
1055
+ }
999
1056
 
1000
- to {
1001
- transform: translateX(0%);
1002
- }
1057
+ :is(.hl-drawer, dialog[data-hl-drawer])[data-hl-side='start']:dir(rtl) {
1058
+ --_slide: 100%;
1003
1059
  }
1004
1060
 
1005
- @keyframes hl-drawer-in-left {
1006
- from {
1007
- transform: translateX(-100%);
1008
- }
1061
+ /* Closed state doubles as the exit target of the slide. */
1062
+ :is(.hl-drawer, dialog[data-hl-drawer]):not([open]) {
1063
+ translate: var(--_slide) 0;
1064
+ }
1009
1065
 
1010
- to {
1011
- transform: translateX(0%);
1012
- }
1066
+ /* A column so the body scrolls between a fixed header and footer. */
1067
+ :is(.hl-drawer, dialog[data-hl-drawer])[open] {
1068
+ display: flex;
1069
+ flex-direction: column;
1013
1070
  }
1014
1071
 
1015
- @media (prefers-reduced-motion: reduce) {
1016
- .hl-drawer[open] {
1017
- animation: none;
1072
+ @starting-style {
1073
+ :is(.hl-drawer, dialog[data-hl-drawer])[open] {
1074
+ translate: var(--_slide) 0;
1018
1075
  }
1019
1076
  }
1020
1077
 
1021
- .hl-drawer[data-side='left'] {
1022
- width: auto;
1023
- top: 0;
1024
- right: auto;
1025
- bottom: 0;
1026
- left: 0;
1078
+ :is(.hl-drawer, dialog[data-hl-drawer])::backdrop {
1079
+ background: var(--hl-scrim);
1080
+ opacity: 0;
1081
+ transition:
1082
+ opacity var(--hl-duration-slow) var(--hl-ease-standard),
1083
+ display var(--hl-duration-slow) allow-discrete,
1084
+ overlay var(--hl-duration-slow) allow-discrete;
1027
1085
  }
1028
1086
 
1029
- .hl-drawer[data-side='left'][open] {
1030
- animation-name: hl-drawer-in-left;
1087
+ :is(.hl-drawer, dialog[data-hl-drawer])[open]::backdrop {
1088
+ opacity: 1;
1031
1089
  }
1032
1090
 
1033
- .hl-drawer[data-side='right'] {
1034
- width: auto;
1035
- top: 0;
1036
- right: 0;
1037
- bottom: 0;
1038
- left: auto;
1091
+ @starting-style {
1092
+ :is(.hl-drawer, dialog[data-hl-drawer])[open]::backdrop {
1093
+ opacity: 0;
1094
+ }
1039
1095
  }
1040
1096
 
1041
- .hl-drawer .hl-drawer-header,
1042
- .hl-drawer .hl-drawer-body,
1043
- .hl-drawer .hl-drawer-footer {
1044
- padding: 1rem;
1097
+ :is(.hl-drawer, dialog[data-hl-drawer])
1098
+ :is(.hl-drawer-header, .hl-drawer-body, .hl-drawer-footer) {
1045
1099
  padding: var(--hl-space-4);
1046
1100
  }
1047
1101
 
1048
- .hl-drawer .hl-drawer-header {
1049
- border-bottom: 1px solid hsl(214, 32%, 91%);
1050
- border-bottom: 1px solid var(--hl-border);
1102
+ :is(.hl-drawer, dialog[data-hl-drawer]) .hl-drawer-body {
1103
+ flex: 1 1 auto;
1104
+ overflow-y: auto;
1105
+ }
1106
+
1107
+ :is(.hl-drawer, dialog[data-hl-drawer]) .hl-drawer-header {
1108
+ border-block-end: var(--hl-border-width) solid var(--hl-border);
1051
1109
  }
1052
1110
 
1053
- .hl-drawer .hl-drawer-footer {
1054
- border-top: 1px solid hsl(214, 32%, 91%);
1055
- border-top: 1px solid var(--hl-border);
1111
+ :is(.hl-drawer, dialog[data-hl-drawer]) .hl-drawer-footer {
1112
+ border-block-start: var(--hl-border-width) solid var(--hl-border);
1113
+ }
1114
+
1115
+ /* Interactive children inside the drawer get the standard ring. */
1116
+ :is(.hl-drawer, dialog[data-hl-drawer])
1117
+ :is(a, button, input, select, textarea, [tabindex]):focus-visible {
1118
+ outline: var(--hl-focus-ring);
1119
+ outline-offset: var(--hl-focus-offset);
1056
1120
  }
1057
1121
  }
1058
1122
 
1059
1123
  /**
1060
1124
  * Popover: a `[popover] [data-hl-popover]` surface opened by a
1061
- * `<button popovertarget="…">` (or `command="toggle-popover"`). The browser
1062
- * owns the top layer, light-dismiss, and Escape with no JavaScript; the
1063
- * enhancer only mirrors `aria-expanded`, adds optional hover, and runs the JS
1064
- * positioning fallback on engines without CSS anchor positioning.
1125
+ * `<button popovertarget="...">` (or `command="toggle-popover"`).
1126
+ *
1127
+ * No-JS baseline: the browser owns the top layer, light dismiss, and Escape,
1128
+ * so the popover is fully usable with `popover` and `popovertarget` in the
1129
+ * markup. The enhancer only mirrors `aria-expanded`, adds optional hover, and
1130
+ * runs the JS positioning fallback on engines without CSS anchor positioning.
1131
+ * data-hl-popover: the surface (opts into the enhancer)
1065
1132
  */
1066
1133
 
1067
1134
  @layer components {
1068
1135
  [data-hl-popover] {
1069
1136
  margin: 0;
1070
- width: -moz-max-content;
1071
- width: max-content;
1072
- max-width: min(92vw, 22rem);
1073
- border: 1px solid hsl(214, 32%, 91%);
1137
+ inline-size: max-content;
1138
+ max-inline-size: min(92vi, 22rem);
1074
1139
  border: var(--hl-border-width) solid var(--hl-border);
1075
- border-radius: 0.5rem;
1076
1140
  border-radius: var(--hl-radius-lg);
1077
- padding: 0.75rem;
1078
1141
  padding: var(--hl-space-3);
1079
- background: hsl(0, 0%, 100%);
1080
1142
  background: var(--hl-surface);
1081
- color: hsl(222, 47%, 11%);
1082
1143
  color: var(--hl-fg);
1083
- box-shadow: 0 10px 15px -3px hsla(222, 47%, 11%, 0.1), 0 4px 6px -4px hsla(222, 47%, 11%, 0.1);
1084
1144
  box-shadow: var(--hl-overlay-shadow);
1145
+ transition:
1146
+ opacity var(--hl-duration-fast) var(--hl-ease-standard),
1147
+ translate var(--hl-duration-fast) var(--hl-ease-standard),
1148
+ display var(--hl-duration-fast) allow-discrete,
1149
+ overlay var(--hl-duration-fast) allow-discrete;
1085
1150
  }
1086
1151
 
1087
1152
  /* Until the `popover` attribute is present (author omitted it and JS hasn't
@@ -1090,11 +1155,21 @@
1090
1155
  display: none;
1091
1156
  }
1092
1157
 
1093
- /* Engines without the Popover API can't promote it to the top layer, so the
1094
- JS fallback positions it; give it a stacking context to land above content. */
1158
+ /* Closed state and exit target. Engines without the Popover API can't
1159
+ promote it to the top layer, so the JS fallback positions it; the z-index
1160
+ lands it above content. Those engines drop this rule, so nothing is
1161
+ hidden by accident. */
1095
1162
  [data-hl-popover]:not(:popover-open) {
1096
- z-index: 1400;
1097
1163
  z-index: var(--hl-z-popover);
1164
+ opacity: 0;
1165
+ translate: 0 -0.25rem;
1166
+ }
1167
+
1168
+ @starting-style {
1169
+ [data-hl-popover]:popover-open {
1170
+ opacity: 0;
1171
+ translate: 0 -0.25rem;
1172
+ }
1098
1173
  }
1099
1174
 
1100
1175
  /* Modern placement: anchor to the invoking control (the popover's implicit
@@ -1103,24 +1178,33 @@
1103
1178
  @supports (position-area: block-end) {
1104
1179
  [data-hl-popover] {
1105
1180
  position: fixed;
1106
- inset-area: block-end;
1107
1181
  position-area: block-end;
1108
1182
  position-try-fallbacks: flip-block, flip-inline;
1109
- margin-top: 0.25rem;
1110
- margin-bottom: 0.25rem;
1111
- margin-top: var(--hl-space-1);
1112
- margin-bottom: var(--hl-space-1);
1183
+ margin-block: var(--hl-space-1);
1113
1184
  }
1114
1185
  }
1186
+
1187
+ /* Interactive children inside the surface get the standard ring. */
1188
+ [data-hl-popover] :is(a, button, input, select, textarea, [tabindex]):focus-visible {
1189
+ outline: var(--hl-focus-ring);
1190
+ outline-offset: var(--hl-focus-offset);
1191
+ }
1115
1192
  }
1116
1193
 
1117
1194
  /**
1118
1195
  * Tooltip: a `[role="tooltip"]` element described by a `[data-hl-tooltip]`
1119
- * trigger. With no JavaScript it shows on the trigger's `:hover`/`:focus-visible`
1120
- * (the tip must be the trigger's next sibling). When the enhancer runs it marks
1121
- * the trigger `data-hl-tooltip-managed` and drives visibility through
1122
- * `data-hl-tooltip-open` instead, adding show/hide delays, a grace period, and
1123
- * Escape-to-dismiss.
1196
+ * trigger.
1197
+ *
1198
+ * No-JS baseline: the tip (the trigger's next sibling, carrying `hidden`)
1199
+ * shows on the trigger's `:hover`/`:focus-visible`. When the enhancer runs it
1200
+ * marks the trigger `data-hl-tooltip-managed`, promotes the tip to a
1201
+ * `popover="manual"` in the top layer where available (otherwise toggles
1202
+ * `hidden`), and drives visibility through `data-hl-tooltip-open` with show
1203
+ * and hide delays, a grace period, and Escape to dismiss.
1204
+ * data-hl-tooltip: the trigger
1205
+ * data-hl-placement: top (default) | bottom | left | right, on the trigger
1206
+ * data-hl-tooltip-managed: set on the trigger by the enhancer
1207
+ * data-hl-tooltip-open: set on the tip while shown
1124
1208
  */
1125
1209
 
1126
1210
  @layer components {
@@ -1128,33 +1212,44 @@
1128
1212
  /* Fallback placement: the JS positioner writes inline position/inset on
1129
1213
  engines without CSS anchor positioning. */
1130
1214
  position: absolute;
1131
- z-index: 1600;
1132
1215
  z-index: var(--hl-z-tooltip);
1133
- width: -moz-max-content;
1134
- width: max-content;
1135
- max-width: 32ch;
1216
+ inline-size: max-content;
1217
+ max-inline-size: 32ch;
1136
1218
  margin: 0;
1137
- padding: 0.25rem 0.5rem;
1138
1219
  padding: var(--hl-space-1) var(--hl-space-2);
1139
- border-radius: 0.25rem;
1220
+ border: 0;
1140
1221
  border-radius: var(--hl-radius-sm);
1141
- background: hsl(222, 47%, 11%);
1142
1222
  background: var(--hl-fg);
1143
- color: hsl(0, 0%, 100%);
1144
1223
  color: var(--hl-surface);
1145
- font-size: 0.875rem;
1146
1224
  font-size: var(--hl-text-sm);
1225
+ opacity: 0;
1226
+ translate: 0 0.25rem;
1227
+ transition:
1228
+ opacity var(--hl-duration-fast) var(--hl-ease-standard),
1229
+ translate var(--hl-duration-fast) var(--hl-ease-standard),
1230
+ display var(--hl-duration-fast) allow-discrete,
1231
+ overlay var(--hl-duration-fast) allow-discrete;
1147
1232
  }
1148
1233
 
1149
1234
  [role='tooltip'][hidden] {
1150
1235
  display: none;
1151
1236
  }
1152
1237
 
1153
- /* No-JS baseline: reveal while the adjacent trigger is hovered or focused.
1154
- Suppressed once the enhancer takes over (trigger gains -managed). */
1155
- [data-hl-tooltip]:not([data-hl-tooltip-managed]):hover + [role='tooltip'],
1156
- [data-hl-tooltip]:not([data-hl-tooltip-managed]):focus-visible + [role='tooltip'] {
1238
+ /* Shown states: the enhanced popover, the enhanced `hidden` fallback, and
1239
+ the no-JS hover/focus baseline (suppressed once the trigger is managed). */
1240
+ [role='tooltip']:is(:popover-open, [data-hl-tooltip-open]),
1241
+ [data-hl-tooltip]:not([data-hl-tooltip-managed]):is(:hover, :focus-visible) + [role='tooltip'] {
1157
1242
  display: block;
1243
+ opacity: 1;
1244
+ translate: 0 0;
1245
+ }
1246
+
1247
+ @starting-style {
1248
+ [role='tooltip']:is(:popover-open, [data-hl-tooltip-open]),
1249
+ [data-hl-tooltip]:not([data-hl-tooltip-managed]):is(:hover, :focus-visible) + [role='tooltip'] {
1250
+ opacity: 0;
1251
+ translate: 0 0.25rem;
1252
+ }
1158
1253
  }
1159
1254
 
1160
1255
  /* Modern placement: pin above the trigger via the anchor-name the enhancer
@@ -1162,23 +1257,35 @@
1162
1257
  @supports (anchor-name: --x) {
1163
1258
  [role='tooltip'] {
1164
1259
  position: fixed;
1165
- inset-area: block-start;
1260
+ inset: auto;
1166
1261
  position-area: block-start;
1167
1262
  position-try-fallbacks: flip-block;
1168
- margin-top: 0.25rem;
1169
- margin-bottom: 0.25rem;
1170
- margin-top: var(--hl-space-1);
1171
- margin-bottom: var(--hl-space-1);
1263
+ margin-block: var(--hl-space-1);
1264
+ }
1265
+ }
1266
+
1267
+ /* Inverted colors flatten away; keep a visible edge on the system canvas. */
1268
+ @media (forced-colors: active) {
1269
+ [role='tooltip'] {
1270
+ border: var(--hl-border-width) solid CanvasText;
1172
1271
  }
1173
1272
  }
1174
1273
  }
1175
1274
 
1176
1275
  /**
1177
1276
  * Dropdown menu button: `<div data-hl-dropdown>` wrapping a
1178
- * `[data-hl-dropdown-trigger]` button and a `[data-hl-dropdown-menu]` list. The
1179
- * enhancer turns the menu into a native `popover` the trigger controls through
1180
- * `popovertarget`, so opening, Escape, and light-dismiss need no JavaScript;
1181
- * the menu lives in the top layer and is placed with CSS anchor positioning.
1277
+ * `[data-hl-dropdown-trigger]` button and a `[data-hl-dropdown-menu]` list.
1278
+ *
1279
+ * No-JS baseline: the menu is a native `popover` and the trigger points at it
1280
+ * with `popovertarget`, so opening, Escape, and light dismiss work before any
1281
+ * script runs; both attributes must be in the markup. The enhancer adds arrow
1282
+ * keys, typeahead, checkable items, and focus return, and reads:
1283
+ * data-hl-dropdown: root
1284
+ * data-hl-dropdown-trigger: the button
1285
+ * data-hl-dropdown-menu: the `<ul>` (or any list) of items
1286
+ * data-hl-value: an item's value for `hl:select`
1287
+ * Items are `role="menuitem"`, `menuitemcheckbox`, or `menuitemradio`, either
1288
+ * directly in the list, inside `<li>`, or inside `<li><ul role="group">`.
1182
1289
  */
1183
1290
 
1184
1291
  @layer components {
@@ -1188,87 +1295,133 @@
1188
1295
 
1189
1296
  [data-hl-dropdown-menu] {
1190
1297
  margin: 0;
1191
- min-width: 10rem;
1192
- border: 1px solid hsl(214, 32%, 91%);
1298
+ min-inline-size: 10rem;
1193
1299
  border: var(--hl-border-width) solid var(--hl-border);
1194
- border-radius: 0.5rem;
1195
1300
  border-radius: var(--hl-radius-lg);
1196
- background: hsl(0, 0%, 100%);
1197
1301
  background: var(--hl-surface);
1198
- box-shadow: 0 10px 15px -3px hsla(222, 47%, 11%, 0.1), 0 4px 6px -4px hsla(222, 47%, 11%, 0.1);
1199
1302
  box-shadow: var(--hl-overlay-shadow);
1200
- padding: 0.25rem;
1201
1303
  padding: var(--hl-space-1);
1202
1304
  list-style: none;
1305
+ transition:
1306
+ opacity var(--hl-duration-fast) var(--hl-ease-standard),
1307
+ translate var(--hl-duration-fast) var(--hl-ease-standard),
1308
+ display var(--hl-duration-fast) allow-discrete,
1309
+ overlay var(--hl-duration-fast) allow-discrete;
1203
1310
  }
1204
1311
 
1205
- /* Before the menu is promoted to a popover (JS not yet loaded), hide it. */
1206
- [data-hl-dropdown-menu]:not([popover]) {
1207
- display: none;
1208
- }
1209
-
1312
+ /* Closed state doubles as the exit target. Engines without the Popover API
1313
+ drop this rule, so nothing is hidden by accident. */
1210
1314
  [data-hl-dropdown-menu]:not(:popover-open) {
1211
- z-index: 1000;
1212
1315
  z-index: var(--hl-z-dropdown);
1316
+ opacity: 0;
1317
+ translate: 0 -0.25rem;
1318
+ }
1319
+
1320
+ @starting-style {
1321
+ [data-hl-dropdown-menu]:popover-open {
1322
+ opacity: 0;
1323
+ translate: 0 -0.25rem;
1324
+ }
1213
1325
  }
1214
1326
 
1215
1327
  /* Open below the trigger, start-aligned, flipping when cramped. */
1216
1328
  @supports (position-area: block-end) {
1217
1329
  [data-hl-dropdown-menu] {
1218
1330
  position: fixed;
1219
- inset-area: block-end span-inline-end;
1220
1331
  position-area: block-end span-inline-end;
1221
1332
  position-try-fallbacks: flip-block, flip-inline;
1222
- margin-top: 0.25rem;
1223
- margin-bottom: 0.25rem;
1224
- margin-top: var(--hl-space-1);
1225
- margin-bottom: var(--hl-space-1);
1333
+ margin-block: var(--hl-space-1);
1226
1334
  }
1227
1335
  }
1228
1336
 
1229
- [data-hl-dropdown-menu] [role='menuitem'] {
1230
- display: block;
1231
- width: 100%;
1232
- padding: 0.5rem 0.75rem;
1337
+ [data-hl-dropdown-menu] [role='group'] {
1338
+ margin: 0;
1339
+ padding: 0;
1340
+ list-style: none;
1341
+ }
1342
+
1343
+ [data-hl-dropdown-menu] [role^='menuitem'] {
1344
+ display: flex;
1345
+ align-items: center;
1346
+ gap: var(--hl-space-2);
1347
+ inline-size: 100%;
1233
1348
  padding: var(--hl-space-2) var(--hl-space-3);
1234
1349
  border: none;
1235
- border-radius: 0.25rem;
1236
1350
  border-radius: var(--hl-radius-sm);
1237
1351
  background: transparent;
1238
- text-align: left;
1352
+ text-align: start;
1239
1353
  cursor: pointer;
1240
1354
  color: inherit;
1241
1355
  font: inherit;
1242
1356
  }
1243
1357
 
1244
- [data-hl-dropdown-menu] [role='menuitem']:hover,
1245
- [data-hl-dropdown-menu] [role='menuitem'][data-hl-active] {
1246
- background: hsl(210, 40%, 96%);
1358
+ [data-hl-dropdown-menu] [role^='menuitem']:hover {
1247
1359
  background: var(--hl-surface-2);
1248
1360
  }
1249
1361
 
1250
- [data-hl-dropdown-menu] [role='menuitem']:focus-visible {
1251
- outline: 2px solid hsl(217, 91%, 60%);
1362
+ [data-hl-dropdown-menu] [role^='menuitem']:focus-visible {
1252
1363
  outline: var(--hl-focus-ring);
1253
- outline-offset: -2px;
1364
+ outline-offset: calc(var(--hl-focus-offset) * -1);
1365
+ }
1366
+
1367
+ /* Checkable items reserve room for a mark so labels line up. */
1368
+ [data-hl-dropdown-menu] :is([role='menuitemcheckbox'], [role='menuitemradio'])::before {
1369
+ content: '';
1370
+ flex: none;
1371
+ inline-size: 1em;
1372
+ block-size: 1em;
1373
+ line-height: 1;
1374
+ text-align: center;
1375
+ color: var(--hl-primary);
1376
+ }
1377
+
1378
+ [data-hl-dropdown-menu] [role='menuitemcheckbox'][aria-checked='true']::before {
1379
+ content: '\2713';
1380
+ }
1381
+
1382
+ [data-hl-dropdown-menu] [role='menuitemradio'][aria-checked='true']::before {
1383
+ background: currentcolor;
1384
+ border-radius: var(--hl-radius-full);
1385
+ scale: 0.5;
1386
+ }
1387
+
1388
+ [data-hl-dropdown-menu] [role^='menuitem']:is(:disabled, [aria-disabled='true']) {
1389
+ opacity: var(--hl-disabled-opacity);
1390
+ cursor: not-allowed;
1254
1391
  }
1255
1392
 
1256
1393
  [data-hl-dropdown-menu] [role='separator'] {
1257
- height: 1px;
1258
- margin: 0.25rem 0;
1394
+ block-size: var(--hl-border-width);
1259
1395
  margin: var(--hl-space-1) 0;
1260
- background: hsl(214, 32%, 91%);
1261
1396
  background: var(--hl-border);
1262
1397
  border: none;
1263
1398
  }
1399
+
1400
+ @media (forced-colors: active) {
1401
+ [data-hl-dropdown-menu] [role^='menuitem']:is(:disabled, [aria-disabled='true']) {
1402
+ color: GrayText;
1403
+ }
1404
+
1405
+ [data-hl-dropdown-menu] [role='separator'] {
1406
+ background: CanvasText;
1407
+ }
1408
+ }
1264
1409
  }
1265
1410
 
1266
1411
  /**
1267
- * Menubar / navigation menu: `<ul data-hl-menu role="menubar">` with optional
1268
- * single-level submenus (`<ul role="menu" data-hl-menu-submenu>`). The enhancer
1269
- * handles roving focus, arrow navigation, and open/close, promoting each
1270
- * submenu to a native popover so it renders in the top layer, anchored to its
1271
- * trigger with CSS anchor positioning.
1412
+ * Menubar / navigation menu: `<ul data-hl-menu role="menubar">` of `<li>`
1413
+ * items, each optionally holding a trigger and a single-level submenu
1414
+ * (`<ul role="menu">` or `[data-hl-menu-submenu]`) as siblings inside the `<li>`.
1415
+ *
1416
+ * No-JS baseline: a submenu shows while its `<li>` is hovered or has focus
1417
+ * within it, so every link stays reachable by mouse and keyboard. The enhancer
1418
+ * marks the root `data-hl-ready`, after which it owns visibility (`hidden`
1419
+ * plus a top-layer `popover`) and adds roving focus, arrow keys, typeahead,
1420
+ * and checkable items. It reads:
1421
+ * data-hl-menu: root; `aria-orientation="vertical"` stacks it
1422
+ * data-hl-menu-submenu: a submenu without `role="menu"`
1423
+ * data-hl-value: a top-level trigger's value for `hl:change`
1424
+ * data-hl-ready: set by the enhancer
1272
1425
  */
1273
1426
 
1274
1427
  @layer components {
@@ -1276,10 +1429,8 @@
1276
1429
  display: flex;
1277
1430
  flex-wrap: wrap;
1278
1431
  align-items: center;
1279
- gap: 0.25rem;
1280
1432
  gap: var(--hl-space-1);
1281
1433
  margin: 0;
1282
- padding: 0.25rem;
1283
1434
  padding: var(--hl-space-1);
1284
1435
  list-style: none;
1285
1436
  }
@@ -1293,303 +1444,294 @@
1293
1444
  position: relative;
1294
1445
  }
1295
1446
 
1296
- [data-hl-menu] [role='menuitem'] {
1447
+ [data-hl-menu] [role^='menuitem'] {
1297
1448
  display: flex;
1298
1449
  align-items: center;
1299
- gap: 0.5rem;
1300
1450
  gap: var(--hl-space-2);
1301
- width: 100%;
1302
- padding: 0.5rem 0.75rem;
1451
+ inline-size: 100%;
1303
1452
  padding: var(--hl-space-2) var(--hl-space-3);
1304
1453
  border: 0;
1305
- border-radius: 0.375rem;
1306
1454
  border-radius: var(--hl-radius-md);
1307
1455
  background: transparent;
1308
- color: hsl(222, 47%, 11%);
1309
1456
  color: var(--hl-fg);
1310
1457
  font: inherit;
1311
- font-size: 0.875rem;
1312
1458
  font-size: var(--hl-text-sm);
1313
- text-align: left;
1314
- -webkit-text-decoration: none;
1459
+ text-align: start;
1315
1460
  text-decoration: none;
1316
1461
  white-space: nowrap;
1317
1462
  cursor: pointer;
1318
1463
  }
1319
1464
 
1320
- [data-hl-menu] [role='menuitem']:hover {
1321
- background: hsl(210, 40%, 96%);
1465
+ [data-hl-menu] [role^='menuitem']:hover,
1466
+ [data-hl-menu] [role^='menuitem'][aria-expanded='true'] {
1322
1467
  background: var(--hl-surface-2);
1323
1468
  }
1324
1469
 
1325
- [data-hl-menu] [role='menuitem']:focus-visible {
1326
- outline: 2px solid hsl(217, 91%, 60%);
1470
+ [data-hl-menu] [role^='menuitem']:focus-visible {
1327
1471
  outline: var(--hl-focus-ring);
1328
- outline-offset: -2px;
1472
+ outline-offset: calc(var(--hl-focus-offset) * -1);
1329
1473
  }
1330
1474
 
1331
- [data-hl-menu] [role='menuitem'][aria-expanded='true'] {
1332
- background: hsl(210, 40%, 96%);
1333
- background: var(--hl-surface-2);
1475
+ [data-hl-menu] [role^='menuitem']:is(:disabled, [aria-disabled='true']) {
1476
+ opacity: var(--hl-disabled-opacity);
1477
+ cursor: not-allowed;
1334
1478
  }
1335
1479
 
1336
- [data-hl-menu] [role='menuitem'][aria-haspopup]::after {
1480
+ /* Submenu chevron: a rotated square corner at the inline end. */
1481
+ [data-hl-menu] [role^='menuitem'][aria-haspopup]::after {
1337
1482
  content: '';
1338
- width: 0.4rem;
1339
- height: 0.4rem;
1340
- margin-left: auto;
1341
- border-right: 1.5px solid currentcolor;
1342
- border-bottom: 1.5px solid currentcolor;
1343
- transform: rotate(45deg);
1483
+ inline-size: 0.4rem;
1484
+ block-size: 0.4rem;
1485
+ margin-inline-start: auto;
1486
+ border-inline-end: 1.5px solid currentcolor;
1487
+ border-block-end: 1.5px solid currentcolor;
1488
+ rotate: 45deg;
1344
1489
  opacity: 0.6;
1345
1490
  }
1346
1491
 
1347
- [data-hl-menu] [role='menu'] {
1492
+ [data-hl-menu] :is([role='menu'], [data-hl-menu-submenu]) {
1348
1493
  position: absolute;
1349
- top: calc(100% + 0.25rem);
1350
- top: calc(100% + var(--hl-space-1));
1351
- left: 0;
1352
- z-index: 1000;
1494
+ inset-block-start: calc(100% + var(--hl-space-1));
1495
+ inset-inline-start: 0;
1353
1496
  z-index: var(--hl-z-dropdown);
1354
- min-width: 12rem;
1497
+ min-inline-size: 12rem;
1355
1498
  margin: 0;
1356
- padding: 0.25rem;
1357
1499
  padding: var(--hl-space-1);
1358
1500
  list-style: none;
1359
- background: hsl(0, 0%, 100%);
1360
1501
  background: var(--hl-overlay);
1361
- border: 1px solid hsl(214, 32%, 91%);
1362
1502
  border: var(--hl-border-width) solid var(--hl-border);
1363
- border-radius: 0.5rem;
1364
1503
  border-radius: var(--hl-radius-lg);
1365
- box-shadow: 0 10px 15px -3px hsla(222, 47%, 11%, 0.1), 0 4px 6px -4px hsla(222, 47%, 11%, 0.1);
1366
1504
  box-shadow: var(--hl-overlay-shadow);
1505
+ transition:
1506
+ opacity var(--hl-duration-fast) var(--hl-ease-standard),
1507
+ translate var(--hl-duration-fast) var(--hl-ease-standard),
1508
+ display var(--hl-duration-fast) allow-discrete,
1509
+ overlay var(--hl-duration-fast) allow-discrete;
1367
1510
  }
1368
1511
 
1369
- [data-hl-menu][aria-orientation='vertical'] [role='menu'] {
1370
- top: 0;
1371
- left: calc(100% + 0.25rem);
1372
- left: calc(100% + var(--hl-space-1));
1512
+ [data-hl-menu][aria-orientation='vertical'] :is([role='menu'], [data-hl-menu-submenu]) {
1513
+ inset-block-start: 0;
1514
+ inset-inline-start: calc(100% + var(--hl-space-1));
1373
1515
  }
1374
1516
 
1375
- [data-hl-menu] [role='menu'][hidden] {
1517
+ /* Closed states: `hidden` (enhancer without Popover API), a closed popover
1518
+ (enhancer with it), and the no-JS baseline below. Each is also the exit
1519
+ target of the transition. */
1520
+ [data-hl-menu]
1521
+ :is([role='menu'], [data-hl-menu-submenu]):is([hidden], [popover]:not(:popover-open)),
1522
+ [data-hl-menu]:not([data-hl-ready]) :is([role='menu'], [data-hl-menu-submenu]) {
1376
1523
  display: none;
1524
+ opacity: 0;
1525
+ translate: 0 -0.25rem;
1526
+ }
1527
+
1528
+ /* No-JS baseline: reveal on hover or focus within the parent item. */
1529
+ [data-hl-menu]:not([data-hl-ready])
1530
+ li:is(:hover, :focus-within)
1531
+ > :is([role='menu'], [data-hl-menu-submenu]) {
1532
+ display: block;
1533
+ opacity: 1;
1534
+ translate: 0 0;
1535
+ }
1536
+
1537
+ @starting-style {
1538
+ [data-hl-menu] :is([role='menu'], [data-hl-menu-submenu]) {
1539
+ opacity: 0;
1540
+ translate: 0 -0.25rem;
1541
+ }
1377
1542
  }
1378
1543
 
1379
1544
  /* Enhanced path: the submenu is a native popover in the top layer, anchored
1380
1545
  to its trigger. The absolute-position rules above stay as the fallback for
1381
1546
  engines without the Popover API. */
1382
- [data-hl-menu] [role='menu'][popover] {
1547
+ [data-hl-menu] :is([role='menu'], [data-hl-menu-submenu])[popover] {
1383
1548
  position: fixed;
1384
- top: auto;
1385
- right: auto;
1386
- bottom: auto;
1387
- left: auto;
1549
+ inset: auto;
1388
1550
  }
1389
1551
 
1390
1552
  @supports (position-area: block-end) {
1391
- [data-hl-menu] [role='menu'][popover] {
1392
- inset-area: block-end span-inline-end;
1553
+ [data-hl-menu] :is([role='menu'], [data-hl-menu-submenu])[popover] {
1393
1554
  position-area: block-end span-inline-end;
1394
1555
  position-try-fallbacks: flip-block, flip-inline;
1395
- margin-top: 0.25rem;
1396
- margin-bottom: 0.25rem;
1397
- margin-top: var(--hl-space-1);
1398
- margin-bottom: var(--hl-space-1);
1556
+ margin-block: var(--hl-space-1);
1399
1557
  }
1400
1558
 
1401
- [data-hl-menu][aria-orientation='vertical'] [role='menu'][popover] {
1402
- inset-area: inline-end span-block-end;
1559
+ [data-hl-menu][aria-orientation='vertical']
1560
+ :is([role='menu'], [data-hl-menu-submenu])[popover] {
1403
1561
  position-area: inline-end span-block-end;
1404
1562
  position-try-fallbacks: flip-inline, flip-block;
1405
- margin-top: 0;
1406
- margin-bottom: 0;
1407
- margin-left: 0.25rem;
1408
- margin-right: 0.25rem;
1409
- margin-left: var(--hl-space-1);
1410
- margin-right: var(--hl-space-1);
1563
+ margin-block: 0;
1564
+ margin-inline: var(--hl-space-1);
1411
1565
  }
1412
1566
  }
1413
1567
 
1414
1568
  [data-hl-menu] [role='separator'] {
1415
- height: 1px;
1416
- height: var(--hl-border-width);
1417
- margin: 0.25rem 0;
1569
+ block-size: var(--hl-border-width);
1418
1570
  margin: var(--hl-space-1) 0;
1419
- background: hsl(214, 32%, 91%);
1420
1571
  background: var(--hl-border);
1421
1572
  }
1573
+
1574
+ @media (forced-colors: active) {
1575
+ [data-hl-menu] [role^='menuitem'][aria-expanded='true'] {
1576
+ background: Highlight;
1577
+ color: HighlightText;
1578
+ }
1579
+
1580
+ [data-hl-menu] [role^='menuitem']:is(:disabled, [aria-disabled='true']) {
1581
+ color: GrayText;
1582
+ }
1583
+
1584
+ [data-hl-menu] [role='separator'] {
1585
+ background: CanvasText;
1586
+ }
1587
+ }
1422
1588
  }
1423
1589
 
1590
+ /**
1591
+ * Toast: a `[data-hl-toast-region]` live region fixed to the end corner of the
1592
+ * viewport, holding `[data-hl-toast]` notifications with an optional
1593
+ * `[data-hl-toast-close]` button.
1594
+ *
1595
+ * Toasts are inherently script-driven; with no JavaScript the region is simply
1596
+ * empty. The enhancer creates the toasts and reads:
1597
+ * data-hl-toast-region: the container
1598
+ * data-hl-toast: one notification (created by the enhancer)
1599
+ * data-hl-intent: info (default) | success | warning | danger, on a toast
1600
+ * data-hl-toast-close: dismiss button inside a toast
1601
+ * data-hl-toast-trigger, data-hl-toast-intent, data-hl-toast-duration:
1602
+ * declarative trigger buttons anywhere in the page
1603
+ */
1604
+
1424
1605
  @layer components {
1425
1606
  [data-hl-toast-region] {
1426
1607
  position: fixed;
1427
- z-index: 1500;
1428
1608
  z-index: var(--hl-z-toast);
1429
- bottom: 1rem;
1430
- bottom: var(--hl-space-4);
1431
- right: 1rem;
1432
- right: var(--hl-space-4);
1609
+ inset-block-end: var(--hl-space-4);
1610
+ inset-inline-end: var(--hl-space-4);
1433
1611
  display: flex;
1434
1612
  flex-direction: column-reverse;
1435
- gap: 0.5rem;
1436
1613
  gap: var(--hl-space-2);
1437
1614
  pointer-events: none;
1438
- max-width: min(90vw, 24rem);
1615
+ max-inline-size: min(90vi, 24rem);
1439
1616
  }
1440
1617
 
1441
1618
  [data-hl-toast] {
1442
1619
  pointer-events: auto;
1443
1620
  display: flex;
1444
1621
  align-items: flex-start;
1445
- gap: 0.75rem;
1446
1622
  gap: var(--hl-space-3);
1447
- border: 1px solid hsl(214, 32%, 91%);
1448
- border: 1px solid var(--hl-border);
1449
- border-radius: 0.5rem;
1623
+ border: var(--hl-border-width) solid var(--hl-border);
1450
1624
  border-radius: var(--hl-radius-lg);
1451
- padding: 0.75rem 1rem;
1452
1625
  padding: var(--hl-space-3) var(--hl-space-4);
1453
- background: hsl(0, 0%, 100%);
1454
1626
  background: var(--hl-surface);
1455
- box-shadow: 0 10px 15px -3px hsla(222, 47%, 11%, 0.1), 0 4px 6px -4px hsla(222, 47%, 11%, 0.1);
1456
1627
  box-shadow: var(--hl-overlay-shadow);
1457
- animation: hl-toast-in 180ms cubic-bezier(0.2, 0, 0, 1);
1458
- animation: hl-toast-in var(--hl-duration-base) var(--hl-ease-standard);
1628
+ transition:
1629
+ opacity var(--hl-duration-base) var(--hl-ease-standard),
1630
+ translate var(--hl-duration-base) var(--hl-ease-standard);
1631
+ }
1632
+
1633
+ /* Toasts are inserted by script, so the entry runs from @starting-style. */
1634
+ @starting-style {
1635
+ [data-hl-toast] {
1636
+ opacity: 0;
1637
+ translate: 0 var(--hl-space-2);
1638
+ }
1459
1639
  }
1460
1640
 
1461
- [data-hl-toast][data-hl-variant='success'] {
1462
- border-left: 3px solid hsl(142, 76%, 36%);
1463
- border-left: 3px solid hsl(142deg 76% 36%);
1464
- border-left: 3px solid var(--hl-success);
1641
+ [data-hl-toast][data-hl-intent='success'] {
1642
+ border-inline-start: 3px solid var(--hl-success);
1465
1643
  }
1466
1644
 
1467
- [data-hl-toast][data-hl-variant='warning'] {
1468
- border-left: 3px solid hsl(38, 92%, 50%);
1469
- border-left: 3px solid hsl(38deg 92% 50%);
1470
- border-left: 3px solid var(--hl-warning);
1645
+ [data-hl-toast][data-hl-intent='warning'] {
1646
+ border-inline-start: 3px solid var(--hl-warning);
1471
1647
  }
1472
1648
 
1473
- [data-hl-toast][data-hl-variant='danger'] {
1474
- border-left: 3px solid hsl(0, 72%, 51%);
1475
- border-left: 3px solid hsl(0deg 72% 51%);
1476
- border-left: 3px solid var(--hl-danger);
1649
+ [data-hl-toast][data-hl-intent='danger'] {
1650
+ border-inline-start: 3px solid var(--hl-danger);
1477
1651
  }
1478
1652
 
1479
- [data-hl-toast][data-hl-variant='info'] {
1480
- border-left: 3px solid hsl(200, 98%, 39%);
1481
- border-left: 3px solid hsl(200deg 98% 39%);
1482
- border-left: 3px solid var(--hl-info);
1653
+ [data-hl-toast][data-hl-intent='info'] {
1654
+ border-inline-start: 3px solid var(--hl-info);
1483
1655
  }
1484
1656
 
1485
1657
  [data-hl-toast-close] {
1486
- -webkit-appearance: none;
1487
- -moz-appearance: none;
1488
- appearance: none;
1658
+ appearance: none;
1489
1659
  border: none;
1490
1660
  background: transparent;
1491
1661
  cursor: pointer;
1492
- padding: 0.25rem;
1493
1662
  padding: var(--hl-space-1);
1494
- color: hsl(215, 19%, 35%);
1495
1663
  color: var(--hl-fg-muted);
1496
- margin-left: auto;
1664
+ margin-inline-start: auto;
1497
1665
  flex-shrink: 0;
1498
1666
  font: inherit;
1499
1667
  }
1500
1668
 
1501
1669
  [data-hl-toast-close]:hover {
1502
- color: hsl(222, 47%, 11%);
1503
1670
  color: var(--hl-fg);
1504
1671
  }
1505
1672
 
1506
1673
  [data-hl-toast-close]:focus-visible {
1507
- outline: 2px solid hsl(217, 91%, 60%);
1508
1674
  outline: var(--hl-focus-ring);
1509
- outline-offset: 2px;
1510
- border-radius: 0.25rem;
1675
+ outline-offset: var(--hl-focus-offset);
1511
1676
  border-radius: var(--hl-radius-sm);
1512
1677
  }
1513
-
1514
- @keyframes hl-toast-in {
1515
- from {
1516
- opacity: 0;
1517
- transform: translateY(0.5rem);
1518
- }
1519
-
1520
- to {
1521
- opacity: 1;
1522
- transform: translateY(0);
1523
- }
1524
- }
1525
-
1526
- @media (prefers-reduced-motion: reduce) {
1527
- [data-hl-toast] {
1528
- animation: none;
1529
- }
1530
- }
1531
1678
  }
1532
1679
 
1533
1680
  /**
1534
1681
  * Command palette: `<div data-hl-command>` containing a search input
1535
- * (`[data-hl-command-input]`), an empty state (`[data-hl-command-empty]`), and a
1536
- * `[data-hl-command-list] role="listbox"` of grouped `[role="option"]` items.
1537
- * Often placed inside a `<dialog class="hl-modal">`.
1682
+ * (`.hl-command-input` or `[data-hl-command-input]`), an empty state
1683
+ * (`[data-hl-command-empty]`), and a `[data-hl-command-list] role="listbox"` of
1684
+ * grouped `[role="option"]` items. Often placed inside a `<dialog class="hl-modal">`.
1685
+ *
1686
+ * No-JS baseline: every item is listed and the empty state stays hidden,
1687
+ * since nothing can filter yet. The enhancer marks the root `data-hl-ready`
1688
+ * and then toggles `hidden` on items, groups, and the empty state.
1689
+ * data-hl-command: root
1690
+ * data-hl-command-input: filter field
1691
+ * data-hl-command-list: listbox
1692
+ * data-hl-command-group: a group wrapper (hidden when all its items are)
1693
+ * data-hl-command-empty: "no results" message
1694
+ * data-hl-ready: set by the enhancer
1538
1695
  */
1539
1696
 
1540
1697
  @layer components {
1541
1698
  [data-hl-command] {
1542
1699
  display: flex;
1543
1700
  flex-direction: column;
1544
- min-height: 0;
1701
+ min-block-size: 0;
1545
1702
  overflow: hidden;
1546
- background: hsl(0, 0%, 100%);
1547
1703
  background: var(--hl-overlay);
1548
- border-radius: 0.5rem;
1549
1704
  border-radius: var(--hl-radius-lg);
1550
1705
  }
1551
1706
 
1552
- [data-hl-command-input] {
1707
+ :is(.hl-command-input, [data-hl-command-input]) {
1553
1708
  flex: none;
1554
- width: 100%;
1555
- height: 3rem;
1556
- height: var(--hl-control-height-lg);
1557
- padding-left: 1rem;
1558
- padding-right: 1rem;
1559
- padding-left: var(--hl-space-4);
1560
- padding-right: var(--hl-space-4);
1709
+ inline-size: 100%;
1710
+ block-size: var(--hl-control-height-lg);
1711
+ padding-inline: var(--hl-space-4);
1561
1712
  border: 0;
1562
- border-bottom: 1px solid hsl(214, 32%, 91%);
1563
- border-bottom: 1px solid hsl(214deg 32% 91%);
1564
- border-bottom: var(--hl-border-width) solid var(--hl-border);
1713
+ border-block-end: var(--hl-border-width) solid var(--hl-border);
1565
1714
  border-radius: 0;
1566
1715
  background: transparent;
1567
- color: hsl(222, 47%, 11%);
1568
1716
  color: var(--hl-fg);
1569
1717
  font: inherit;
1570
- font-size: 1rem;
1571
1718
  font-size: var(--hl-text-base);
1572
1719
  }
1573
1720
 
1574
- [data-hl-command-input]:focus-visible {
1575
- outline: none;
1576
- }
1577
-
1578
- [data-hl-command-input]::-moz-placeholder {
1579
- color: hsl(215, 16%, 47%);
1580
- color: var(--hl-fg-subtle);
1721
+ /* The field is flush with the palette edge, so the ring is drawn inward. */
1722
+ :is(.hl-command-input, [data-hl-command-input]):focus-visible {
1723
+ outline: var(--hl-focus-ring);
1724
+ outline-offset: calc(var(--hl-focus-offset) * -1);
1581
1725
  }
1582
1726
 
1583
- [data-hl-command-input]::placeholder {
1584
- color: hsl(215, 16%, 47%);
1727
+ :is(.hl-command-input, [data-hl-command-input])::placeholder {
1585
1728
  color: var(--hl-fg-subtle);
1586
1729
  }
1587
1730
 
1588
1731
  [data-hl-command-list] {
1589
1732
  flex: 1 1 auto;
1590
- max-height: 24rem;
1733
+ max-block-size: 24rem;
1591
1734
  overflow-y: auto;
1592
- padding: 0.5rem;
1593
1735
  padding: var(--hl-space-2);
1594
1736
  }
1595
1737
 
@@ -1598,30 +1740,21 @@
1598
1740
  }
1599
1741
 
1600
1742
  .hl-command-group-label {
1601
- padding: 0.5rem 0.5rem 0.25rem;
1602
1743
  padding: var(--hl-space-2) var(--hl-space-2) var(--hl-space-1);
1603
- font-size: 0.75rem;
1604
1744
  font-size: var(--hl-text-xs);
1605
- font-weight: 600;
1606
1745
  font-weight: var(--hl-font-semibold);
1607
1746
  text-transform: uppercase;
1608
1747
  letter-spacing: 0.04em;
1609
- color: hsl(215, 16%, 47%);
1610
1748
  color: var(--hl-fg-subtle);
1611
1749
  }
1612
1750
 
1613
1751
  [data-hl-command] [role='option'] {
1614
1752
  display: flex;
1615
1753
  align-items: center;
1616
- gap: 0.75rem;
1617
1754
  gap: var(--hl-space-3);
1618
- padding: 0.5rem 0.75rem;
1619
1755
  padding: var(--hl-space-2) var(--hl-space-3);
1620
- border-radius: 0.375rem;
1621
1756
  border-radius: var(--hl-radius-md);
1622
- font-size: 0.875rem;
1623
1757
  font-size: var(--hl-text-sm);
1624
- color: hsl(222, 47%, 11%);
1625
1758
  color: var(--hl-fg);
1626
1759
  cursor: pointer;
1627
1760
  }
@@ -1632,48 +1765,59 @@
1632
1765
 
1633
1766
  [data-hl-command] [role='option']:hover,
1634
1767
  [data-hl-command] [role='option'][aria-selected='true'] {
1635
- background: hsl(214, 100%, 97%);
1636
1768
  background: var(--hl-primary-subtle);
1637
- color: hsl(224, 76%, 48%);
1638
1769
  color: var(--hl-primary-subtle-fg);
1639
1770
  }
1640
1771
 
1772
+ [data-hl-command] [role='option'][aria-disabled='true'] {
1773
+ opacity: var(--hl-disabled-opacity);
1774
+ pointer-events: none;
1775
+ }
1776
+
1641
1777
  [data-hl-command] [role='option'] svg {
1642
- width: 1.1em;
1643
- height: 1.1em;
1778
+ inline-size: 1.1em;
1779
+ block-size: 1.1em;
1644
1780
  flex: none;
1645
1781
  opacity: 0.7;
1646
1782
  }
1647
1783
 
1648
1784
  [data-hl-command-empty] {
1649
- padding: 2rem 1rem;
1650
1785
  padding: var(--hl-space-8) var(--hl-space-4);
1651
1786
  text-align: center;
1652
- font-size: 0.875rem;
1653
1787
  font-size: var(--hl-text-sm);
1654
- color: hsl(215, 19%, 35%);
1655
1788
  color: var(--hl-fg-muted);
1656
1789
  }
1657
1790
 
1658
- [data-hl-command-empty][hidden] {
1791
+ /* No-JS baseline: there is no filtering, so there are never "no results". */
1792
+ [data-hl-command-empty][hidden],
1793
+ [data-hl-command]:not([data-hl-ready]) [data-hl-command-empty] {
1659
1794
  display: none;
1660
1795
  }
1796
+
1797
+ @media (forced-colors: active) {
1798
+ [data-hl-command] [role='option'][aria-selected='true'] {
1799
+ background: Highlight;
1800
+ color: HighlightText;
1801
+ }
1802
+ }
1661
1803
  }
1662
1804
 
1663
1805
  /* Forms */
1664
1806
 
1665
1807
  /**
1666
- * Button: `<button class="hl-button">` (works on `<a>`/`<input>` too).
1808
+ * Button: `<button class="hl-button">` (works on `<a>`/`<input>` too). Pure
1809
+ * CSS; there is no enhancer.
1667
1810
  *
1668
1811
  * Color is driven by a small set of local custom properties so the
1669
- * intent × variant matrix stays DRY: `data-hl-intent` swaps the accent set,
1812
+ * intent by variant matrix stays DRY: `data-hl-intent` swaps the accent set,
1670
1813
  * `data-hl-variant` decides how those values are applied.
1671
1814
  *
1672
1815
  * data-hl-variant: solid (default) | soft | outline | ghost | link
1673
1816
  * data-hl-intent: neutral (default) | primary | danger | success | warning | info
1674
1817
  * data-hl-size: sm | md (default) | lg
1675
- * data-hl-block: stretch to container width
1818
+ * data-hl-block: stretch to the container's inline size
1676
1819
  * data-hl-icon: square, icon-only
1820
+ * data-hl-loading: shows a spinner and blocks interaction
1677
1821
  */
1678
1822
 
1679
1823
  @layer components {
@@ -1693,39 +1837,27 @@
1693
1837
  display: inline-flex;
1694
1838
  align-items: center;
1695
1839
  justify-content: center;
1696
- gap: 0.5rem;
1697
1840
  gap: var(--_gap);
1698
- height: 2.5rem;
1699
- height: var(--_height);
1700
- padding-left: 1rem;
1701
- padding-right: 1rem;
1702
- padding-left: var(--_pad-x);
1703
- padding-right: var(--_pad-x);
1704
- border: 1px solid transparent;
1841
+ block-size: var(--_height);
1842
+ padding-inline: var(--_pad-x);
1705
1843
  border: var(--hl-border-width) solid transparent;
1706
- border-radius: 0.375rem;
1707
1844
  border-radius: var(--hl-radius-md);
1708
1845
  font-family: inherit;
1709
- font-size: 0.875rem;
1710
1846
  font-size: var(--_font);
1711
- font-weight: 500;
1712
1847
  font-weight: var(--hl-font-medium);
1713
1848
  line-height: 1;
1714
1849
  white-space: nowrap;
1715
- -webkit-text-decoration: none;
1716
1850
  text-decoration: none;
1717
1851
  cursor: pointer;
1718
1852
  -webkit-user-select: none;
1719
- -moz-user-select: none;
1720
1853
  user-select: none;
1721
- background: hsl(210, 40%, 96%);
1722
1854
  background: var(--_solid-bg);
1723
- color: hsl(222, 47%, 11%);
1724
1855
  color: var(--_solid-fg);
1725
1856
  transition:
1726
- background-color 120ms cubic-bezier(0.2, 0, 0, 1), border-color 120ms cubic-bezier(0.2, 0, 0, 1), color 120ms cubic-bezier(0.2, 0, 0, 1), box-shadow 120ms cubic-bezier(0.2, 0, 0, 1);
1727
- transition:
1728
- background-color var(--hl-duration-fast) var(--hl-ease-standard), border-color var(--hl-duration-fast) var(--hl-ease-standard), color var(--hl-duration-fast) var(--hl-ease-standard), box-shadow var(--hl-duration-fast) var(--hl-ease-standard);
1857
+ background-color var(--hl-duration-fast) var(--hl-ease-standard),
1858
+ border-color var(--hl-duration-fast) var(--hl-ease-standard),
1859
+ color var(--hl-duration-fast) var(--hl-ease-standard),
1860
+ box-shadow var(--hl-duration-fast) var(--hl-ease-standard);
1729
1861
  }
1730
1862
 
1731
1863
  .hl-button:hover {
@@ -1737,16 +1869,15 @@
1737
1869
  }
1738
1870
 
1739
1871
  .hl-button:focus-visible {
1740
- outline: 2px solid hsl(217, 91%, 60%);
1741
1872
  outline: var(--hl-focus-ring);
1742
- outline-offset: 2px;
1873
+ outline-offset: var(--hl-focus-offset);
1743
1874
  }
1744
1875
 
1745
1876
  .hl-button:disabled,
1746
1877
  .hl-button[aria-disabled='true'],
1747
1878
  .hl-button[data-hl-loading] {
1748
1879
  cursor: not-allowed;
1749
- opacity: 0.55;
1880
+ opacity: var(--hl-disabled-opacity);
1750
1881
  }
1751
1882
 
1752
1883
  .hl-button[data-hl-loading] {
@@ -1815,7 +1946,6 @@
1815
1946
  .hl-button[data-hl-variant='outline'] {
1816
1947
  background: transparent;
1817
1948
  color: var(--_accent);
1818
- border-color: hsl(213, 27%, 84%);
1819
1949
  border-color: var(--hl-border-strong);
1820
1950
  }
1821
1951
 
@@ -1834,12 +1964,11 @@
1834
1964
  }
1835
1965
 
1836
1966
  .hl-button[data-hl-variant='link'] {
1837
- height: auto;
1967
+ block-size: auto;
1838
1968
  padding: 0;
1839
1969
  background: transparent;
1840
1970
  color: var(--_accent);
1841
1971
  border-color: transparent;
1842
- -webkit-text-decoration: underline;
1843
1972
  text-decoration: underline;
1844
1973
  text-underline-offset: 0.2em;
1845
1974
  }
@@ -1855,8 +1984,6 @@
1855
1984
  --_font: var(--hl-text-xs);
1856
1985
  --_gap: var(--hl-space-1);
1857
1986
 
1858
- border-radius: 0.25rem;
1859
-
1860
1987
  border-radius: var(--hl-radius-sm);
1861
1988
  }
1862
1989
 
@@ -1865,42 +1992,39 @@
1865
1992
  --_pad-x: var(--hl-space-5);
1866
1993
  --_font: var(--hl-text-base);
1867
1994
 
1868
- border-radius: 0.5rem;
1869
-
1870
1995
  border-radius: var(--hl-radius-lg);
1871
1996
  }
1872
1997
 
1873
1998
  .hl-button[data-hl-block] {
1874
1999
  display: flex;
1875
- width: 100%;
2000
+ inline-size: 100%;
1876
2001
  }
1877
2002
 
1878
2003
  .hl-button[data-hl-icon] {
1879
- width: var(--_height);
1880
- padding-left: 0;
1881
- padding-right: 0;
2004
+ inline-size: var(--_height);
2005
+ padding-inline: 0;
1882
2006
  }
1883
2007
 
1884
2008
  .hl-button > svg {
1885
- width: 1.1em;
1886
- height: 1.1em;
2009
+ inline-size: 1.1em;
2010
+ block-size: 1.1em;
1887
2011
  flex: none;
1888
2012
  }
1889
2013
 
1890
2014
  .hl-button[data-hl-loading]::before {
1891
2015
  content: '';
1892
- width: 1em;
1893
- height: 1em;
2016
+ inline-size: 1em;
2017
+ block-size: 1em;
1894
2018
  border: 2px solid currentcolor;
1895
- border-top-color: transparent;
1896
- border-radius: 9999px;
2019
+ border-block-start-color: transparent;
1897
2020
  border-radius: var(--hl-radius-full);
1898
2021
  animation: hl-button-spin 0.6s linear infinite;
1899
2022
  }
1900
2023
 
2024
+ /* A static arc still reads as "busy" without continuous motion. */
1901
2025
  @media (prefers-reduced-motion: reduce) {
1902
2026
  .hl-button[data-hl-loading]::before {
1903
- animation-duration: 1.4s;
2027
+ animation: none;
1904
2028
  }
1905
2029
  }
1906
2030
 
@@ -1919,32 +2043,46 @@
1919
2043
  }
1920
2044
 
1921
2045
  .hl-button-group > .hl-button:not(:first-child) {
1922
- margin-left: calc(1px * -1);
1923
- margin-left: calc(var(--hl-border-width) * -1);
2046
+ margin-inline-start: calc(var(--hl-border-width) * -1);
1924
2047
  }
1925
2048
 
1926
2049
  .hl-button-group > .hl-button:first-child {
1927
- border-top-left-radius: 0.375rem;
1928
- border-top-left-radius: var(--hl-radius-md);
1929
- border-bottom-left-radius: 0.375rem;
1930
- border-bottom-left-radius: var(--hl-radius-md);
2050
+ border-start-start-radius: var(--hl-radius-md);
2051
+ border-end-start-radius: var(--hl-radius-md);
1931
2052
  }
1932
2053
 
1933
2054
  .hl-button-group > .hl-button:last-child {
1934
- border-top-right-radius: 0.375rem;
1935
- border-top-right-radius: var(--hl-radius-md);
1936
- border-bottom-right-radius: 0.375rem;
1937
- border-bottom-right-radius: var(--hl-radius-md);
2055
+ border-start-end-radius: var(--hl-radius-md);
2056
+ border-end-end-radius: var(--hl-radius-md);
1938
2057
  }
1939
2058
 
1940
2059
  .hl-button-group > .hl-button:hover,
1941
2060
  .hl-button-group > .hl-button:focus-visible {
1942
2061
  z-index: 1;
1943
2062
  }
2063
+
2064
+ /* Forced colors flatten every fill to Canvas, so the border alone tells a
2065
+ button apart from text; the link variant keeps reading as a link. */
2066
+ @media (forced-colors: active) {
2067
+ .hl-button {
2068
+ border-color: ButtonBorder;
2069
+ }
2070
+
2071
+ .hl-button[data-hl-variant='link'] {
2072
+ border-color: transparent;
2073
+ color: LinkText;
2074
+ }
2075
+
2076
+ .hl-button:disabled,
2077
+ .hl-button[aria-disabled='true'] {
2078
+ color: GrayText;
2079
+ border-color: GrayText;
2080
+ }
2081
+ }
1944
2082
  }
1945
2083
 
1946
2084
  /**
1947
- * Text input: `<input class="hl-input">`.
2085
+ * Text input: `<input class="hl-input">`. Pure CSS; there is no enhancer.
1948
2086
  * data-hl-size: sm | md (default) | lg
1949
2087
  * data-hl-invalid: error styling (pair with aria-invalid)
1950
2088
  */
@@ -1956,93 +2094,56 @@
1956
2094
  --_font: var(--hl-text-sm);
1957
2095
 
1958
2096
  display: block;
1959
- width: 100%;
1960
- height: 2.5rem;
1961
- height: var(--_height);
1962
- padding-left: 0.75rem;
1963
- padding-right: 0.75rem;
1964
- padding-left: var(--_pad-x);
1965
- padding-right: var(--_pad-x);
1966
- border: 1px solid hsl(213, 27%, 84%);
2097
+ inline-size: 100%;
2098
+ block-size: var(--_height);
2099
+ padding-inline: var(--_pad-x);
1967
2100
  border: var(--hl-border-width) solid var(--hl-border-strong);
1968
- border-radius: 0.375rem;
1969
2101
  border-radius: var(--hl-radius-md);
1970
- background: hsl(0, 0%, 100%);
1971
2102
  background: var(--hl-surface);
1972
- color: hsl(222, 47%, 11%);
1973
2103
  color: var(--hl-fg);
1974
2104
  font-family: inherit;
1975
- font-size: 0.875rem;
1976
2105
  font-size: var(--_font);
1977
- line-height: 1.5;
1978
2106
  line-height: var(--hl-leading-normal);
1979
2107
  transition:
1980
- border-color 120ms cubic-bezier(0.2, 0, 0, 1), box-shadow 120ms cubic-bezier(0.2, 0, 0, 1);
1981
- transition:
1982
- border-color var(--hl-duration-fast) var(--hl-ease-standard), box-shadow var(--hl-duration-fast) var(--hl-ease-standard);
1983
- }
1984
-
1985
- .hl-input::-moz-placeholder {
1986
- color: hsl(215, 16%, 47%);
1987
- color: var(--hl-fg-subtle);
2108
+ border-color var(--hl-duration-fast) var(--hl-ease-standard),
2109
+ box-shadow var(--hl-duration-fast) var(--hl-ease-standard);
1988
2110
  }
1989
2111
 
1990
2112
  .hl-input::placeholder {
1991
- color: hsl(215, 16%, 47%);
1992
2113
  color: var(--hl-fg-subtle);
1993
2114
  }
1994
2115
 
1995
- .hl-input:hover:not(:disabled):not(:focus) {
1996
- border-color: hsl(215, 16%, 47%);
2116
+ .hl-input:hover:not(:disabled, :focus) {
1997
2117
  border-color: var(--hl-fg-subtle);
1998
2118
  }
1999
2119
 
2000
2120
  .hl-input:focus-visible {
2001
2121
  outline: none;
2002
- border-color: hsl(217, 91%, 60%);
2003
2122
  border-color: var(--hl-ring);
2004
- box-shadow: 0 0 0 3px rgba(60, 131, 246, 0.3);
2005
- }
2006
-
2007
- @supports (color: color-mix(in lch, red, blue)){
2008
- .hl-input:focus-visible {
2009
- box-shadow: 0 0 0 3px color-mix(in oklab, var(--hl-ring) 30%, transparent);
2123
+ box-shadow: var(--hl-focus-shadow);
2010
2124
  }
2011
- }
2012
2125
 
2013
2126
  .hl-input:disabled {
2014
2127
  cursor: not-allowed;
2015
- opacity: 0.6;
2016
- background: hsl(210, 40%, 96%);
2128
+ opacity: var(--hl-disabled-opacity);
2017
2129
  background: var(--hl-surface-2);
2018
2130
  }
2019
2131
 
2020
2132
  .hl-input[data-hl-invalid],
2021
2133
  .hl-input[aria-invalid='true'] {
2022
- border-color: hsl(0, 72%, 51%);
2023
2134
  border-color: var(--hl-danger);
2024
2135
  }
2025
2136
 
2026
2137
  .hl-input[data-hl-invalid]:focus-visible,
2027
2138
  .hl-input[aria-invalid='true']:focus-visible {
2028
- border-color: hsl(0, 72%, 51%);
2029
2139
  border-color: var(--hl-danger);
2030
- box-shadow: 0 0 0 3px rgba(220, 40, 40, 0.3);
2031
- }
2032
-
2033
- @supports (color: color-mix(in lch, red, blue)){
2034
- .hl-input[data-hl-invalid]:focus-visible,
2035
- .hl-input[aria-invalid='true']:focus-visible {
2036
2140
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--hl-danger) 30%, transparent);
2037
2141
  }
2038
- }
2039
2142
 
2040
2143
  .hl-input[data-hl-size='sm'] {
2041
2144
  --_height: var(--hl-control-height-sm);
2042
2145
  --_font: var(--hl-text-xs);
2043
2146
 
2044
- border-radius: 0.25rem;
2045
-
2046
2147
  border-radius: var(--hl-radius-sm);
2047
2148
  }
2048
2149
 
@@ -2053,113 +2154,101 @@
2053
2154
  }
2054
2155
 
2055
2156
  .hl-input[type='file'] {
2056
- height: auto;
2057
- padding-top: 0.5rem;
2058
- padding-bottom: 0.5rem;
2059
- padding-top: var(--hl-space-2);
2060
- padding-bottom: var(--hl-space-2);
2157
+ block-size: auto;
2158
+ padding-block: var(--hl-space-2);
2061
2159
  }
2062
2160
 
2063
2161
  .hl-input[type='color'] {
2064
- width: var(--_height);
2065
- padding: 0.25rem;
2162
+ inline-size: var(--_height);
2066
2163
  padding: var(--hl-space-1);
2067
2164
  }
2165
+
2166
+ /* Box shadows are dropped in forced colors, so focus falls back to an outline. */
2167
+ @media (forced-colors: active) {
2168
+ .hl-input:focus-visible {
2169
+ outline: var(--hl-focus-ring);
2170
+ outline-offset: var(--hl-focus-offset);
2171
+ }
2172
+ }
2068
2173
  }
2069
2174
 
2070
2175
  /**
2071
- * Multi-line text input: `<textarea class="hl-textarea">`.
2072
- * data-hl-invalid: error styling (pair with aria-invalid)
2176
+ * Multi-line text input: `<textarea class="hl-textarea">`. Pure CSS; there is
2177
+ * no enhancer.
2178
+ * data-hl-invalid: error styling (pair with aria-invalid)
2179
+ * data-hl-autosize: grows with its content where `field-sizing` is supported
2073
2180
  */
2074
2181
 
2075
2182
  @layer components {
2076
2183
  .hl-textarea {
2077
2184
  display: block;
2078
- width: 100%;
2079
- min-height: calc(2.5rem * 2);
2080
- min-height: calc(var(--hl-control-height-md) * 2);
2081
- padding: 0.5rem 0.75rem;
2185
+ inline-size: 100%;
2186
+ min-block-size: calc(var(--hl-control-height-md) * 2);
2082
2187
  padding: var(--hl-space-2) var(--hl-space-3);
2083
- border: 1px solid hsl(213, 27%, 84%);
2084
2188
  border: var(--hl-border-width) solid var(--hl-border-strong);
2085
- border-radius: 0.375rem;
2086
2189
  border-radius: var(--hl-radius-md);
2087
- background: hsl(0, 0%, 100%);
2088
2190
  background: var(--hl-surface);
2089
- color: hsl(222, 47%, 11%);
2090
2191
  color: var(--hl-fg);
2091
2192
  font-family: inherit;
2092
- font-size: 0.875rem;
2093
2193
  font-size: var(--hl-text-sm);
2094
- line-height: 1.5;
2095
2194
  line-height: var(--hl-leading-normal);
2096
2195
  resize: vertical;
2097
2196
  transition:
2098
- border-color 120ms cubic-bezier(0.2, 0, 0, 1), box-shadow 120ms cubic-bezier(0.2, 0, 0, 1);
2099
- transition:
2100
- border-color var(--hl-duration-fast) var(--hl-ease-standard), box-shadow var(--hl-duration-fast) var(--hl-ease-standard);
2101
- }
2102
-
2103
- .hl-textarea::-moz-placeholder {
2104
- color: hsl(215, 16%, 47%);
2105
- color: var(--hl-fg-subtle);
2197
+ border-color var(--hl-duration-fast) var(--hl-ease-standard),
2198
+ box-shadow var(--hl-duration-fast) var(--hl-ease-standard);
2106
2199
  }
2107
2200
 
2108
2201
  .hl-textarea::placeholder {
2109
- color: hsl(215, 16%, 47%);
2110
2202
  color: var(--hl-fg-subtle);
2111
2203
  }
2112
2204
 
2113
- .hl-textarea:hover:not(:disabled):not(:focus) {
2114
- border-color: hsl(215, 16%, 47%);
2205
+ .hl-textarea:hover:not(:disabled, :focus) {
2115
2206
  border-color: var(--hl-fg-subtle);
2116
2207
  }
2117
2208
 
2118
2209
  .hl-textarea:focus-visible {
2119
2210
  outline: none;
2120
- border-color: hsl(217, 91%, 60%);
2121
2211
  border-color: var(--hl-ring);
2122
- box-shadow: 0 0 0 3px rgba(60, 131, 246, 0.3);
2123
- }
2124
-
2125
- @supports (color: color-mix(in lch, red, blue)){
2126
- .hl-textarea:focus-visible {
2127
- box-shadow: 0 0 0 3px color-mix(in oklab, var(--hl-ring) 30%, transparent);
2212
+ box-shadow: var(--hl-focus-shadow);
2128
2213
  }
2129
- }
2130
2214
 
2131
2215
  .hl-textarea:disabled {
2132
2216
  cursor: not-allowed;
2133
- opacity: 0.6;
2134
- background: hsl(210, 40%, 96%);
2217
+ opacity: var(--hl-disabled-opacity);
2135
2218
  background: var(--hl-surface-2);
2136
2219
  }
2137
2220
 
2138
2221
  .hl-textarea[data-hl-invalid],
2139
2222
  .hl-textarea[aria-invalid='true'] {
2140
- border-color: hsl(0, 72%, 51%);
2141
2223
  border-color: var(--hl-danger);
2142
2224
  }
2143
2225
 
2144
2226
  .hl-textarea[data-hl-invalid]:focus-visible,
2145
2227
  .hl-textarea[aria-invalid='true']:focus-visible {
2146
- border-color: hsl(0, 72%, 51%);
2147
2228
  border-color: var(--hl-danger);
2148
- box-shadow: 0 0 0 3px rgba(220, 40, 40, 0.3);
2229
+ box-shadow: 0 0 0 3px color-mix(in oklab, var(--hl-danger) 30%, transparent);
2149
2230
  }
2150
2231
 
2151
- @supports (color: color-mix(in lch, red, blue)){
2152
- .hl-textarea[data-hl-invalid]:focus-visible,
2153
- .hl-textarea[aria-invalid='true']:focus-visible {
2154
- box-shadow: 0 0 0 3px color-mix(in oklab, var(--hl-danger) 30%, transparent);
2232
+ /* Native autosize; engines without it keep the fixed minimum and a resizer. */
2233
+ @supports (field-sizing: content) {
2234
+ .hl-textarea[data-hl-autosize] {
2235
+ field-sizing: content;
2236
+ max-block-size: 60vb;
2237
+ }
2238
+ }
2239
+
2240
+ @media (forced-colors: active) {
2241
+ .hl-textarea:focus-visible {
2242
+ outline: var(--hl-focus-ring);
2243
+ outline-offset: var(--hl-focus-offset);
2244
+ }
2155
2245
  }
2156
- }
2157
2246
  }
2158
2247
 
2159
2248
  /**
2160
2249
  * Native select: `<span class="hl-select-wrapper"><select class="hl-select">`.
2161
2250
  * The wrapper draws a custom caret while the native control keeps full
2162
- * keyboard/mobile behavior.
2251
+ * keyboard and mobile behavior. Pure CSS; there is no enhancer.
2163
2252
  * data-hl-size: sm | md (default) | lg
2164
2253
  * data-hl-invalid: error styling (pair with aria-invalid)
2165
2254
  */
@@ -2168,24 +2257,22 @@
2168
2257
  .hl-select-wrapper {
2169
2258
  position: relative;
2170
2259
  display: inline-flex;
2171
- width: 100%;
2260
+ inline-size: 100%;
2172
2261
  }
2173
2262
 
2263
+ /* The caret is a rotated square corner; it sits at the inline end so it
2264
+ moves to the left under RTL along with the select's end padding. */
2174
2265
  .hl-select-wrapper::after {
2175
2266
  content: '';
2176
2267
  position: absolute;
2177
- top: 50%;
2178
- right: 0.75rem;
2179
- right: var(--hl-space-3);
2180
- width: 0.5rem;
2181
- height: 0.5rem;
2182
- border-right: 2px solid hsl(215, 19%, 35%);
2183
- border-right: 2px solid hsl(215deg 19% 35%);
2184
- border-right: 2px solid var(--hl-fg-muted);
2185
- border-bottom: 2px solid hsl(215, 19%, 35%);
2186
- border-bottom: 2px solid hsl(215deg 19% 35%);
2187
- border-bottom: 2px solid var(--hl-fg-muted);
2188
- transform: translateY(-65%) rotate(45deg);
2268
+ inset-block-start: 50%;
2269
+ inset-inline-end: var(--hl-space-3);
2270
+ inline-size: 0.5rem;
2271
+ block-size: 0.5rem;
2272
+ border-inline-end: 2px solid var(--hl-fg-muted);
2273
+ border-block-end: 2px solid var(--hl-fg-muted);
2274
+ translate: 0 -65%;
2275
+ rotate: 45deg;
2189
2276
  pointer-events: none;
2190
2277
  }
2191
2278
 
@@ -2193,66 +2280,41 @@
2193
2280
  --_height: var(--hl-control-height-md);
2194
2281
  --_font: var(--hl-text-sm);
2195
2282
 
2196
- -webkit-appearance: none;
2197
-
2198
- -moz-appearance: none;
2199
-
2200
- appearance: none;
2201
- width: 100%;
2202
- height: 2.5rem;
2203
- height: var(--_height);
2204
- padding-left: 0.75rem;
2205
- padding-right: 2rem;
2206
- padding-left: var(--hl-space-3);
2207
- padding-right: var(--hl-space-8);
2208
- border: 1px solid hsl(213, 27%, 84%);
2283
+ appearance: none;
2284
+ inline-size: 100%;
2285
+ block-size: var(--_height);
2286
+ padding-inline: var(--hl-space-3) var(--hl-space-8);
2209
2287
  border: var(--hl-border-width) solid var(--hl-border-strong);
2210
- border-radius: 0.375rem;
2211
2288
  border-radius: var(--hl-radius-md);
2212
- background: hsl(0, 0%, 100%);
2213
2289
  background: var(--hl-surface);
2214
- color: hsl(222, 47%, 11%);
2215
2290
  color: var(--hl-fg);
2216
2291
  font-family: inherit;
2217
- font-size: 0.875rem;
2218
2292
  font-size: var(--_font);
2219
- line-height: 1.5;
2220
2293
  line-height: var(--hl-leading-normal);
2221
2294
  cursor: pointer;
2222
2295
  transition:
2223
- border-color 120ms cubic-bezier(0.2, 0, 0, 1), box-shadow 120ms cubic-bezier(0.2, 0, 0, 1);
2224
- transition:
2225
- border-color var(--hl-duration-fast) var(--hl-ease-standard), box-shadow var(--hl-duration-fast) var(--hl-ease-standard);
2296
+ border-color var(--hl-duration-fast) var(--hl-ease-standard),
2297
+ box-shadow var(--hl-duration-fast) var(--hl-ease-standard);
2226
2298
  }
2227
2299
 
2228
- .hl-select:hover:not(:disabled):not(:focus) {
2229
- border-color: hsl(215, 16%, 47%);
2300
+ .hl-select:hover:not(:disabled, :focus) {
2230
2301
  border-color: var(--hl-fg-subtle);
2231
2302
  }
2232
2303
 
2233
2304
  .hl-select:focus-visible {
2234
2305
  outline: none;
2235
- border-color: hsl(217, 91%, 60%);
2236
2306
  border-color: var(--hl-ring);
2237
- box-shadow: 0 0 0 3px rgba(60, 131, 246, 0.3);
2238
- }
2239
-
2240
- @supports (color: color-mix(in lch, red, blue)){
2241
- .hl-select:focus-visible {
2242
- box-shadow: 0 0 0 3px color-mix(in oklab, var(--hl-ring) 30%, transparent);
2307
+ box-shadow: var(--hl-focus-shadow);
2243
2308
  }
2244
- }
2245
2309
 
2246
2310
  .hl-select:disabled {
2247
2311
  cursor: not-allowed;
2248
- opacity: 0.6;
2249
- background: hsl(210, 40%, 96%);
2312
+ opacity: var(--hl-disabled-opacity);
2250
2313
  background: var(--hl-surface-2);
2251
2314
  }
2252
2315
 
2253
2316
  .hl-select[data-hl-invalid],
2254
2317
  .hl-select[aria-invalid='true'] {
2255
- border-color: hsl(0, 72%, 51%);
2256
2318
  border-color: var(--hl-danger);
2257
2319
  }
2258
2320
 
@@ -2260,8 +2322,6 @@
2260
2322
  --_height: var(--hl-control-height-sm);
2261
2323
  --_font: var(--hl-text-xs);
2262
2324
 
2263
- border-radius: 0.25rem;
2264
-
2265
2325
  border-radius: var(--hl-radius-sm);
2266
2326
  }
2267
2327
 
@@ -2269,253 +2329,256 @@
2269
2329
  --_height: var(--hl-control-height-lg);
2270
2330
  --_font: var(--hl-text-base);
2271
2331
  }
2332
+
2333
+ @media (forced-colors: active) {
2334
+ .hl-select:focus-visible {
2335
+ outline: var(--hl-focus-ring);
2336
+ outline-offset: var(--hl-focus-offset);
2337
+ }
2338
+ }
2272
2339
  }
2273
2340
 
2274
2341
  /**
2275
- * Checkbox: `<label class="hl-checkbox"><input type="checkbox"><span>…</span></label>`.
2276
- * The native input is restyled (appearance:none) with a CSS checkmark, keeping
2277
- * full keyboard + form semantics.
2342
+ * Checkbox: `<label class="hl-checkbox"><input type="checkbox"><span>...</span></label>`.
2343
+ * The native input is restyled (appearance: none) with a CSS checkmark, keeping
2344
+ * full keyboard and form semantics. Pure CSS; there is no enhancer.
2278
2345
  */
2279
2346
 
2280
2347
  @layer components {
2281
2348
  .hl-checkbox {
2282
2349
  display: inline-flex;
2283
2350
  align-items: center;
2284
- gap: 0.5rem;
2285
2351
  gap: var(--hl-space-2);
2286
- font-size: 0.875rem;
2287
2352
  font-size: var(--hl-text-sm);
2288
- line-height: 1.5;
2289
2353
  line-height: var(--hl-leading-normal);
2290
2354
  cursor: pointer;
2291
2355
  }
2292
2356
 
2293
2357
  .hl-checkbox > input[type='checkbox'] {
2294
- -webkit-appearance: none;
2295
- -moz-appearance: none;
2296
- appearance: none;
2358
+ appearance: none;
2297
2359
  flex: none;
2298
- width: 1.15rem;
2299
- height: 1.15rem;
2360
+ inline-size: 1.15rem;
2361
+ block-size: 1.15rem;
2300
2362
  margin: 0;
2301
- border: 2px solid hsl(213, 27%, 84%);
2302
2363
  border: var(--hl-border-width-2) solid var(--hl-border-strong);
2303
- border-radius: 0.25rem;
2304
2364
  border-radius: var(--hl-radius-sm);
2305
- background: hsl(0, 0%, 100%);
2306
2365
  background: var(--hl-surface);
2307
2366
  display: grid;
2308
- align-content: center;
2309
- justify-content: center;
2310
2367
  place-content: center;
2311
2368
  cursor: pointer;
2312
2369
  transition:
2313
- background-color 120ms cubic-bezier(0.2, 0, 0, 1), border-color 120ms cubic-bezier(0.2, 0, 0, 1);
2314
- transition:
2315
- background-color var(--hl-duration-fast) var(--hl-ease-standard), border-color var(--hl-duration-fast) var(--hl-ease-standard);
2370
+ background-color var(--hl-duration-fast) var(--hl-ease-standard),
2371
+ border-color var(--hl-duration-fast) var(--hl-ease-standard);
2316
2372
  }
2317
2373
 
2374
+ /* The mark is a rotated L drawn with two borders; direction-neutral. */
2318
2375
  .hl-checkbox > input[type='checkbox']::after {
2319
2376
  content: '';
2320
- width: 0.34rem;
2321
- height: 0.62rem;
2322
- border: solid hsl(0, 0%, 100%);
2377
+ inline-size: 0.34rem;
2378
+ block-size: 0.62rem;
2323
2379
  border: solid var(--hl-primary-fg);
2324
2380
  border-width: 0 2px 2px 0;
2325
- margin-top: -2px;
2326
- transform: rotate(45deg) scale(0);
2327
- transition: transform 120ms cubic-bezier(0.3, 0, 0, 1);
2328
- transition: transform var(--hl-duration-fast) var(--hl-ease-emphasized);
2381
+ margin-block-start: -2px;
2382
+ rotate: 45deg;
2383
+ scale: 0;
2384
+ transition: scale var(--hl-duration-fast) var(--hl-ease-emphasized);
2329
2385
  }
2330
2386
 
2331
2387
  .hl-checkbox > input[type='checkbox']:checked,
2332
2388
  .hl-checkbox > input[type='checkbox']:indeterminate {
2333
- background: hsl(221, 83%, 53%);
2334
2389
  background: var(--hl-primary);
2335
- border-color: hsl(221, 83%, 53%);
2336
2390
  border-color: var(--hl-primary);
2337
2391
  }
2338
2392
 
2339
2393
  .hl-checkbox > input[type='checkbox']:checked::after {
2340
- transform: rotate(45deg) scale(1);
2394
+ scale: 1;
2341
2395
  }
2342
2396
 
2343
2397
  .hl-checkbox > input[type='checkbox']:indeterminate::after {
2344
- width: 0.6rem;
2345
- height: 0;
2398
+ inline-size: 0.6rem;
2399
+ block-size: 0;
2346
2400
  margin: 0;
2347
2401
  border-width: 0 0 2px;
2348
- transform: none;
2402
+ rotate: none;
2403
+ scale: 1;
2349
2404
  }
2350
2405
 
2351
2406
  .hl-checkbox > input[type='checkbox']:focus-visible {
2352
- outline: 2px solid hsl(217, 91%, 60%);
2353
2407
  outline: var(--hl-focus-ring);
2354
- outline-offset: 2px;
2408
+ outline-offset: var(--hl-focus-offset);
2355
2409
  }
2356
2410
 
2357
2411
  .hl-checkbox > input[type='checkbox']:disabled {
2358
2412
  cursor: not-allowed;
2359
- opacity: 0.55;
2413
+ opacity: var(--hl-disabled-opacity);
2360
2414
  }
2361
2415
 
2362
2416
  .hl-checkbox:has(> input:disabled) {
2363
2417
  cursor: not-allowed;
2364
- color: hsl(215, 16%, 47%);
2365
2418
  color: var(--hl-fg-subtle);
2366
2419
  }
2420
+
2421
+ /* The custom-drawn mark must keep its own colors to stay visible on the
2422
+ Highlight fill; everything else follows the system palette. */
2423
+ @media (forced-colors: active) {
2424
+ .hl-checkbox > input[type='checkbox']::after {
2425
+ forced-color-adjust: none;
2426
+ border-color: HighlightText;
2427
+ }
2428
+ }
2367
2429
  }
2368
2430
 
2369
2431
  /**
2370
- * Radio: `<label class="hl-radio"><input type="radio"><span>…</span></label>`,
2371
- * grouped in `<div class="hl-radio-group" role="radiogroup">`.
2432
+ * Radio group: `<label class="hl-radio"><input type="radio"><span>...</span></label>`
2433
+ * items grouped in `<div class="hl-radio-group" role="radiogroup">`. Native
2434
+ * radios provide selection and arrow-key movement; pure CSS, there is no
2435
+ * enhancer.
2436
+ * data-hl-orientation: vertical (default) | horizontal (on the group)
2372
2437
  */
2373
2438
 
2374
2439
  @layer components {
2375
2440
  .hl-radio-group {
2376
2441
  display: flex;
2377
2442
  flex-direction: column;
2378
- gap: 0.5rem;
2379
2443
  gap: var(--hl-space-2);
2380
2444
  }
2381
2445
 
2382
2446
  .hl-radio-group[data-hl-orientation='horizontal'] {
2383
2447
  flex-direction: row;
2384
2448
  flex-wrap: wrap;
2385
- gap: 1rem;
2386
2449
  gap: var(--hl-space-4);
2387
2450
  }
2388
2451
 
2389
2452
  .hl-radio {
2390
2453
  display: inline-flex;
2391
2454
  align-items: center;
2392
- gap: 0.5rem;
2393
2455
  gap: var(--hl-space-2);
2394
- font-size: 0.875rem;
2395
2456
  font-size: var(--hl-text-sm);
2396
- line-height: 1.5;
2397
2457
  line-height: var(--hl-leading-normal);
2398
2458
  cursor: pointer;
2399
2459
  }
2400
2460
 
2401
2461
  .hl-radio > input[type='radio'] {
2402
- -webkit-appearance: none;
2403
- -moz-appearance: none;
2404
- appearance: none;
2462
+ appearance: none;
2405
2463
  flex: none;
2406
- width: 1.15rem;
2407
- height: 1.15rem;
2464
+ inline-size: 1.15rem;
2465
+ block-size: 1.15rem;
2408
2466
  margin: 0;
2409
- border: 2px solid hsl(213, 27%, 84%);
2410
2467
  border: var(--hl-border-width-2) solid var(--hl-border-strong);
2411
- border-radius: 9999px;
2412
2468
  border-radius: var(--hl-radius-full);
2413
- background: hsl(0, 0%, 100%);
2414
2469
  background: var(--hl-surface);
2415
2470
  display: grid;
2416
- align-content: center;
2417
- justify-content: center;
2418
2471
  place-content: center;
2419
2472
  cursor: pointer;
2420
- transition: border-color 120ms cubic-bezier(0.2, 0, 0, 1);
2421
2473
  transition: border-color var(--hl-duration-fast) var(--hl-ease-standard);
2422
2474
  }
2423
2475
 
2424
2476
  .hl-radio > input[type='radio']::after {
2425
2477
  content: '';
2426
- width: 0.6rem;
2427
- height: 0.6rem;
2428
- border-radius: 9999px;
2478
+ inline-size: 0.6rem;
2479
+ block-size: 0.6rem;
2429
2480
  border-radius: var(--hl-radius-full);
2430
- background: hsl(221, 83%, 53%);
2431
2481
  background: var(--hl-primary);
2432
- transform: scale(0);
2433
- transition: transform 120ms cubic-bezier(0.3, 0, 0, 1);
2434
- transition: transform var(--hl-duration-fast) var(--hl-ease-emphasized);
2482
+ scale: 0;
2483
+ transition: scale var(--hl-duration-fast) var(--hl-ease-emphasized);
2435
2484
  }
2436
2485
 
2437
2486
  .hl-radio > input[type='radio']:checked {
2438
- border-color: hsl(221, 83%, 53%);
2439
2487
  border-color: var(--hl-primary);
2440
2488
  }
2441
2489
 
2442
2490
  .hl-radio > input[type='radio']:checked::after {
2443
- transform: scale(1);
2491
+ scale: 1;
2444
2492
  }
2445
2493
 
2446
2494
  .hl-radio > input[type='radio']:focus-visible {
2447
- outline: 2px solid hsl(217, 91%, 60%);
2448
2495
  outline: var(--hl-focus-ring);
2449
- outline-offset: 2px;
2496
+ outline-offset: var(--hl-focus-offset);
2450
2497
  }
2451
2498
 
2452
2499
  .hl-radio > input[type='radio']:disabled {
2453
2500
  cursor: not-allowed;
2454
- opacity: 0.55;
2501
+ opacity: var(--hl-disabled-opacity);
2455
2502
  }
2456
2503
 
2457
2504
  .hl-radio:has(> input:disabled) {
2458
2505
  cursor: not-allowed;
2459
- color: hsl(215, 16%, 47%);
2460
2506
  color: var(--hl-fg-subtle);
2461
2507
  }
2508
+
2509
+ /* The dot is custom-drawn, so it opts out of forced-color flattening. */
2510
+ @media (forced-colors: active) {
2511
+ .hl-radio > input[type='radio']::after {
2512
+ forced-color-adjust: none;
2513
+ background: Highlight;
2514
+ }
2515
+ }
2462
2516
  }
2463
2517
 
2518
+ /**
2519
+ * Switch: `<label data-hl-switch><input type="checkbox" role="switch"> Label</label>`.
2520
+ * The native checkbox is restyled as a track and thumb, so state, keyboard,
2521
+ * and form submission stay native. Pure CSS; there is no enhancer.
2522
+ * data-hl-switch: the label wrapper
2523
+ */
2524
+
2464
2525
  @layer components {
2465
2526
  [data-hl-switch] {
2527
+ --_track-inline: 2.25rem;
2528
+ --_track-block: 1.25rem;
2529
+ --_gap: 2px;
2530
+ --_thumb: calc(var(--_track-block) - var(--_gap) * 2);
2531
+ --_travel: calc(var(--_track-inline) - var(--_track-block));
2532
+
2466
2533
  display: inline-flex;
2467
2534
  align-items: center;
2468
- gap: 0.5rem;
2469
2535
  gap: var(--hl-space-2);
2470
2536
  }
2471
2537
 
2472
2538
  [data-hl-switch] input[type='checkbox'] {
2473
- -webkit-appearance: none;
2474
- -moz-appearance: none;
2475
- appearance: none;
2476
- width: 2.25rem;
2477
- height: 1.25rem;
2478
- border-radius: 1.25rem;
2479
- background: hsl(213, 27%, 84%);
2480
- background: var(--hl-border-strong);
2539
+ appearance: none;
2481
2540
  position: relative;
2482
- outline-offset: 2px;
2483
- transition: background-color 120ms cubic-bezier(0.2, 0, 0, 1);
2541
+ inline-size: var(--_track-inline);
2542
+ block-size: var(--_track-block);
2543
+ margin: 0;
2544
+ border-radius: var(--hl-radius-full);
2545
+ background: var(--hl-border-strong);
2484
2546
  transition: background-color var(--hl-duration-fast) var(--hl-ease-standard);
2485
2547
  }
2486
2548
 
2549
+ /* The thumb rests at the inline start and travels toward the inline end,
2550
+ so it is placed logically and slides left under RTL. */
2487
2551
  [data-hl-switch] input[type='checkbox']::after {
2488
2552
  content: '';
2489
2553
  position: absolute;
2490
- top: 2px;
2491
- right: auto;
2492
- bottom: auto;
2493
- left: 2px;
2494
- width: calc(1.25rem - 4px);
2495
- height: calc(1.25rem - 4px);
2496
- border-radius: 50%;
2497
- background: hsl(0, 0%, 100%);
2554
+ inset-block-start: var(--_gap);
2555
+ inset-inline-start: var(--_gap);
2556
+ inline-size: var(--_thumb);
2557
+ block-size: var(--_thumb);
2558
+ border-radius: var(--hl-radius-full);
2498
2559
  background: var(--hl-surface);
2499
- transition: transform 120ms cubic-bezier(0.2, 0, 0, 1);
2500
- transition: transform var(--hl-duration-fast) var(--hl-ease-standard);
2560
+ transition: translate var(--hl-duration-fast) var(--hl-ease-standard);
2501
2561
  }
2502
2562
 
2503
2563
  [data-hl-switch] input[type='checkbox']:checked::after {
2504
- transform: translateX(1rem);
2564
+ translate: var(--_travel) 0;
2565
+ }
2566
+
2567
+ [data-hl-switch] input[type='checkbox']:checked:dir(rtl)::after {
2568
+ translate: calc(var(--_travel) * -1) 0;
2505
2569
  }
2506
2570
 
2507
2571
  [data-hl-switch] input[type='checkbox']:checked {
2508
- background: hsl(221, 83%, 53%);
2509
2572
  background: var(--hl-primary);
2510
2573
  }
2511
2574
 
2512
2575
  [data-hl-switch] input[type='checkbox']:focus-visible {
2513
- outline: 2px solid hsl(217, 91%, 60%);
2514
2576
  outline: var(--hl-focus-ring);
2577
+ outline-offset: var(--hl-focus-offset);
2515
2578
  }
2516
2579
 
2517
2580
  [data-hl-switch] input[type='checkbox']:disabled {
2518
- opacity: 0.5;
2581
+ opacity: var(--hl-disabled-opacity);
2519
2582
  cursor: not-allowed;
2520
2583
  }
2521
2584
 
@@ -2523,94 +2586,102 @@
2523
2586
  opacity: 0.7;
2524
2587
  cursor: not-allowed;
2525
2588
  }
2589
+
2590
+ /* The track needs an edge once its fill is flattened, and the custom-drawn
2591
+ thumb keeps its own colors so it stays visible on both states. */
2592
+ @media (forced-colors: active) {
2593
+ [data-hl-switch] input[type='checkbox'] {
2594
+ border: var(--hl-border-width) solid ButtonBorder;
2595
+ }
2596
+
2597
+ [data-hl-switch] input[type='checkbox']:checked {
2598
+ background: Highlight;
2599
+ border-color: Highlight;
2600
+ }
2601
+
2602
+ [data-hl-switch] input[type='checkbox']::after {
2603
+ forced-color-adjust: none;
2604
+ background: ButtonText;
2605
+ }
2606
+
2607
+ [data-hl-switch] input[type='checkbox']:checked::after {
2608
+ background: HighlightText;
2609
+ }
2610
+ }
2526
2611
  }
2527
2612
 
2528
2613
  /**
2529
2614
  * Field, accessible form-control layout: `.hl-field` stacks a `.hl-label`,
2530
2615
  * the control, `.hl-help`, and `.hl-error`. `.hl-fieldset` + `.hl-legend`
2531
- * group related fields.
2616
+ * group related fields. Pure CSS; there is no enhancer.
2617
+ * data-hl-required: on `.hl-label`, appends an asterisk
2618
+ * data-hl-invalid: on `.hl-field`, colors the label as an error
2532
2619
  */
2533
2620
 
2534
2621
  @layer components {
2535
2622
  .hl-field {
2536
2623
  display: flex;
2537
2624
  flex-direction: column;
2538
- gap: 0.375rem;
2539
2625
  gap: var(--hl-space-1-5);
2540
2626
  }
2541
2627
 
2542
2628
  .hl-label {
2543
- font-size: 0.875rem;
2544
2629
  font-size: var(--hl-text-sm);
2545
- font-weight: 500;
2546
2630
  font-weight: var(--hl-font-medium);
2547
- color: hsl(222, 47%, 11%);
2548
2631
  color: var(--hl-fg);
2549
2632
  }
2550
2633
 
2551
2634
  .hl-label[data-hl-required]::after {
2552
2635
  content: '*';
2553
- margin-left: 0.25rem;
2554
- margin-left: var(--hl-space-1);
2555
- color: hsl(0, 72%, 51%);
2636
+ margin-inline-start: var(--hl-space-1);
2556
2637
  color: var(--hl-danger);
2557
2638
  }
2558
2639
 
2559
2640
  .hl-help {
2560
2641
  margin: 0;
2561
- font-size: 0.75rem;
2562
2642
  font-size: var(--hl-text-xs);
2563
- color: hsl(215, 19%, 35%);
2564
2643
  color: var(--hl-fg-muted);
2565
2644
  }
2566
2645
 
2567
2646
  .hl-error {
2568
2647
  margin: 0;
2569
- font-size: 0.75rem;
2570
2648
  font-size: var(--hl-text-xs);
2571
- font-weight: 500;
2572
2649
  font-weight: var(--hl-font-medium);
2573
- color: hsl(0, 72%, 51%);
2574
2650
  color: var(--hl-danger);
2575
2651
  }
2576
2652
 
2577
2653
  .hl-field[data-hl-invalid] .hl-label {
2578
- color: hsl(0, 72%, 51%);
2579
2654
  color: var(--hl-danger);
2580
2655
  }
2581
2656
 
2582
2657
  .hl-fieldset {
2583
2658
  margin: 0;
2584
- padding: 1rem;
2585
2659
  padding: var(--hl-space-4);
2586
- border: 1px solid hsl(214, 32%, 91%);
2587
2660
  border: var(--hl-border-width) solid var(--hl-border);
2588
- border-radius: 0.5rem;
2589
2661
  border-radius: var(--hl-radius-lg);
2590
2662
  display: flex;
2591
2663
  flex-direction: column;
2592
- gap: 1rem;
2593
2664
  gap: var(--hl-space-4);
2594
2665
  }
2595
2666
 
2596
2667
  .hl-legend {
2597
- padding-left: 0.5rem;
2598
- padding-right: 0.5rem;
2599
- padding-left: var(--hl-space-2);
2600
- padding-right: var(--hl-space-2);
2601
- font-size: 0.875rem;
2668
+ padding-inline: var(--hl-space-2);
2602
2669
  font-size: var(--hl-text-sm);
2603
- font-weight: 600;
2604
2670
  font-weight: var(--hl-font-semibold);
2605
- color: hsl(222, 47%, 11%);
2606
2671
  color: var(--hl-fg);
2607
2672
  }
2608
2673
  }
2609
2674
 
2610
2675
  /**
2611
2676
  * Combobox: `<div data-hl-combobox>` wrapping an `<input>` and a
2612
- * `<ul role="listbox">` of `<li role="option">`. The enhancer toggles the
2613
- * listbox and manages `aria-activedescendant`.
2677
+ * `<ul role="listbox">` of `<li role="option">`.
2678
+ *
2679
+ * No-JS baseline: the listbox is hidden until the root has focus within it,
2680
+ * so the options are at least reachable and readable. The enhancer marks the
2681
+ * root `data-hl-ready` and then owns visibility through `hidden`, filtering,
2682
+ * and `aria-activedescendant`.
2683
+ * data-hl-combobox: root
2684
+ * data-hl-ready: set by the enhancer; the baseline rules stand down
2614
2685
  */
2615
2686
 
2616
2687
  @layer components {
@@ -2621,25 +2692,17 @@
2621
2692
 
2622
2693
  [data-hl-combobox] [role='listbox'] {
2623
2694
  position: absolute;
2624
- top: calc(100% + 0.25rem);
2625
- top: calc(100% + var(--hl-space-1));
2626
- left: 0;
2627
- right: 0;
2628
- z-index: 1000;
2695
+ inset-block-start: calc(100% + var(--hl-space-1));
2696
+ inset-inline: 0;
2629
2697
  z-index: var(--hl-z-dropdown);
2630
- max-height: 16rem;
2698
+ max-block-size: 16rem;
2631
2699
  margin: 0;
2632
- padding: 0.25rem;
2633
2700
  padding: var(--hl-space-1);
2634
2701
  overflow-y: auto;
2635
2702
  list-style: none;
2636
- background: hsl(0, 0%, 100%);
2637
2703
  background: var(--hl-overlay);
2638
- border: 1px solid hsl(214, 32%, 91%);
2639
2704
  border: var(--hl-border-width) solid var(--hl-border);
2640
- border-radius: 0.5rem;
2641
2705
  border-radius: var(--hl-radius-lg);
2642
- box-shadow: 0 10px 15px -3px hsla(222, 47%, 11%, 0.1), 0 4px 6px -4px hsla(222, 47%, 11%, 0.1);
2643
2706
  box-shadow: var(--hl-overlay-shadow);
2644
2707
  }
2645
2708
 
@@ -2648,18 +2711,11 @@
2648
2711
  @supports (anchor-name: --x) {
2649
2712
  [data-hl-combobox] [role='listbox'] {
2650
2713
  position: fixed;
2651
- top: auto;
2652
- right: auto;
2653
- bottom: auto;
2654
- left: auto;
2655
- width: anchor-size(width);
2656
- inset-area: block-end;
2714
+ inset: auto;
2715
+ inline-size: anchor-size(width);
2657
2716
  position-area: block-end;
2658
2717
  position-try-fallbacks: flip-block;
2659
- margin-top: 0.25rem;
2660
- margin-bottom: 0.25rem;
2661
- margin-top: var(--hl-space-1);
2662
- margin-bottom: var(--hl-space-1);
2718
+ margin-block: var(--hl-space-1);
2663
2719
  }
2664
2720
  }
2665
2721
 
@@ -2667,27 +2723,37 @@
2667
2723
  display: none;
2668
2724
  }
2669
2725
 
2726
+ /* No-JS baseline: reveal the list while the field has focus. */
2727
+ [data-hl-combobox]:not([data-hl-ready]) [role='listbox'] {
2728
+ display: none;
2729
+ }
2730
+
2731
+ [data-hl-combobox]:not([data-hl-ready]):focus-within [role='listbox'] {
2732
+ display: block;
2733
+ }
2734
+
2735
+ /* The input may be a plain `<input>` rather than `.hl-input`; make sure it
2736
+ still shows a focus ring. */
2737
+ [data-hl-combobox] > input:focus-visible {
2738
+ outline: none;
2739
+ border-color: var(--hl-ring);
2740
+ box-shadow: var(--hl-focus-shadow);
2741
+ }
2742
+
2670
2743
  [data-hl-combobox] [role='option'] {
2671
2744
  display: flex;
2672
2745
  align-items: center;
2673
- gap: 0.5rem;
2674
2746
  gap: var(--hl-space-2);
2675
- padding: 0.5rem 0.75rem;
2676
2747
  padding: var(--hl-space-2) var(--hl-space-3);
2677
- border-radius: 0.375rem;
2678
2748
  border-radius: var(--hl-radius-md);
2679
- font-size: 0.875rem;
2680
2749
  font-size: var(--hl-text-sm);
2681
- color: hsl(222, 47%, 11%);
2682
2750
  color: var(--hl-fg);
2683
2751
  cursor: pointer;
2684
2752
  }
2685
2753
 
2686
2754
  [data-hl-combobox] [role='option']:hover,
2687
2755
  [data-hl-combobox] [role='option'][aria-selected='true'] {
2688
- background: hsl(214, 100%, 97%);
2689
2756
  background: var(--hl-primary-subtle);
2690
- color: hsl(224, 76%, 48%);
2691
2757
  color: var(--hl-primary-subtle-fg);
2692
2758
  }
2693
2759
 
@@ -2696,16 +2762,28 @@
2696
2762
  }
2697
2763
 
2698
2764
  [data-hl-combobox] [role='option'][aria-disabled='true'] {
2699
- opacity: 0.5;
2765
+ opacity: var(--hl-disabled-opacity);
2700
2766
  pointer-events: none;
2701
2767
  }
2768
+
2769
+ @media (forced-colors: active) {
2770
+ [data-hl-combobox] [role='option'][aria-selected='true'] {
2771
+ background: Highlight;
2772
+ color: HighlightText;
2773
+ }
2774
+
2775
+ [data-hl-combobox] [role='option'][aria-disabled='true'] {
2776
+ color: GrayText;
2777
+ }
2778
+ }
2702
2779
  }
2703
2780
 
2704
2781
  /**
2705
2782
  * Segmented control: `<div class="hl-segmented" role="radiogroup">` of
2706
- * `<label class="hl-segmented-item"><input type="radio">…</label>` segments.
2783
+ * `<label class="hl-segmented-item"><input type="radio">...</label>` segments.
2707
2784
  * Radio inputs give free keyboard navigation; the checked segment is raised.
2708
- * A button variant using `aria-pressed="true"` is also supported.
2785
+ * A button variant using `aria-pressed="true"` is also supported. Pure CSS;
2786
+ * there is no enhancer.
2709
2787
  * data-hl-size: sm | md (default) | lg
2710
2788
  */
2711
2789
 
@@ -2713,15 +2791,10 @@
2713
2791
  .hl-segmented {
2714
2792
  display: inline-flex;
2715
2793
  align-items: stretch;
2716
- gap: 0.25rem;
2717
2794
  gap: var(--hl-space-1);
2718
- padding: 0.25rem;
2719
2795
  padding: var(--hl-space-1);
2720
- background: hsl(210, 40%, 96%);
2721
2796
  background: var(--hl-surface-2);
2722
- border: 1px solid hsl(214, 32%, 91%);
2723
2797
  border: var(--hl-border-width) solid var(--hl-border);
2724
- border-radius: 0.5rem;
2725
2798
  border-radius: var(--hl-radius-lg);
2726
2799
  }
2727
2800
 
@@ -2730,89 +2803,83 @@
2730
2803
  display: inline-flex;
2731
2804
  align-items: center;
2732
2805
  justify-content: center;
2733
- gap: 0.5rem;
2734
2806
  gap: var(--hl-space-2);
2735
- padding: 0.25rem 0.75rem;
2736
2807
  padding: var(--hl-space-1) var(--hl-space-3);
2737
2808
  border: 0;
2738
- border-radius: 0.375rem;
2739
2809
  border-radius: var(--hl-radius-md);
2740
2810
  background: transparent;
2741
- color: hsl(215, 19%, 35%);
2742
2811
  color: var(--hl-fg-muted);
2743
2812
  font: inherit;
2744
- font-size: 0.875rem;
2745
2813
  font-size: var(--hl-text-sm);
2746
- font-weight: 500;
2747
2814
  font-weight: var(--hl-font-medium);
2748
2815
  white-space: nowrap;
2749
2816
  cursor: pointer;
2750
2817
  -webkit-user-select: none;
2751
- -moz-user-select: none;
2752
2818
  user-select: none;
2753
2819
  transition:
2754
- background-color 120ms cubic-bezier(0.2, 0, 0, 1), color 120ms cubic-bezier(0.2, 0, 0, 1);
2755
- transition:
2756
- background-color var(--hl-duration-fast) var(--hl-ease-standard), color var(--hl-duration-fast) var(--hl-ease-standard);
2820
+ background-color var(--hl-duration-fast) var(--hl-ease-standard),
2821
+ color var(--hl-duration-fast) var(--hl-ease-standard);
2757
2822
  }
2758
2823
 
2759
2824
  .hl-segmented-item > input {
2760
2825
  position: absolute;
2761
- top: 0;
2762
- right: 0;
2763
- bottom: 0;
2764
- left: 0;
2826
+ inset: 0;
2765
2827
  margin: 0;
2766
2828
  opacity: 0;
2767
2829
  cursor: pointer;
2768
2830
  }
2769
2831
 
2770
2832
  .hl-segmented-item:hover {
2771
- color: hsl(222, 47%, 11%);
2772
2833
  color: var(--hl-fg);
2773
2834
  }
2774
2835
 
2775
2836
  .hl-segmented-item:has(input:checked),
2776
2837
  .hl-segmented-item[aria-pressed='true'] {
2777
- background: hsl(0, 0%, 100%);
2778
2838
  background: var(--hl-surface);
2779
- color: hsl(222, 47%, 11%);
2780
2839
  color: var(--hl-fg);
2781
- box-shadow: 0 1px 3px 0 hsla(222, 47%, 11%, 0.1), 0 1px 2px -1px hsla(222, 47%, 11%, 0.1);
2782
2840
  box-shadow: var(--hl-shadow-sm);
2783
2841
  }
2784
2842
 
2785
2843
  .hl-segmented-item:has(input:focus-visible),
2786
2844
  .hl-segmented-item[aria-pressed]:focus-visible {
2787
- outline: 2px solid hsl(217, 91%, 60%);
2788
2845
  outline: var(--hl-focus-ring);
2789
- outline-offset: 2px;
2846
+ outline-offset: var(--hl-focus-offset);
2790
2847
  }
2791
2848
 
2792
2849
  .hl-segmented-item:has(input:disabled),
2793
2850
  .hl-segmented-item:disabled {
2794
- opacity: 0.5;
2851
+ opacity: var(--hl-disabled-opacity);
2795
2852
  cursor: not-allowed;
2796
2853
  }
2797
2854
 
2798
2855
  .hl-segmented[data-hl-size='sm'] .hl-segmented-item {
2799
- padding: 0.125rem 0.5rem;
2800
2856
  padding: 0.125rem var(--hl-space-2);
2801
- font-size: 0.75rem;
2802
2857
  font-size: var(--hl-text-xs);
2803
2858
  }
2804
2859
 
2805
2860
  .hl-segmented[data-hl-size='lg'] .hl-segmented-item {
2806
- padding: 0.5rem 1rem;
2807
2861
  padding: var(--hl-space-2) var(--hl-space-4);
2808
- font-size: 1rem;
2809
2862
  font-size: var(--hl-text-base);
2810
2863
  }
2864
+
2865
+ /* The raised segment relies on a shadow, which forced colors remove. */
2866
+ @media (forced-colors: active) {
2867
+ .hl-segmented-item {
2868
+ border: var(--hl-border-width) solid ButtonBorder;
2869
+ }
2870
+
2871
+ .hl-segmented-item:has(input:checked),
2872
+ .hl-segmented-item[aria-pressed='true'] {
2873
+ background: Highlight;
2874
+ color: HighlightText;
2875
+ }
2876
+ }
2811
2877
  }
2812
2878
 
2813
2879
  /**
2814
2880
  * Slider: native `<input type="range" class="hl-slider">`. Restyled track and
2815
- * thumb across WebKit/Blink and Firefox while keeping native keyboard support.
2881
+ * thumb across WebKit/Blink and Firefox while keeping native keyboard support
2882
+ * and RTL direction. Pure CSS; there is no enhancer.
2816
2883
  */
2817
2884
 
2818
2885
  @layer components {
@@ -2820,78 +2887,56 @@
2820
2887
  --_track: 0.375rem;
2821
2888
  --_thumb: 1.15rem;
2822
2889
 
2823
- -webkit-appearance: none;
2824
-
2825
- -moz-appearance: none;
2826
-
2827
- appearance: none;
2828
- width: 100%;
2829
- height: 1.15rem;
2830
- height: var(--_thumb);
2890
+ appearance: none;
2891
+ inline-size: 100%;
2892
+ block-size: var(--_thumb);
2831
2893
  margin: 0;
2832
2894
  background: transparent;
2833
2895
  cursor: pointer;
2834
2896
  }
2835
2897
 
2836
2898
  .hl-slider::-webkit-slider-runnable-track {
2837
- height: var(--_track);
2838
- border-radius: 9999px;
2899
+ block-size: var(--_track);
2839
2900
  border-radius: var(--hl-radius-full);
2840
- background: hsl(214, 32%, 91%);
2841
2901
  background: var(--hl-surface-3);
2842
2902
  }
2843
2903
 
2844
2904
  .hl-slider::-moz-range-track {
2845
- height: var(--_track);
2846
- border-radius: 9999px;
2905
+ block-size: var(--_track);
2847
2906
  border-radius: var(--hl-radius-full);
2848
- background: hsl(214, 32%, 91%);
2849
2907
  background: var(--hl-surface-3);
2850
2908
  }
2851
2909
 
2852
2910
  .hl-slider::-moz-range-progress {
2853
- height: var(--_track);
2854
- border-radius: 9999px;
2911
+ block-size: var(--_track);
2855
2912
  border-radius: var(--hl-radius-full);
2856
- background: hsl(221, 83%, 53%);
2857
2913
  background: var(--hl-primary);
2858
2914
  }
2859
2915
 
2860
2916
  .hl-slider::-webkit-slider-thumb {
2861
- -webkit-appearance: none;
2862
- appearance: none;
2863
- width: var(--_thumb);
2864
- height: var(--_thumb);
2865
- margin-top: calc((var(--_track) - var(--_thumb)) / 2);
2866
- border: 2px solid hsl(0, 0%, 100%);
2917
+ appearance: none;
2918
+ inline-size: var(--_thumb);
2919
+ block-size: var(--_thumb);
2920
+ margin-block-start: calc((var(--_track) - var(--_thumb)) / 2);
2867
2921
  border: 2px solid var(--hl-surface);
2868
- border-radius: 9999px;
2869
2922
  border-radius: var(--hl-radius-full);
2870
- background: hsl(221, 83%, 53%);
2871
2923
  background: var(--hl-primary);
2872
- box-shadow: 0 1px 3px 0 hsla(222, 47%, 11%, 0.1), 0 1px 2px -1px hsla(222, 47%, 11%, 0.1);
2873
2924
  box-shadow: var(--hl-shadow-sm);
2874
- -webkit-transition: transform 120ms cubic-bezier(0.2, 0, 0, 1);
2875
- transition: transform 120ms cubic-bezier(0.2, 0, 0, 1);
2876
- -webkit-transition: transform var(--hl-duration-fast) var(--hl-ease-standard);
2877
- transition: transform var(--hl-duration-fast) var(--hl-ease-standard);
2925
+ -webkit-transition: scale var(--hl-duration-fast) var(--hl-ease-standard);
2926
+ transition: scale var(--hl-duration-fast) var(--hl-ease-standard);
2878
2927
  }
2879
2928
 
2880
2929
  .hl-slider::-moz-range-thumb {
2881
- width: var(--_thumb);
2882
- height: var(--_thumb);
2883
- border: 2px solid hsl(0, 0%, 100%);
2930
+ inline-size: var(--_thumb);
2931
+ block-size: var(--_thumb);
2884
2932
  border: 2px solid var(--hl-surface);
2885
- border-radius: 9999px;
2886
2933
  border-radius: var(--hl-radius-full);
2887
- background: hsl(221, 83%, 53%);
2888
2934
  background: var(--hl-primary);
2889
- box-shadow: 0 1px 3px 0 hsla(222, 47%, 11%, 0.1), 0 1px 2px -1px hsla(222, 47%, 11%, 0.1);
2890
2935
  box-shadow: var(--hl-shadow-sm);
2891
2936
  }
2892
2937
 
2893
2938
  .hl-slider:active::-webkit-slider-thumb {
2894
- transform: scale(1.1);
2939
+ scale: 1.1;
2895
2940
  }
2896
2941
 
2897
2942
  .hl-slider:focus-visible {
@@ -2899,36 +2944,33 @@
2899
2944
  }
2900
2945
 
2901
2946
  .hl-slider:focus-visible::-webkit-slider-thumb {
2902
- box-shadow: 0 0 0 4px rgba(60, 131, 246, 0.35);
2947
+ box-shadow: var(--hl-focus-shadow);
2903
2948
  }
2904
2949
 
2905
- @supports (color: color-mix(in lch, red, blue)){
2906
- .hl-slider:focus-visible::-webkit-slider-thumb {
2907
- box-shadow: 0 0 0 4px color-mix(in oklab, var(--hl-ring) 35%, transparent);
2908
- }
2909
- }
2910
-
2911
2950
  .hl-slider:focus-visible::-moz-range-thumb {
2912
- box-shadow: 0 0 0 4px rgba(60, 131, 246, 0.35);
2913
- }
2914
-
2915
- @supports (color: color-mix(in lch, red, blue)){
2916
- .hl-slider:focus-visible::-moz-range-thumb {
2917
- box-shadow: 0 0 0 4px color-mix(in oklab, var(--hl-ring) 35%, transparent);
2951
+ box-shadow: var(--hl-focus-shadow);
2918
2952
  }
2919
- }
2920
2953
 
2921
2954
  .hl-slider:disabled {
2922
2955
  cursor: not-allowed;
2923
- opacity: 0.6;
2956
+ opacity: var(--hl-disabled-opacity);
2957
+ }
2958
+
2959
+ /* Shadows vanish in forced colors, so focus falls back to an outline. */
2960
+ @media (forced-colors: active) {
2961
+ .hl-slider:focus-visible {
2962
+ outline: var(--hl-focus-ring);
2963
+ outline-offset: var(--hl-focus-offset);
2964
+ }
2924
2965
  }
2925
2966
  }
2926
2967
 
2927
2968
  /* Feedback & data display */
2928
2969
 
2929
2970
  /**
2930
- * Alert: `<div class="hl-alert" role="alert" data-hl-intent="…">` with an
2931
- * optional icon, `.hl-alert-title`, and body content.
2971
+ * Alert: `<div class="hl-alert" role="alert" data-hl-intent="...">` with an
2972
+ * optional icon, `.hl-alert-title`, and body content. Pure CSS; there is no
2973
+ * enhancer.
2932
2974
  * data-hl-intent: info (default) | success | warning | danger | neutral
2933
2975
  */
2934
2976
 
@@ -2939,24 +2981,14 @@
2939
2981
  --_fg: var(--hl-info-subtle-fg);
2940
2982
 
2941
2983
  display: flex;
2942
- gap: 0.75rem;
2943
2984
  gap: var(--hl-space-3);
2944
- padding: 0.75rem 1rem;
2945
2985
  padding: var(--hl-space-3) var(--hl-space-4);
2946
- border: 1px solid transparent;
2947
2986
  border: var(--hl-border-width) solid transparent;
2948
- border-left: 3px solid hsl(200, 98%, 39%);
2949
- border-left: 3px solid hsl(200deg 98% 39%);
2950
- border-left: 3px solid var(--_accent);
2951
- border-radius: 0.375rem;
2987
+ border-inline-start: 3px solid var(--_accent);
2952
2988
  border-radius: var(--hl-radius-md);
2953
- background: hsl(204, 100%, 97%);
2954
2989
  background: var(--_bg);
2955
- color: hsl(201, 96%, 32%);
2956
2990
  color: var(--_fg);
2957
- font-size: 0.875rem;
2958
2991
  font-size: var(--hl-text-sm);
2959
- line-height: 1.5;
2960
2992
  line-height: var(--hl-leading-normal);
2961
2993
  }
2962
2994
 
@@ -2986,35 +3018,40 @@
2986
3018
 
2987
3019
  .hl-alert > svg:first-child {
2988
3020
  flex: none;
2989
- width: 1.25rem;
2990
- height: 1.25rem;
2991
- margin-top: 0.1rem;
3021
+ inline-size: 1.25rem;
3022
+ block-size: 1.25rem;
3023
+ margin-block-start: 0.1rem;
2992
3024
  color: var(--_accent);
2993
3025
  }
2994
3026
 
2995
3027
  .hl-alert-body {
2996
3028
  display: flex;
2997
3029
  flex-direction: column;
2998
- gap: 0.25rem;
2999
3030
  gap: var(--hl-space-1);
3000
- min-width: 0;
3031
+ min-inline-size: 0;
3001
3032
  }
3002
3033
 
3003
3034
  .hl-alert-title {
3004
3035
  margin: 0;
3005
- font-size: 0.875rem;
3006
3036
  font-size: var(--hl-text-sm);
3007
- font-weight: 600;
3008
3037
  font-weight: var(--hl-font-semibold);
3009
3038
  }
3010
3039
 
3011
3040
  .hl-alert p {
3012
3041
  margin: 0;
3013
3042
  }
3043
+
3044
+ /* Fills are flattened in forced colors, so the outline carries the shape. */
3045
+ @media (forced-colors: active) {
3046
+ .hl-alert {
3047
+ border-color: CanvasText;
3048
+ }
3049
+ }
3014
3050
  }
3015
3051
 
3016
3052
  /**
3017
- * Badge: `<span class="hl-badge" data-hl-intent="…" data-hl-variant="…">`.
3053
+ * Badge: `<span class="hl-badge" data-hl-intent="..." data-hl-variant="...">`.
3054
+ * Pure CSS; there is no enhancer.
3018
3055
  * data-hl-intent: neutral (default) | primary | danger | success | warning | info
3019
3056
  * data-hl-variant: soft (default) | solid | outline
3020
3057
  * data-hl-size: sm | md (default)
@@ -3030,23 +3067,14 @@
3030
3067
 
3031
3068
  display: inline-flex;
3032
3069
  align-items: center;
3033
- gap: 0.25rem;
3034
3070
  gap: var(--hl-space-1);
3035
- padding: 0.125rem 0.5rem;
3036
3071
  padding: 0.125rem var(--hl-space-2);
3037
- border: 1px solid transparent;
3038
3072
  border: var(--hl-border-width) solid transparent;
3039
- border-radius: 9999px;
3040
3073
  border-radius: var(--hl-radius-full);
3041
- background: hsl(210, 40%, 96%);
3042
3074
  background: var(--_soft-bg);
3043
- color: hsl(222, 47%, 11%);
3044
3075
  color: var(--_soft-fg);
3045
- font-size: 0.75rem;
3046
3076
  font-size: var(--hl-text-xs);
3047
- font-weight: 500;
3048
3077
  font-weight: var(--hl-font-medium);
3049
- line-height: 1.25;
3050
3078
  line-height: var(--hl-leading-tight);
3051
3079
  white-space: nowrap;
3052
3080
  }
@@ -3103,15 +3131,22 @@
3103
3131
  }
3104
3132
 
3105
3133
  .hl-badge[data-hl-size='sm'] {
3106
- padding: 0 0.375rem;
3107
3134
  padding: 0 var(--hl-space-1-5);
3108
3135
  font-size: 0.6875rem;
3109
3136
  }
3137
+
3138
+ /* Soft and solid fills disappear in forced colors; keep the pill outline. */
3139
+ @media (forced-colors: active) {
3140
+ .hl-badge {
3141
+ border-color: CanvasText;
3142
+ }
3143
+ }
3110
3144
  }
3111
3145
 
3112
3146
  /**
3113
3147
  * Card: `<div class="hl-card">` with optional `.hl-card-header`,
3114
3148
  * `.hl-card-body`, `.hl-card-footer`, `.hl-card-title`, `.hl-card-description`.
3149
+ * Pure CSS; there is no enhancer.
3115
3150
  * data-hl-interactive: hover/active elevation for clickable cards
3116
3151
  */
3117
3152
 
@@ -3119,13 +3154,9 @@
3119
3154
  .hl-card {
3120
3155
  display: flex;
3121
3156
  flex-direction: column;
3122
- background: hsl(0, 0%, 100%);
3123
3157
  background: var(--hl-surface);
3124
- border: 1px solid hsl(214, 32%, 91%);
3125
3158
  border: var(--hl-border-width) solid var(--hl-border);
3126
- border-radius: 0.75rem;
3127
3159
  border-radius: var(--hl-radius-xl);
3128
- box-shadow: 0 1px 3px 0 hsla(222, 47%, 11%, 0.1), 0 1px 2px -1px hsla(222, 47%, 11%, 0.1);
3129
3160
  box-shadow: var(--hl-shadow-sm);
3130
3161
  overflow: hidden;
3131
3162
  }
@@ -3133,82 +3164,65 @@
3133
3164
  .hl-card-header {
3134
3165
  display: flex;
3135
3166
  flex-direction: column;
3136
- gap: 0.25rem;
3137
3167
  gap: var(--hl-space-1);
3138
- padding: 1rem 1.25rem;
3139
3168
  padding: var(--hl-space-4) var(--hl-space-5);
3140
- border-bottom: 1px solid hsl(214, 32%, 91%);
3141
- border-bottom: 1px solid hsl(214deg 32% 91%);
3142
- border-bottom: var(--hl-border-width) solid var(--hl-border);
3169
+ border-block-end: var(--hl-border-width) solid var(--hl-border);
3143
3170
  }
3144
3171
 
3145
3172
  .hl-card-body {
3146
3173
  flex: 1 1 auto;
3147
- padding: 1.25rem;
3148
3174
  padding: var(--hl-space-5);
3149
3175
  }
3150
3176
 
3151
3177
  .hl-card-footer {
3152
3178
  display: flex;
3153
3179
  align-items: center;
3154
- gap: 0.5rem;
3155
3180
  gap: var(--hl-space-2);
3156
- padding: 1rem 1.25rem;
3157
3181
  padding: var(--hl-space-4) var(--hl-space-5);
3158
- border-top: 1px solid hsl(214, 32%, 91%);
3159
- border-top: 1px solid hsl(214deg 32% 91%);
3160
- border-top: var(--hl-border-width) solid var(--hl-border);
3161
- background: hsl(210, 40%, 96%);
3182
+ border-block-start: var(--hl-border-width) solid var(--hl-border);
3162
3183
  background: var(--hl-surface-2);
3163
3184
  }
3164
3185
 
3165
3186
  .hl-card-title {
3166
3187
  margin: 0;
3167
- font-size: 1.125rem;
3168
3188
  font-size: var(--hl-text-lg);
3169
- font-weight: 600;
3170
3189
  font-weight: var(--hl-font-semibold);
3171
- line-height: 1.25;
3172
3190
  line-height: var(--hl-leading-tight);
3173
3191
  }
3174
3192
 
3175
3193
  .hl-card-description {
3176
3194
  margin: 0;
3177
- font-size: 0.875rem;
3178
3195
  font-size: var(--hl-text-sm);
3179
- color: hsl(215, 19%, 35%);
3180
3196
  color: var(--hl-fg-muted);
3181
3197
  }
3182
3198
 
3183
3199
  .hl-card[data-hl-interactive] {
3184
3200
  cursor: pointer;
3185
3201
  transition:
3186
- border-color 120ms cubic-bezier(0.2, 0, 0, 1), box-shadow 180ms cubic-bezier(0.2, 0, 0, 1), transform 180ms cubic-bezier(0.2, 0, 0, 1);
3187
- transition:
3188
- border-color var(--hl-duration-fast) var(--hl-ease-standard), box-shadow var(--hl-duration-base) var(--hl-ease-standard), transform var(--hl-duration-base) var(--hl-ease-standard);
3202
+ border-color var(--hl-duration-fast) var(--hl-ease-standard),
3203
+ box-shadow var(--hl-duration-base) var(--hl-ease-standard),
3204
+ translate var(--hl-duration-base) var(--hl-ease-standard);
3189
3205
  }
3190
3206
 
3191
3207
  .hl-card[data-hl-interactive]:hover {
3192
- border-color: hsl(213, 27%, 84%);
3193
3208
  border-color: var(--hl-border-strong);
3194
- box-shadow: 0 4px 6px -1px hsla(222, 47%, 11%, 0.1), 0 2px 4px -2px hsla(222, 47%, 11%, 0.1);
3195
3209
  box-shadow: var(--hl-shadow-md);
3196
3210
  }
3197
3211
 
3198
3212
  .hl-card[data-hl-interactive]:focus-within {
3199
- outline: 2px solid hsl(217, 91%, 60%);
3200
3213
  outline: var(--hl-focus-ring);
3201
- outline-offset: 2px;
3214
+ outline-offset: var(--hl-focus-offset);
3202
3215
  }
3203
3216
 
3204
3217
  .hl-card[data-hl-interactive]:active {
3205
- transform: translateY(1px);
3218
+ translate: 0 1px;
3206
3219
  }
3207
3220
  }
3208
3221
 
3209
3222
  /**
3210
3223
  * Avatar: `<span class="hl-avatar">` containing an `<img>` or fallback
3211
- * initials/icon. Stack with `<div class="hl-avatar-group">`.
3224
+ * initials/icon. Stack with `<div class="hl-avatar-group">`. Pure CSS; there
3225
+ * is no enhancer.
3212
3226
  * data-hl-size: xs | sm | md (default) | lg | xl
3213
3227
  * data-hl-shape: square
3214
3228
  */
@@ -3219,42 +3233,30 @@
3219
3233
 
3220
3234
  position: relative;
3221
3235
  display: inline-grid;
3222
- align-items: center;
3223
- justify-items: center;
3224
3236
  place-items: center;
3225
3237
  flex: none;
3226
- width: 2.5rem;
3227
- width: var(--_size);
3228
- height: 2.5rem;
3229
- height: var(--_size);
3230
- border-radius: 9999px;
3238
+ inline-size: var(--_size);
3239
+ block-size: var(--_size);
3231
3240
  border-radius: var(--hl-radius-full);
3232
3241
  overflow: hidden;
3233
- background: hsl(214, 32%, 91%);
3234
3242
  background: var(--hl-surface-3);
3235
- color: hsl(215, 19%, 35%);
3236
3243
  color: var(--hl-fg-muted);
3237
- font-size: calc(2.5rem * 0.4);
3238
3244
  font-size: calc(var(--_size) * 0.4);
3239
- font-weight: 500;
3240
3245
  font-weight: var(--hl-font-medium);
3241
3246
  line-height: 1;
3242
3247
  text-transform: uppercase;
3243
3248
  -webkit-user-select: none;
3244
- -moz-user-select: none;
3245
3249
  user-select: none;
3246
3250
  }
3247
3251
 
3248
3252
  .hl-avatar[data-hl-shape='square'] {
3249
- border-radius: 0.5rem;
3250
3253
  border-radius: var(--hl-radius-lg);
3251
3254
  }
3252
3255
 
3253
3256
  .hl-avatar > img {
3254
- width: 100%;
3255
- height: 100%;
3256
- -o-object-fit: cover;
3257
- object-fit: cover;
3257
+ inline-size: 100%;
3258
+ block-size: 100%;
3259
+ object-fit: cover;
3258
3260
  }
3259
3261
 
3260
3262
  .hl-avatar[data-hl-size='xs'] {
@@ -3279,18 +3281,17 @@
3279
3281
  }
3280
3282
 
3281
3283
  .hl-avatar-group > .hl-avatar {
3282
- box-shadow: 0 0 0 2px hsl(0, 0%, 100%);
3283
3284
  box-shadow: 0 0 0 2px var(--hl-surface);
3284
3285
  }
3285
3286
 
3286
3287
  .hl-avatar-group > .hl-avatar:not(:first-child) {
3287
- margin-left: -0.6rem;
3288
+ margin-inline-start: -0.6rem;
3288
3289
  }
3289
3290
  }
3290
3291
 
3291
3292
  /**
3292
3293
  * Progress: native `<progress class="hl-progress" value max>`. Omit `value`
3293
- * for an indeterminate bar.
3294
+ * for an indeterminate bar. Pure CSS; there is no enhancer.
3294
3295
  * data-hl-intent: primary (default) | success | warning | danger | info
3295
3296
  * data-hl-size: sm | md (default) | lg
3296
3297
  */
@@ -3300,21 +3301,13 @@
3300
3301
  --_color: var(--hl-primary);
3301
3302
  --_height: 0.5rem;
3302
3303
 
3303
- -webkit-appearance: none;
3304
-
3305
- -moz-appearance: none;
3306
-
3307
- appearance: none;
3308
- width: 100%;
3309
- height: 0.5rem;
3310
- height: var(--_height);
3304
+ appearance: none;
3305
+ inline-size: 100%;
3306
+ block-size: var(--_height);
3311
3307
  border: 0;
3312
- border-radius: 9999px;
3313
3308
  border-radius: var(--hl-radius-full);
3314
3309
  overflow: hidden;
3315
- background: hsl(214, 32%, 91%);
3316
3310
  background: var(--hl-surface-3);
3317
- color: hsl(221, 83%, 53%);
3318
3311
  color: var(--_color);
3319
3312
  }
3320
3313
 
@@ -3348,28 +3341,21 @@
3348
3341
 
3349
3342
  .hl-progress::-webkit-progress-value {
3350
3343
  background: var(--_color);
3351
- border-radius: 9999px;
3352
3344
  border-radius: var(--hl-radius-full);
3353
- -webkit-transition: width 180ms cubic-bezier(0.2, 0, 0, 1);
3354
- transition: width 180ms cubic-bezier(0.2, 0, 0, 1);
3355
- -webkit-transition: width var(--hl-duration-base) var(--hl-ease-standard);
3356
- transition: width var(--hl-duration-base) var(--hl-ease-standard);
3345
+ -webkit-transition: inline-size var(--hl-duration-base) var(--hl-ease-standard);
3346
+ transition: inline-size var(--hl-duration-base) var(--hl-ease-standard);
3357
3347
  }
3358
3348
 
3359
3349
  .hl-progress::-moz-progress-bar {
3360
3350
  background: var(--_color);
3361
- border-radius: 9999px;
3362
3351
  border-radius: var(--hl-radius-full);
3363
3352
  }
3364
3353
 
3365
3354
  .hl-progress:indeterminate {
3366
- background: linear-gradient(90deg, transparent 0%, var(--_color) 50%, transparent 100%)
3367
- hsl(214, 32%, 91%);
3368
3355
  background: linear-gradient(90deg, transparent 0%, var(--_color) 50%, transparent 100%)
3369
3356
  var(--hl-surface-3);
3370
3357
  background-size: 40% 100%;
3371
3358
  background-repeat: no-repeat;
3372
- animation: hl-progress-indeterminate 1.2s cubic-bezier(0.2, 0, 0, 1) infinite;
3373
3359
  animation: hl-progress-indeterminate 1.2s var(--hl-ease-standard) infinite;
3374
3360
  }
3375
3361
 
@@ -3387,16 +3373,33 @@
3387
3373
  }
3388
3374
  }
3389
3375
 
3376
+ /* A static partial bar still signals "in progress" without motion. */
3390
3377
  @media (prefers-reduced-motion: reduce) {
3391
3378
  .hl-progress:indeterminate {
3392
- animation-duration: 3s;
3379
+ animation: none;
3380
+ background-position: 30% 0;
3381
+ }
3382
+ }
3383
+
3384
+ @media (forced-colors: active) {
3385
+ .hl-progress {
3386
+ border: var(--hl-border-width) solid CanvasText;
3387
+ }
3388
+
3389
+ .hl-progress::-webkit-progress-value {
3390
+ background: Highlight;
3391
+ }
3392
+
3393
+ .hl-progress::-moz-progress-bar {
3394
+ background: Highlight;
3393
3395
  }
3394
3396
  }
3395
3397
  }
3396
3398
 
3397
3399
  /**
3398
3400
  * Spinner: `<span class="hl-spinner" role="status" aria-label="Loading">`.
3399
- * Inherits `currentColor`, so set `color` to theme it.
3401
+ * Inherits `currentColor`, so set `color` to theme it. Pure CSS; there is no
3402
+ * enhancer.
3400
3403
  * data-hl-size: sm | md (default) | lg | xl
3401
3404
  */
3402
3405
 
@@ -3407,23 +3410,14 @@
3407
3410
 
3408
3411
  display: inline-block;
3409
3412
  flex: none;
3410
- width: 1.25rem;
3411
- width: var(--_size);
3412
- height: 1.25rem;
3413
- height: var(--_size);
3414
- border: 2px solid color-mix(in oklab, currentcolor 25%, transparent);
3415
- border-top-color: currentcolor;
3416
- border-radius: 9999px;
3413
+ inline-size: var(--_size);
3414
+ block-size: var(--_size);
3415
+ border: var(--_width) solid color-mix(in oklab, currentcolor 25%, transparent);
3416
+ border-block-start-color: currentcolor;
3417
3417
  border-radius: var(--hl-radius-full);
3418
3418
  animation: hl-spinner-rotate 0.6s linear infinite;
3419
3419
  }
3420
3420
 
3421
- @supports (color: color-mix(in lch, red, blue)){
3422
- .hl-spinner {
3423
- border: var(--_width) solid color-mix(in oklab, currentcolor 25%, transparent);
3424
- }
3425
- }
3426
-
3427
3421
  .hl-spinner[data-hl-size='sm'] {
3428
3422
  --_size: 1rem;
3429
3423
  }
@@ -3444,32 +3438,36 @@
3444
3438
  }
3445
3439
  }
3446
3440
 
3441
+ /* A static arc still reads as "loading" without continuous motion. */
3447
3442
  @media (prefers-reduced-motion: reduce) {
3448
3443
  .hl-spinner {
3449
- animation-duration: 1.4s;
3444
+ animation: none;
3445
+ }
3446
+ }
3447
+
3448
+ /* The faded ring is color-mixed, which forced colors flatten; keep the arc
3449
+ visible by drawing the rest of the ring in GrayText. */
3450
+ @media (forced-colors: active) {
3451
+ .hl-spinner {
3452
+ border-color: GrayText;
3453
+ border-block-start-color: CanvasText;
3450
3454
  }
3451
3455
  }
3452
3456
  }
3453
3457
 
3454
3458
  /**
3455
- * Skeleton: `<span class="hl-skeleton" data-hl-variant="…" aria-hidden="true">`
3456
- * placeholder shown while content loads.
3457
- * data-hl-variant: rect (default) | text | circle
3459
+ * Skeleton: `<span class="hl-skeleton" data-hl-shape="..." aria-hidden="true">`
3460
+ * placeholder shown while content loads. Pure CSS; there is no enhancer.
3461
+ * Size it with inline `inline-size`/`block-size`.
3462
+ * data-hl-shape: rect (default) | text | circle
3458
3463
  */
3459
3464
 
3460
3465
  @layer components {
3461
3466
  .hl-skeleton {
3462
3467
  display: block;
3463
- width: 100%;
3464
- height: 1rem;
3465
- border-radius: 0.375rem;
3468
+ inline-size: 100%;
3469
+ block-size: 1rem;
3466
3470
  border-radius: var(--hl-radius-md);
3467
- background: linear-gradient(
3468
- 90deg,
3469
- hsl(214, 32%, 91%) 25%,
3470
- hsl(210, 40%, 96%) 37%,
3471
- hsl(214, 32%, 91%) 63%
3472
- );
3473
3471
  background: linear-gradient(
3474
3472
  90deg,
3475
3473
  var(--hl-surface-3) 25%,
@@ -3477,20 +3475,17 @@
3477
3475
  var(--hl-surface-3) 63%
3478
3476
  );
3479
3477
  background-size: 400% 100%;
3480
- animation: hl-skeleton-shimmer 1.4s cubic-bezier(0.2, 0, 0, 1) infinite;
3481
3478
  animation: hl-skeleton-shimmer 1.4s var(--hl-ease-standard) infinite;
3482
3479
  }
3483
3480
 
3484
- .hl-skeleton[data-hl-variant='text'] {
3485
- height: 0.7em;
3486
- border-radius: 0.25rem;
3481
+ .hl-skeleton[data-hl-shape='text'] {
3482
+ block-size: 0.7em;
3487
3483
  border-radius: var(--hl-radius-sm);
3488
3484
  }
3489
3485
 
3490
- .hl-skeleton[data-hl-variant='circle'] {
3491
- width: 2.5rem;
3492
- height: 2.5rem;
3493
- border-radius: 9999px;
3486
+ .hl-skeleton[data-hl-shape='circle'] {
3487
+ inline-size: 2.5rem;
3488
+ block-size: 2.5rem;
3494
3489
  border-radius: var(--hl-radius-full);
3495
3490
  }
3496
3491
 
@@ -3507,15 +3502,22 @@
3507
3502
  @media (prefers-reduced-motion: reduce) {
3508
3503
  .hl-skeleton {
3509
3504
  animation: none;
3510
- background: hsl(214, 32%, 91%);
3511
3505
  background: var(--hl-surface-3);
3512
3506
  }
3513
3507
  }
3508
+
3509
+ /* Fills flatten to Canvas in forced colors; outline the placeholder instead. */
3510
+ @media (forced-colors: active) {
3511
+ .hl-skeleton {
3512
+ border: var(--hl-border-width) solid GrayText;
3513
+ }
3514
+ }
3514
3515
  }
3515
3516
 
3516
3517
  /**
3517
3518
  * Keyboard key: `<kbd class="hl-kbd">⌘</kbd>`. Combine inline, e.g.
3518
- * `<kbd class="hl-kbd">⌘</kbd><kbd class="hl-kbd">K</kbd>`.
3519
+ * `<kbd class="hl-kbd">⌘</kbd><kbd class="hl-kbd">K</kbd>`. Pure CSS; there
3520
+ * is no enhancer.
3519
3521
  */
3520
3522
 
3521
3523
  @layer components {
@@ -3523,19 +3525,13 @@
3523
3525
  display: inline-flex;
3524
3526
  align-items: center;
3525
3527
  justify-content: center;
3526
- min-width: 1.5rem;
3528
+ min-inline-size: 1.5rem;
3527
3529
  padding: 0.125rem 0.4rem;
3528
- border: 1px solid hsl(213, 27%, 84%);
3529
3530
  border: var(--hl-border-width) solid var(--hl-border-strong);
3530
- border-bottom-width: 2px;
3531
- border-bottom-width: var(--hl-border-width-2);
3532
- border-radius: 0.25rem;
3531
+ border-block-end-width: var(--hl-border-width-2);
3533
3532
  border-radius: var(--hl-radius-sm);
3534
- background: hsl(210, 40%, 96%);
3535
3533
  background: var(--hl-surface-2);
3536
- color: hsl(222, 47%, 11%);
3537
3534
  color: var(--hl-fg);
3538
- font-family: ui-monospace, sfmono-regular, 'SF Mono', menlo, consolas, 'Liberation Mono', monospace;
3539
3535
  font-family: var(--hl-font-mono);
3540
3536
  font-size: 0.8125em;
3541
3537
  line-height: 1;
@@ -3544,117 +3540,133 @@
3544
3540
  }
3545
3541
 
3546
3542
  /**
3547
- * Table: `<table class="hl-table">`. Semantic table styling with optional
3548
- * zebra striping and hover.
3543
+ * Table: `<table class="hl-table">`, optionally inside
3544
+ * `<div class="hl-table-wrapper">` so wide tables scroll instead of breaking
3545
+ * the layout. Pure CSS; there is no enhancer.
3549
3546
  * data-hl-striped: zebra rows
3550
3547
  * data-hl-hover: highlight row on hover
3548
+ * data-hl-align: start (default) | center | end, on the table or a cell
3549
+ * data-hl-size: sm | md (default) | lg, cell padding density
3551
3550
  */
3552
3551
 
3553
3552
  @layer components {
3553
+ .hl-table-wrapper {
3554
+ inline-size: 100%;
3555
+ overflow-x: auto;
3556
+ overscroll-behavior-x: contain;
3557
+ }
3558
+
3554
3559
  .hl-table {
3555
- width: 100%;
3560
+ --_pad-y: var(--hl-space-2);
3561
+ --_pad-x: var(--hl-space-3);
3562
+
3563
+ inline-size: 100%;
3556
3564
  border-collapse: collapse;
3557
- font-size: 0.875rem;
3558
3565
  font-size: var(--hl-text-sm);
3559
- color: hsl(222, 47%, 11%);
3560
3566
  color: var(--hl-fg);
3561
3567
  }
3562
3568
 
3563
3569
  .hl-table caption {
3564
- padding-top: 0.5rem;
3565
- padding-bottom: 0.5rem;
3566
- padding-top: var(--hl-space-2);
3567
- padding-bottom: var(--hl-space-2);
3568
- color: hsl(215, 19%, 35%);
3570
+ padding-block: var(--hl-space-2);
3569
3571
  color: var(--hl-fg-muted);
3570
- text-align: left;
3572
+ text-align: start;
3571
3573
  caption-side: bottom;
3572
3574
  }
3573
3575
 
3574
3576
  .hl-table th,
3575
3577
  .hl-table td {
3576
- padding: 0.5rem 0.75rem;
3577
- padding: var(--hl-space-2) var(--hl-space-3);
3578
- text-align: left;
3578
+ padding: var(--_pad-y) var(--_pad-x);
3579
+ text-align: start;
3579
3580
  vertical-align: middle;
3580
- border-bottom: 1px solid hsl(214, 32%, 91%);
3581
- border-bottom: 1px solid hsl(214deg 32% 91%);
3582
- border-bottom: var(--hl-border-width) solid var(--hl-border);
3581
+ border-block-end: var(--hl-border-width) solid var(--hl-border);
3583
3582
  }
3584
3583
 
3585
3584
  .hl-table thead th {
3586
- font-size: 0.75rem;
3587
3585
  font-size: var(--hl-text-xs);
3588
- font-weight: 600;
3589
3586
  font-weight: var(--hl-font-semibold);
3590
3587
  text-transform: uppercase;
3591
3588
  letter-spacing: 0.03em;
3592
- color: hsl(215, 19%, 35%);
3593
3589
  color: var(--hl-fg-muted);
3594
- border-bottom-color: hsl(213, 27%, 84%);
3595
- border-bottom-color: hsl(213deg 27% 84%);
3596
- border-bottom-color: var(--hl-border-strong);
3590
+ border-block-end-color: var(--hl-border-strong);
3597
3591
  }
3598
3592
 
3599
3593
  .hl-table tfoot td {
3600
- font-weight: 500;
3601
3594
  font-weight: var(--hl-font-medium);
3602
- color: hsl(215, 19%, 35%);
3603
3595
  color: var(--hl-fg-muted);
3604
3596
  }
3605
3597
 
3606
3598
  .hl-table[data-hl-striped] tbody tr:nth-child(even) {
3607
- background: hsl(210, 40%, 96%);
3608
3599
  background: var(--hl-surface-2);
3609
3600
  }
3610
3601
 
3611
3602
  .hl-table[data-hl-hover] tbody tr:hover {
3612
- background: rgba(36, 99, 235, 0.08);
3603
+ background: color-mix(in oklab, var(--hl-primary) 8%, transparent);
3613
3604
  }
3614
3605
 
3615
- @supports (color: color-mix(in lch, red, blue)){
3616
- .hl-table[data-hl-hover] tbody tr:hover {
3617
- background: color-mix(in oklab, var(--hl-primary) 8%, transparent);
3606
+ .hl-table[data-hl-size='sm'] {
3607
+ --_pad-y: var(--hl-space-1);
3608
+ --_pad-x: var(--hl-space-2);
3609
+
3610
+ font-size: var(--hl-text-xs);
3611
+ }
3612
+
3613
+ .hl-table[data-hl-size='lg'] {
3614
+ --_pad-y: var(--hl-space-3);
3615
+ --_pad-x: var(--hl-space-4);
3616
+
3617
+ font-size: var(--hl-text-base);
3618
3618
  }
3619
- }
3620
3619
 
3621
- .hl-table td[data-hl-align='end'],
3622
- .hl-table th[data-hl-align='end'] {
3623
- text-align: right;
3620
+ .hl-table[data-hl-align='start'] :is(th, td),
3621
+ .hl-table :is(th, td)[data-hl-align='start'] {
3622
+ text-align: start;
3624
3623
  }
3625
3624
 
3626
- .hl-table td[data-hl-align='center'],
3627
- .hl-table th[data-hl-align='center'] {
3625
+ .hl-table[data-hl-align='center'] :is(th, td),
3626
+ .hl-table :is(th, td)[data-hl-align='center'] {
3628
3627
  text-align: center;
3629
3628
  }
3629
+
3630
+ .hl-table[data-hl-align='end'] :is(th, td),
3631
+ .hl-table :is(th, td)[data-hl-align='end'] {
3632
+ text-align: end;
3633
+ }
3634
+
3635
+ @media (forced-colors: active) {
3636
+ .hl-table[data-hl-hover] tbody tr:hover {
3637
+ background: Highlight;
3638
+ color: HighlightText;
3639
+ }
3640
+ }
3630
3641
  }
3631
3642
 
3632
3643
  /* Navigation utilities */
3633
3644
 
3645
+ /**
3646
+ * Skip link: `<a class="hl-skip-link" href="#main">Skip to content</a>` placed
3647
+ * first in the body. Visually hidden until it receives keyboard focus, then
3648
+ * pinned to the start corner of the viewport. Pure CSS; there is no enhancer.
3649
+ */
3650
+
3634
3651
  @layer components {
3635
3652
  .hl-skip-link {
3636
3653
  position: absolute;
3637
- left: -9999px;
3638
- top: auto;
3639
- width: 1px;
3640
- height: 1px;
3654
+ inset-inline-start: -9999px;
3655
+ inset-block-start: auto;
3656
+ inline-size: 1px;
3657
+ block-size: 1px;
3641
3658
  overflow: hidden;
3642
3659
  }
3643
3660
 
3644
3661
  .hl-skip-link:focus-visible {
3645
- left: 0;
3646
- top: 0;
3647
- width: auto;
3648
- height: auto;
3649
- padding: 0.5rem 0.75rem;
3662
+ inset-inline-start: 0;
3663
+ inset-block-start: 0;
3664
+ inline-size: auto;
3665
+ block-size: auto;
3650
3666
  padding: var(--hl-space-2) var(--hl-space-3);
3651
- background: hsl(222, 47%, 11%);
3652
3667
  background: var(--hl-fg);
3653
- color: hsl(0, 0%, 100%);
3654
3668
  color: var(--hl-surface);
3655
- border-radius: 0.25rem;
3656
3669
  border-radius: var(--hl-radius-sm);
3657
- outline: 2px solid hsl(217, 91%, 60%);
3658
3670
  outline: var(--hl-focus-ring);
3659
3671
  }
3660
3672
  }