hydrateless 0.7.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 +1127 -532
  13. package/dist/disclosure.css +35 -12
  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 +1359 -1282
  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 +107 -28
  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,42 +1,65 @@
1
1
  /* Disclosure & layout */
2
+ /**
3
+ * Disclosure: a styled native `<details>`. The class and the `data-hl-disclosure`
4
+ * attribute (which also opts into the state enhancer) are interchangeable, so
5
+ * plain HTML needs only one of them.
6
+ *
7
+ * No-JS baseline: fully functional; exclusive groups need only a shared `name`
8
+ * attribute. The enhancer mirrors open state into its API and reads no other
9
+ * attributes.
10
+ */
2
11
  @layer components {
3
- details.hl-disclosure {
4
- border: 1px solid var(--hl-border);
12
+ details:is(.hl-disclosure, [data-hl-disclosure]) {
13
+ border: var(--hl-border-width) solid var(--hl-border);
5
14
  border-radius: var(--hl-radius-lg);
6
15
  background: var(--hl-surface);
7
16
  }
8
17
 
9
- details.hl-disclosure > summary {
18
+ details:is(.hl-disclosure, [data-hl-disclosure]) > summary {
19
+ display: flex;
20
+ align-items: center;
21
+ gap: var(--hl-space-2);
10
22
  list-style: none;
11
23
  cursor: pointer;
12
24
  padding: var(--hl-space-3) var(--hl-space-4);
13
25
  }
14
26
 
15
- details.hl-disclosure > summary::-webkit-details-marker {
27
+ details:is(.hl-disclosure, [data-hl-disclosure]) > summary::-webkit-details-marker {
16
28
  display: none;
17
29
  }
18
30
 
19
- details.hl-disclosure > summary:focus-visible {
31
+ details:is(.hl-disclosure, [data-hl-disclosure]) > summary:focus-visible {
20
32
  outline: var(--hl-focus-ring);
21
- outline-offset: 2px;
33
+ outline-offset: var(--hl-focus-offset);
22
34
  }
23
35
 
24
- details.hl-disclosure > summary::after {
36
+ /* The marker sits at the inline end so it lands on the left under RTL. */
37
+ details:is(.hl-disclosure, [data-hl-disclosure]) > summary::after {
25
38
  content: '\25B8';
26
- float: right;
27
- transition: transform var(--hl-duration-fast) var(--hl-ease-standard);
39
+ margin-inline-start: auto;
40
+ transition: rotate var(--hl-duration-fast) var(--hl-ease-standard);
41
+ }
42
+
43
+ details:is(.hl-disclosure, [data-hl-disclosure])[open] > summary::after {
44
+ rotate: 90deg;
28
45
  }
29
46
 
30
- details.hl-disclosure[open] > summary::after {
31
- transform: rotate(90deg);
47
+ /* Mirror the marker under RTL so it points into the reading direction, and
48
+ rotate the other way so the open state still points down. */
49
+ details:is(.hl-disclosure, [data-hl-disclosure]):dir(rtl) > summary::after {
50
+ scale: -1 1;
32
51
  }
33
52
 
34
- details.hl-disclosure > .hl-disclosure-panel {
53
+ details:is(.hl-disclosure, [data-hl-disclosure])[open]:dir(rtl) > summary::after {
54
+ rotate: -90deg;
55
+ }
56
+
57
+ details:is(.hl-disclosure, [data-hl-disclosure]) > .hl-disclosure-panel {
35
58
  padding: var(--hl-space-3) var(--hl-space-4) var(--hl-space-4);
36
59
  }
37
60
  }
38
61
  /**
39
- * Tabs. Two markups are supported and styled together:
62
+ * Tabs: `<div data-hl-tabs>`. Two markups are supported and styled together:
40
63
  *
41
64
  * - CSS-only baseline: `.hl-tablist` of `<label class="hl-tab">` wrapping a
42
65
  * radio, then a `.hl-tabpanels` of `.hl-tabpanel`s. `:has(input:checked)`
@@ -44,6 +67,10 @@
44
67
  * - Enhanced: the enhancer adds `role="tab"`/`tabpanel`, roving focus, and
45
68
  * `aria-selected`, toggles `[hidden]` on panels, and marks the root
46
69
  * `data-hl-ready`, at which point the no-JS rules below stand down.
70
+ * data-hl-tabs: root
71
+ * data-hl-ready: set by the enhancer
72
+ * `aria-orientation="vertical"` on the tablist stacks the tabs at the
73
+ * inline start of the panels.
47
74
  */
48
75
  @layer components {
49
76
  [data-hl-tabs] {
@@ -56,15 +83,23 @@
56
83
  display: flex;
57
84
  gap: var(--hl-space-2);
58
85
  padding: var(--hl-space-2);
59
- border-bottom: var(--hl-border-width) solid var(--hl-border);
86
+ border-block-end: var(--hl-border-width) solid var(--hl-border);
87
+ }
88
+
89
+ [data-hl-tabs]:has(> [role='tablist'][aria-orientation='vertical']) {
90
+ display: flex;
91
+ }
92
+
93
+ [data-hl-tabs] [role='tablist'][aria-orientation='vertical'] {
94
+ flex-direction: column;
95
+ border-block-end: 0;
96
+ border-inline-end: var(--hl-border-width) solid var(--hl-border);
60
97
  }
61
98
 
62
99
  .hl-tab,
63
100
  [data-hl-tabs] [role='tab'] {
64
101
  position: relative;
65
- -webkit-appearance: none;
66
- -moz-appearance: none;
67
- appearance: none;
102
+ appearance: none;
68
103
  display: inline-flex;
69
104
  align-items: center;
70
105
  background: transparent;
@@ -79,10 +114,7 @@
79
114
  /* The baseline keeps selection in a visually hidden radio per tab label. */
80
115
  .hl-tab > input[type='radio'] {
81
116
  position: absolute;
82
- top: 0;
83
- right: 0;
84
- bottom: 0;
85
- left: 0;
117
+ inset: 0;
86
118
  margin: 0;
87
119
  opacity: 0;
88
120
  cursor: pointer;
@@ -96,13 +128,13 @@
96
128
  .hl-tab:has(input:focus-visible),
97
129
  [data-hl-tabs] [role='tab']:focus-visible {
98
130
  outline: var(--hl-focus-ring);
99
- outline-offset: 2px;
131
+ outline-offset: var(--hl-focus-offset);
100
132
  }
101
133
 
102
134
  .hl-tab:has(input:disabled),
103
135
  [data-hl-tabs] [role='tab'][disabled],
104
136
  [data-hl-tabs] [role='tab'][aria-disabled='true'] {
105
- opacity: 0.5;
137
+ opacity: var(--hl-disabled-opacity);
106
138
  cursor: not-allowed;
107
139
  }
108
140
 
@@ -161,22 +193,49 @@
161
193
  [data-hl-tabs]:not([data-hl-ready]) [role='tabpanel'] ~ [role='tabpanel'] {
162
194
  display: none;
163
195
  }
196
+
197
+ /* Selection is a fill, which forced colors flatten; use the system highlight
198
+ and give every tab an edge. */
199
+ @media (forced-colors: active) {
200
+ .hl-tab,
201
+ [data-hl-tabs] [role='tab'] {
202
+ border: var(--hl-border-width) solid ButtonBorder;
203
+ }
204
+
205
+ .hl-tab:has(input:checked),
206
+ [data-hl-tabs] [role='tab'][aria-selected='true'] {
207
+ background: Highlight;
208
+ color: HighlightText;
209
+ }
210
+ }
164
211
  }
212
+ /**
213
+ * Accordion: `<div data-hl-accordion>` of native `<details>` items, each with a
214
+ * `<summary>` header and an `.hl-accordion-panel` body.
215
+ *
216
+ * No-JS baseline: `<details>` opens and closes on its own; exclusive groups
217
+ * need only a shared `name` attribute. The enhancer adds arrow-key movement
218
+ * between headers and the value API, and reads nothing else from the markup.
219
+ * data-hl-accordion: root (opts into the enhancer)
220
+ */
165
221
  @layer components {
166
222
  [data-hl-accordion] {
167
- border: 1px solid var(--hl-border);
223
+ border: var(--hl-border-width) solid var(--hl-border);
168
224
  border-radius: var(--hl-radius-lg);
169
225
  }
170
226
 
171
227
  [data-hl-accordion] > details {
172
- border-top: 1px solid var(--hl-border);
228
+ border-block-start: var(--hl-border-width) solid var(--hl-border);
173
229
  }
174
230
 
175
231
  [data-hl-accordion] > details:first-child {
176
- border-top: 0;
232
+ border-block-start: 0;
177
233
  }
178
234
 
179
235
  [data-hl-accordion] > details > summary {
236
+ display: flex;
237
+ align-items: center;
238
+ gap: var(--hl-space-2);
180
239
  list-style: none;
181
240
  cursor: pointer;
182
241
  padding: var(--hl-space-3) var(--hl-space-4);
@@ -188,27 +247,34 @@
188
247
 
189
248
  [data-hl-accordion] > details > summary:focus-visible {
190
249
  outline: var(--hl-focus-ring);
191
- outline-offset: 2px;
250
+ outline-offset: var(--hl-focus-offset);
192
251
  }
193
252
 
253
+ /* The chevron sits at the inline end so it lands on the left under RTL. */
194
254
  [data-hl-accordion] > details > summary::after {
195
255
  content: '\25BE';
196
- float: right;
197
- transform: rotate(0deg);
198
- transition: transform var(--hl-duration-fast) var(--hl-ease-standard);
256
+ margin-inline-start: auto;
257
+ transition: rotate var(--hl-duration-fast) var(--hl-ease-standard);
199
258
  }
200
259
 
201
260
  [data-hl-accordion] > details[open] > summary::after {
202
- transform: rotate(180deg);
261
+ rotate: 180deg;
203
262
  }
204
263
 
205
264
  [data-hl-accordion] > details > .hl-accordion-panel {
206
265
  padding: var(--hl-space-3) var(--hl-space-4) var(--hl-space-4);
207
266
  }
208
267
  }
268
+ /**
269
+ * Table of contents: `<nav data-hl-toc>` with nested `<ul>` lists of anchor
270
+ * links. With no JavaScript it is a plain link list; the enhancer marks the
271
+ * link for the heading in view with `aria-current="true"`.
272
+ * data-hl-toc: the nav
273
+ * data-hl-toc-content: optional element whose headings are observed
274
+ */
209
275
  @layer components {
210
276
  nav[data-hl-toc] {
211
- border: 1px solid var(--hl-border);
277
+ border: var(--hl-border-width) solid var(--hl-border);
212
278
  border-radius: var(--hl-radius-lg);
213
279
  padding: var(--hl-space-3);
214
280
  }
@@ -229,13 +295,12 @@
229
295
  padding: var(--hl-space-1) var(--hl-space-2);
230
296
  border-radius: var(--hl-radius-sm);
231
297
  color: inherit;
232
- -webkit-text-decoration: none;
233
298
  text-decoration: none;
234
299
  }
235
300
 
236
301
  nav[data-hl-toc] a:focus-visible {
237
302
  outline: var(--hl-focus-ring);
238
- outline-offset: -2px;
303
+ outline-offset: calc(var(--hl-focus-offset) * -1);
239
304
  }
240
305
 
241
306
  nav[data-hl-toc] a[aria-current='true'] {
@@ -243,9 +308,22 @@
243
308
  }
244
309
 
245
310
  nav[data-hl-toc] ul ul {
246
- padding-left: var(--hl-space-3);
311
+ padding-inline-start: var(--hl-space-3);
312
+ }
313
+
314
+ @media (forced-colors: active) {
315
+ nav[data-hl-toc] a[aria-current='true'] {
316
+ background: Highlight;
317
+ color: HighlightText;
318
+ }
247
319
  }
248
320
  }
321
+ /**
322
+ * Breadcrumb: `<nav data-hl-breadcrumb aria-label="Breadcrumb">` wrapping an
323
+ * `<ol>` of links; the current page carries `aria-current="page"`. Pure CSS;
324
+ * there is no enhancer. Order follows the writing direction, so the trail
325
+ * reads right to left under RTL.
326
+ */
249
327
  @layer components {
250
328
  nav[data-hl-breadcrumb] ol {
251
329
  display: flex;
@@ -270,19 +348,17 @@
270
348
 
271
349
  nav[data-hl-breadcrumb] a {
272
350
  color: var(--hl-primary);
273
- -webkit-text-decoration: none;
274
351
  text-decoration: none;
275
352
  border-radius: var(--hl-radius-sm);
276
353
  }
277
354
 
278
355
  nav[data-hl-breadcrumb] a:hover {
279
- -webkit-text-decoration: underline;
280
356
  text-decoration: underline;
281
357
  }
282
358
 
283
359
  nav[data-hl-breadcrumb] a:focus-visible {
284
360
  outline: var(--hl-focus-ring);
285
- outline-offset: 2px;
361
+ outline-offset: var(--hl-focus-offset);
286
362
  }
287
363
 
288
364
  nav[data-hl-breadcrumb] [aria-current='page'] {
@@ -292,7 +368,8 @@
292
368
  /**
293
369
  * Pagination: `<nav class="hl-pagination" aria-label="Pagination">` wrapping a
294
370
  * list of `.hl-pagination-item` links/buttons; mark the active page with
295
- * `aria-current="page"` and use `.hl-pagination-ellipsis` for gaps.
371
+ * `aria-current="page"` and use `.hl-pagination-ellipsis` for gaps. Pure CSS;
372
+ * there is no enhancer. Item order follows the writing direction.
296
373
  */
297
374
  @layer components {
298
375
  .hl-pagination ul {
@@ -310,17 +387,15 @@
310
387
  align-items: center;
311
388
  justify-content: center;
312
389
  gap: var(--hl-space-1);
313
- min-width: 2.25rem;
314
- height: 2.25rem;
315
- padding-left: var(--hl-space-2);
316
- padding-right: var(--hl-space-2);
390
+ min-inline-size: var(--hl-control-block-size);
391
+ block-size: var(--hl-control-block-size);
392
+ padding-inline: var(--hl-space-2);
317
393
  border: var(--hl-border-width) solid transparent;
318
394
  border-radius: var(--hl-radius-md);
319
395
  background: transparent;
320
396
  color: var(--hl-fg);
321
397
  font: inherit;
322
398
  font-size: var(--hl-text-sm);
323
- -webkit-text-decoration: none;
324
399
  text-decoration: none;
325
400
  cursor: pointer;
326
401
  transition: background-color var(--hl-duration-fast) var(--hl-ease-standard);
@@ -332,7 +407,7 @@
332
407
 
333
408
  .hl-pagination-item:focus-visible {
334
409
  outline: var(--hl-focus-ring);
335
- outline-offset: 2px;
410
+ outline-offset: var(--hl-focus-offset);
336
411
  }
337
412
 
338
413
  .hl-pagination-item[aria-current='page'] {
@@ -343,7 +418,7 @@
343
418
 
344
419
  .hl-pagination-item[aria-disabled='true'],
345
420
  .hl-pagination-item:disabled {
346
- opacity: 0.45;
421
+ opacity: var(--hl-disabled-opacity);
347
422
  pointer-events: none;
348
423
  }
349
424
 
@@ -351,17 +426,29 @@
351
426
  display: inline-flex;
352
427
  align-items: center;
353
428
  justify-content: center;
354
- min-width: 2.25rem;
355
- height: 2.25rem;
429
+ min-inline-size: var(--hl-control-block-size);
430
+ block-size: var(--hl-control-block-size);
356
431
  color: var(--hl-fg-subtle);
357
432
  -webkit-user-select: none;
358
- -moz-user-select: none;
359
433
  user-select: none;
360
434
  }
435
+
436
+ @media (forced-colors: active) {
437
+ .hl-pagination-item[aria-current='page'] {
438
+ border-color: Highlight;
439
+ }
440
+
441
+ .hl-pagination-item[aria-disabled='true'],
442
+ .hl-pagination-item:disabled {
443
+ color: GrayText;
444
+ }
445
+ }
361
446
  }
362
447
  /**
363
448
  * Separator: `<hr class="hl-separator">` or
364
449
  * `<div class="hl-separator" role="separator" aria-orientation="vertical">`.
450
+ * Pure CSS; there is no enhancer.
451
+ * data-hl-orientation: vertical (alternative to aria-orientation)
365
452
  */
366
453
  @layer components {
367
454
  .hl-separator {
@@ -370,157 +457,239 @@
370
457
  background: var(--hl-border);
371
458
  }
372
459
 
373
- .hl-separator:not([aria-orientation='vertical']):not([data-hl-orientation='vertical']) {
374
- width: 100%;
375
- height: var(--hl-border-width);
376
- margin-top: var(--hl-space-4);
377
- margin-bottom: var(--hl-space-4);
460
+ .hl-separator:not([aria-orientation='vertical'], [data-hl-orientation='vertical']) {
461
+ inline-size: 100%;
462
+ block-size: var(--hl-border-width);
463
+ margin-block: var(--hl-space-4);
378
464
  }
379
465
 
380
466
  .hl-separator[aria-orientation='vertical'],
381
467
  .hl-separator[data-hl-orientation='vertical'] {
382
468
  align-self: stretch;
383
- width: var(--hl-border-width);
384
- min-height: 1rem;
385
- margin-left: var(--hl-space-4);
386
- margin-right: var(--hl-space-4);
469
+ inline-size: var(--hl-border-width);
470
+ min-block-size: 1rem;
471
+ margin-inline: var(--hl-space-4);
387
472
  }
388
473
  }
389
474
  /* Overlays */
475
+ /**
476
+ * Modal: a native `<dialog class="hl-modal">` (or `<dialog data-hl-modal>`)
477
+ * with optional `.hl-modal-header`, `.hl-modal-body`, and `.hl-modal-footer`.
478
+ *
479
+ * No-JS baseline: `<button command="show-modal" commandfor="id">` opens it and
480
+ * `command="close"` closes it; Escape and the backdrop are native. The
481
+ * enhancer only adds focus return, backdrop dismiss, and the open API, and
482
+ * reads nothing beyond `data-hl-modal`.
483
+ */
390
484
  @layer components {
391
- .hl-modal {
485
+ :is(.hl-modal, dialog[data-hl-modal]) {
486
+ inline-size: min(90vi, var(--hl-modal-inline-size));
487
+ max-inline-size: none;
488
+ padding: 0;
392
489
  border: none;
393
490
  border-radius: var(--hl-radius-lg);
394
- padding: 0;
395
- max-width: min(90vw, 640px);
396
- width: 100%;
397
491
  background: var(--hl-surface);
398
492
  color: var(--hl-fg);
399
493
  box-shadow: var(--hl-overlay-shadow);
494
+ transition:
495
+ opacity var(--hl-duration-base) var(--hl-ease-standard),
496
+ translate var(--hl-duration-base) var(--hl-ease-standard),
497
+ display var(--hl-duration-base) allow-discrete,
498
+ overlay var(--hl-duration-base) allow-discrete;
499
+ }
500
+
501
+ /* Closed state doubles as the exit target of the transition. */
502
+ :is(.hl-modal, dialog[data-hl-modal]):not([open]) {
503
+ opacity: 0;
504
+ translate: 0 var(--hl-space-2);
505
+ }
506
+
507
+ @starting-style {
508
+ :is(.hl-modal, dialog[data-hl-modal])[open] {
509
+ opacity: 0;
510
+ translate: 0 var(--hl-space-2);
511
+ }
400
512
  }
401
513
 
402
- .hl-modal::backdrop {
514
+ :is(.hl-modal, dialog[data-hl-modal])::backdrop {
403
515
  background: var(--hl-scrim);
516
+ opacity: 0;
517
+ transition:
518
+ opacity var(--hl-duration-base) var(--hl-ease-standard),
519
+ display var(--hl-duration-base) allow-discrete,
520
+ overlay var(--hl-duration-base) allow-discrete;
404
521
  }
405
522
 
406
- .hl-modal .hl-modal-header,
407
- .hl-modal .hl-modal-body,
408
- .hl-modal .hl-modal-footer {
523
+ :is(.hl-modal, dialog[data-hl-modal])[open]::backdrop {
524
+ opacity: 1;
525
+ }
526
+
527
+ @starting-style {
528
+ :is(.hl-modal, dialog[data-hl-modal])[open]::backdrop {
529
+ opacity: 0;
530
+ }
531
+ }
532
+
533
+ :is(.hl-modal, dialog[data-hl-modal]) :is(.hl-modal-header, .hl-modal-body, .hl-modal-footer) {
409
534
  padding: var(--hl-space-4);
410
535
  }
411
536
 
412
- .hl-modal .hl-modal-header {
413
- border-bottom: 1px solid var(--hl-border);
537
+ :is(.hl-modal, dialog[data-hl-modal]) .hl-modal-header {
538
+ border-block-end: var(--hl-border-width) solid var(--hl-border);
414
539
  }
415
540
 
416
- .hl-modal .hl-modal-footer {
417
- border-top: 1px solid var(--hl-border);
541
+ :is(.hl-modal, dialog[data-hl-modal]) .hl-modal-footer {
542
+ border-block-start: var(--hl-border-width) solid var(--hl-border);
418
543
  }
419
544
 
420
- .hl-modal [command='close']:focus-visible {
545
+ /* Interactive children inside the dialog get the standard ring. */
546
+ :is(.hl-modal, dialog[data-hl-modal])
547
+ :is(a, button, input, select, textarea, [tabindex]):focus-visible {
421
548
  outline: var(--hl-focus-ring);
422
- outline-offset: 2px;
549
+ outline-offset: var(--hl-focus-offset);
550
+ }
551
+
552
+ /* The dialog loses its shadow in forced colors; a border keeps its edge. */
553
+ @media (forced-colors: active) {
554
+ :is(.hl-modal, dialog[data-hl-modal]) {
555
+ border: var(--hl-border-width) solid CanvasText;
556
+ }
423
557
  }
424
558
  }
559
+ /**
560
+ * Drawer: a native `<dialog class="hl-drawer">` (or `<dialog data-hl-drawer>`)
561
+ * pinned to one inline edge of the viewport, with optional `.hl-drawer-header`,
562
+ * `.hl-drawer-body`, and `.hl-drawer-footer`.
563
+ *
564
+ * No-JS baseline: `<button command="show-modal" commandfor="id">` opens it and
565
+ * `command="close"` closes it; Escape is native. The enhancer only adds focus
566
+ * return, backdrop dismiss, and the open API.
567
+ * data-hl-side: start | end (default). Logical edges, so they flip under RTL.
568
+ */
425
569
  @layer components {
426
- dialog.hl-drawer {
427
- border: none;
428
- padding: 0;
429
- width: min(90vw, 360px);
430
- max-height: 100dvh;
570
+ :is(.hl-drawer, dialog[data-hl-drawer]) {
571
+ --_slide: 100%;
572
+
573
+ inset-block: 0;
574
+ inset-inline: auto 0;
575
+ inline-size: min(90vi, var(--hl-overlay-inline-size));
576
+ block-size: 100dvb;
577
+ max-block-size: 100dvb;
578
+ max-inline-size: none;
431
579
  margin: 0;
580
+ padding: 0;
581
+ border: none;
432
582
  background: var(--hl-surface);
433
583
  color: var(--hl-fg);
434
584
  box-shadow: var(--hl-overlay-shadow);
585
+ transition:
586
+ translate var(--hl-duration-slow) var(--hl-ease-emphasized),
587
+ display var(--hl-duration-slow) allow-discrete,
588
+ overlay var(--hl-duration-slow) allow-discrete;
435
589
  }
436
590
 
437
- dialog.hl-drawer::backdrop {
438
- background: var(--hl-scrim);
439
- }
591
+ :is(.hl-drawer, dialog[data-hl-drawer])[data-hl-side='start'] {
592
+ --_slide: -100%;
440
593
 
441
- .hl-drawer[open] {
442
- animation: hl-drawer-in-right var(--hl-duration-base) var(--hl-ease-standard);
594
+ inset-inline: 0 auto;
443
595
  }
444
596
 
445
- @keyframes hl-drawer-in-right {
446
- from {
447
- transform: translateX(100%);
448
- }
597
+ /* `translate` is physical, so the slide direction mirrors under RTL. */
598
+ :is(.hl-drawer, dialog[data-hl-drawer]):dir(rtl) {
599
+ --_slide: -100%;
600
+ }
449
601
 
450
- to {
451
- transform: translateX(0%);
452
- }
602
+ :is(.hl-drawer, dialog[data-hl-drawer])[data-hl-side='start']:dir(rtl) {
603
+ --_slide: 100%;
453
604
  }
454
605
 
455
- @keyframes hl-drawer-in-left {
456
- from {
457
- transform: translateX(-100%);
458
- }
606
+ /* Closed state doubles as the exit target of the slide. */
607
+ :is(.hl-drawer, dialog[data-hl-drawer]):not([open]) {
608
+ translate: var(--_slide) 0;
609
+ }
459
610
 
460
- to {
461
- transform: translateX(0%);
462
- }
611
+ /* A column so the body scrolls between a fixed header and footer. */
612
+ :is(.hl-drawer, dialog[data-hl-drawer])[open] {
613
+ display: flex;
614
+ flex-direction: column;
463
615
  }
464
616
 
465
- @media (prefers-reduced-motion: reduce) {
466
- .hl-drawer[open] {
467
- animation: none;
617
+ @starting-style {
618
+ :is(.hl-drawer, dialog[data-hl-drawer])[open] {
619
+ translate: var(--_slide) 0;
468
620
  }
469
621
  }
470
622
 
471
- .hl-drawer[data-side='left'] {
472
- width: auto;
473
- top: 0;
474
- right: auto;
475
- bottom: 0;
476
- left: 0;
623
+ :is(.hl-drawer, dialog[data-hl-drawer])::backdrop {
624
+ background: var(--hl-scrim);
625
+ opacity: 0;
626
+ transition:
627
+ opacity var(--hl-duration-slow) var(--hl-ease-standard),
628
+ display var(--hl-duration-slow) allow-discrete,
629
+ overlay var(--hl-duration-slow) allow-discrete;
477
630
  }
478
631
 
479
- .hl-drawer[data-side='left'][open] {
480
- animation-name: hl-drawer-in-left;
632
+ :is(.hl-drawer, dialog[data-hl-drawer])[open]::backdrop {
633
+ opacity: 1;
481
634
  }
482
635
 
483
- .hl-drawer[data-side='right'] {
484
- width: auto;
485
- top: 0;
486
- right: 0;
487
- bottom: 0;
488
- left: auto;
636
+ @starting-style {
637
+ :is(.hl-drawer, dialog[data-hl-drawer])[open]::backdrop {
638
+ opacity: 0;
639
+ }
489
640
  }
490
641
 
491
- .hl-drawer .hl-drawer-header,
492
- .hl-drawer .hl-drawer-body,
493
- .hl-drawer .hl-drawer-footer {
642
+ :is(.hl-drawer, dialog[data-hl-drawer])
643
+ :is(.hl-drawer-header, .hl-drawer-body, .hl-drawer-footer) {
494
644
  padding: var(--hl-space-4);
495
645
  }
496
646
 
497
- .hl-drawer .hl-drawer-header {
498
- border-bottom: 1px solid var(--hl-border);
647
+ :is(.hl-drawer, dialog[data-hl-drawer]) .hl-drawer-body {
648
+ flex: 1 1 auto;
649
+ overflow-y: auto;
650
+ }
651
+
652
+ :is(.hl-drawer, dialog[data-hl-drawer]) .hl-drawer-header {
653
+ border-block-end: var(--hl-border-width) solid var(--hl-border);
499
654
  }
500
655
 
501
- .hl-drawer .hl-drawer-footer {
502
- border-top: 1px solid var(--hl-border);
656
+ :is(.hl-drawer, dialog[data-hl-drawer]) .hl-drawer-footer {
657
+ border-block-start: var(--hl-border-width) solid var(--hl-border);
658
+ }
659
+
660
+ /* Interactive children inside the drawer get the standard ring. */
661
+ :is(.hl-drawer, dialog[data-hl-drawer])
662
+ :is(a, button, input, select, textarea, [tabindex]):focus-visible {
663
+ outline: var(--hl-focus-ring);
664
+ outline-offset: var(--hl-focus-offset);
503
665
  }
504
666
  }
505
667
  /**
506
668
  * Popover: a `[popover] [data-hl-popover]` surface opened by a
507
- * `<button popovertarget="…">` (or `command="toggle-popover"`). The browser
508
- * owns the top layer, light-dismiss, and Escape with no JavaScript; the
509
- * enhancer only mirrors `aria-expanded`, adds optional hover, and runs the JS
510
- * positioning fallback on engines without CSS anchor positioning.
669
+ * `<button popovertarget="...">` (or `command="toggle-popover"`).
670
+ *
671
+ * No-JS baseline: the browser owns the top layer, light dismiss, and Escape,
672
+ * so the popover is fully usable with `popover` and `popovertarget` in the
673
+ * markup. The enhancer only mirrors `aria-expanded`, adds optional hover, and
674
+ * runs the JS positioning fallback on engines without CSS anchor positioning.
675
+ * data-hl-popover: the surface (opts into the enhancer)
511
676
  */
512
677
  @layer components {
513
678
  [data-hl-popover] {
514
679
  margin: 0;
515
- width: -moz-max-content;
516
- width: max-content;
517
- max-width: min(92vw, 22rem);
680
+ inline-size: max-content;
681
+ max-inline-size: min(92vi, 22rem);
518
682
  border: var(--hl-border-width) solid var(--hl-border);
519
683
  border-radius: var(--hl-radius-lg);
520
684
  padding: var(--hl-space-3);
521
685
  background: var(--hl-surface);
522
686
  color: var(--hl-fg);
523
687
  box-shadow: var(--hl-overlay-shadow);
688
+ transition:
689
+ opacity var(--hl-duration-fast) var(--hl-ease-standard),
690
+ translate var(--hl-duration-fast) var(--hl-ease-standard),
691
+ display var(--hl-duration-fast) allow-discrete,
692
+ overlay var(--hl-duration-fast) allow-discrete;
524
693
  }
525
694
 
526
695
  /* Until the `popover` attribute is present (author omitted it and JS hasn't
@@ -529,10 +698,21 @@
529
698
  display: none;
530
699
  }
531
700
 
532
- /* Engines without the Popover API can't promote it to the top layer, so the
533
- JS fallback positions it; give it a stacking context to land above content. */
701
+ /* Closed state and exit target. Engines without the Popover API can't
702
+ promote it to the top layer, so the JS fallback positions it; the z-index
703
+ lands it above content. Those engines drop this rule, so nothing is
704
+ hidden by accident. */
534
705
  [data-hl-popover]:not(:popover-open) {
535
706
  z-index: var(--hl-z-popover);
707
+ opacity: 0;
708
+ translate: 0 -0.25rem;
709
+ }
710
+
711
+ @starting-style {
712
+ [data-hl-popover]:popover-open {
713
+ opacity: 0;
714
+ translate: 0 -0.25rem;
715
+ }
536
716
  }
537
717
 
538
718
  /* Modern placement: anchor to the invoking control (the popover's implicit
@@ -541,21 +721,32 @@
541
721
  @supports (position-area: block-end) {
542
722
  [data-hl-popover] {
543
723
  position: fixed;
544
- inset-area: block-end;
545
724
  position-area: block-end;
546
725
  position-try-fallbacks: flip-block, flip-inline;
547
- margin-top: var(--hl-space-1);
548
- margin-bottom: var(--hl-space-1);
726
+ margin-block: var(--hl-space-1);
549
727
  }
550
728
  }
729
+
730
+ /* Interactive children inside the surface get the standard ring. */
731
+ [data-hl-popover] :is(a, button, input, select, textarea, [tabindex]):focus-visible {
732
+ outline: var(--hl-focus-ring);
733
+ outline-offset: var(--hl-focus-offset);
734
+ }
551
735
  }
552
736
  /**
553
737
  * Tooltip: a `[role="tooltip"]` element described by a `[data-hl-tooltip]`
554
- * trigger. With no JavaScript it shows on the trigger's `:hover`/`:focus-visible`
555
- * (the tip must be the trigger's next sibling). When the enhancer runs it marks
556
- * the trigger `data-hl-tooltip-managed` and drives visibility through
557
- * `data-hl-tooltip-open` instead, adding show/hide delays, a grace period, and
558
- * Escape-to-dismiss.
738
+ * trigger.
739
+ *
740
+ * No-JS baseline: the tip (the trigger's next sibling, carrying `hidden`)
741
+ * shows on the trigger's `:hover`/`:focus-visible`. When the enhancer runs it
742
+ * marks the trigger `data-hl-tooltip-managed`, promotes the tip to a
743
+ * `popover="manual"` in the top layer where available (otherwise toggles
744
+ * `hidden`), and drives visibility through `data-hl-tooltip-open` with show
745
+ * and hide delays, a grace period, and Escape to dismiss.
746
+ * data-hl-tooltip: the trigger
747
+ * data-hl-placement: top (default) | bottom | left | right, on the trigger
748
+ * data-hl-tooltip-managed: set on the trigger by the enhancer
749
+ * data-hl-tooltip-open: set on the tip while shown
559
750
  */
560
751
  @layer components {
561
752
  [role='tooltip'] {
@@ -563,26 +754,43 @@
563
754
  engines without CSS anchor positioning. */
564
755
  position: absolute;
565
756
  z-index: var(--hl-z-tooltip);
566
- width: -moz-max-content;
567
- width: max-content;
568
- max-width: 32ch;
757
+ inline-size: max-content;
758
+ max-inline-size: 32ch;
569
759
  margin: 0;
570
760
  padding: var(--hl-space-1) var(--hl-space-2);
761
+ border: 0;
571
762
  border-radius: var(--hl-radius-sm);
572
763
  background: var(--hl-fg);
573
764
  color: var(--hl-surface);
574
765
  font-size: var(--hl-text-sm);
766
+ opacity: 0;
767
+ translate: 0 0.25rem;
768
+ transition:
769
+ opacity var(--hl-duration-fast) var(--hl-ease-standard),
770
+ translate var(--hl-duration-fast) var(--hl-ease-standard),
771
+ display var(--hl-duration-fast) allow-discrete,
772
+ overlay var(--hl-duration-fast) allow-discrete;
575
773
  }
576
774
 
577
775
  [role='tooltip'][hidden] {
578
776
  display: none;
579
777
  }
580
778
 
581
- /* No-JS baseline: reveal while the adjacent trigger is hovered or focused.
582
- Suppressed once the enhancer takes over (trigger gains -managed). */
583
- [data-hl-tooltip]:not([data-hl-tooltip-managed]):hover + [role='tooltip'],
584
- [data-hl-tooltip]:not([data-hl-tooltip-managed]):focus-visible + [role='tooltip'] {
779
+ /* Shown states: the enhanced popover, the enhanced `hidden` fallback, and
780
+ the no-JS hover/focus baseline (suppressed once the trigger is managed). */
781
+ [role='tooltip']:is(:popover-open, [data-hl-tooltip-open]),
782
+ [data-hl-tooltip]:not([data-hl-tooltip-managed]):is(:hover, :focus-visible) + [role='tooltip'] {
585
783
  display: block;
784
+ opacity: 1;
785
+ translate: 0 0;
786
+ }
787
+
788
+ @starting-style {
789
+ [role='tooltip']:is(:popover-open, [data-hl-tooltip-open]),
790
+ [data-hl-tooltip]:not([data-hl-tooltip-managed]):is(:hover, :focus-visible) + [role='tooltip'] {
791
+ opacity: 0;
792
+ translate: 0 0.25rem;
793
+ }
586
794
  }
587
795
 
588
796
  /* Modern placement: pin above the trigger via the anchor-name the enhancer
@@ -590,20 +798,34 @@
590
798
  @supports (anchor-name: --x) {
591
799
  [role='tooltip'] {
592
800
  position: fixed;
593
- inset-area: block-start;
801
+ inset: auto;
594
802
  position-area: block-start;
595
803
  position-try-fallbacks: flip-block;
596
- margin-top: var(--hl-space-1);
597
- margin-bottom: var(--hl-space-1);
804
+ margin-block: var(--hl-space-1);
805
+ }
806
+ }
807
+
808
+ /* Inverted colors flatten away; keep a visible edge on the system canvas. */
809
+ @media (forced-colors: active) {
810
+ [role='tooltip'] {
811
+ border: var(--hl-border-width) solid CanvasText;
598
812
  }
599
813
  }
600
814
  }
601
815
  /**
602
816
  * Dropdown menu button: `<div data-hl-dropdown>` wrapping a
603
- * `[data-hl-dropdown-trigger]` button and a `[data-hl-dropdown-menu]` list. The
604
- * enhancer turns the menu into a native `popover` the trigger controls through
605
- * `popovertarget`, so opening, Escape, and light-dismiss need no JavaScript;
606
- * the menu lives in the top layer and is placed with CSS anchor positioning.
817
+ * `[data-hl-dropdown-trigger]` button and a `[data-hl-dropdown-menu]` list.
818
+ *
819
+ * No-JS baseline: the menu is a native `popover` and the trigger points at it
820
+ * with `popovertarget`, so opening, Escape, and light dismiss work before any
821
+ * script runs; both attributes must be in the markup. The enhancer adds arrow
822
+ * keys, typeahead, checkable items, and focus return, and reads:
823
+ * data-hl-dropdown: root
824
+ * data-hl-dropdown-trigger: the button
825
+ * data-hl-dropdown-menu: the `<ul>` (or any list) of items
826
+ * data-hl-value: an item's value for `hl:select`
827
+ * Items are `role="menuitem"`, `menuitemcheckbox`, or `menuitemradio`, either
828
+ * directly in the list, inside `<li>`, or inside `<li><ul role="group">`.
607
829
  */
608
830
  @layer components {
609
831
  [data-hl-dropdown] {
@@ -612,70 +834,132 @@
612
834
 
613
835
  [data-hl-dropdown-menu] {
614
836
  margin: 0;
615
- min-width: 10rem;
837
+ min-inline-size: 10rem;
616
838
  border: var(--hl-border-width) solid var(--hl-border);
617
839
  border-radius: var(--hl-radius-lg);
618
840
  background: var(--hl-surface);
619
841
  box-shadow: var(--hl-overlay-shadow);
620
842
  padding: var(--hl-space-1);
621
843
  list-style: none;
844
+ transition:
845
+ opacity var(--hl-duration-fast) var(--hl-ease-standard),
846
+ translate var(--hl-duration-fast) var(--hl-ease-standard),
847
+ display var(--hl-duration-fast) allow-discrete,
848
+ overlay var(--hl-duration-fast) allow-discrete;
622
849
  }
623
850
 
624
- /* Before the menu is promoted to a popover (JS not yet loaded), hide it. */
625
- [data-hl-dropdown-menu]:not([popover]) {
626
- display: none;
627
- }
628
-
851
+ /* Closed state doubles as the exit target. Engines without the Popover API
852
+ drop this rule, so nothing is hidden by accident. */
629
853
  [data-hl-dropdown-menu]:not(:popover-open) {
630
854
  z-index: var(--hl-z-dropdown);
855
+ opacity: 0;
856
+ translate: 0 -0.25rem;
857
+ }
858
+
859
+ @starting-style {
860
+ [data-hl-dropdown-menu]:popover-open {
861
+ opacity: 0;
862
+ translate: 0 -0.25rem;
863
+ }
631
864
  }
632
865
 
633
866
  /* Open below the trigger, start-aligned, flipping when cramped. */
634
867
  @supports (position-area: block-end) {
635
868
  [data-hl-dropdown-menu] {
636
869
  position: fixed;
637
- inset-area: block-end span-inline-end;
638
870
  position-area: block-end span-inline-end;
639
871
  position-try-fallbacks: flip-block, flip-inline;
640
- margin-top: var(--hl-space-1);
641
- margin-bottom: var(--hl-space-1);
872
+ margin-block: var(--hl-space-1);
642
873
  }
643
874
  }
644
875
 
645
- [data-hl-dropdown-menu] [role='menuitem'] {
646
- display: block;
647
- width: 100%;
876
+ [data-hl-dropdown-menu] [role='group'] {
877
+ margin: 0;
878
+ padding: 0;
879
+ list-style: none;
880
+ }
881
+
882
+ [data-hl-dropdown-menu] [role^='menuitem'] {
883
+ display: flex;
884
+ align-items: center;
885
+ gap: var(--hl-space-2);
886
+ inline-size: 100%;
648
887
  padding: var(--hl-space-2) var(--hl-space-3);
649
888
  border: none;
650
889
  border-radius: var(--hl-radius-sm);
651
890
  background: transparent;
652
- text-align: left;
891
+ text-align: start;
653
892
  cursor: pointer;
654
893
  color: inherit;
655
894
  font: inherit;
656
895
  }
657
896
 
658
- [data-hl-dropdown-menu] [role='menuitem']:hover,
659
- [data-hl-dropdown-menu] [role='menuitem'][data-hl-active] {
897
+ [data-hl-dropdown-menu] [role^='menuitem']:hover {
660
898
  background: var(--hl-surface-2);
661
899
  }
662
900
 
663
- [data-hl-dropdown-menu] [role='menuitem']:focus-visible {
901
+ [data-hl-dropdown-menu] [role^='menuitem']:focus-visible {
664
902
  outline: var(--hl-focus-ring);
665
- outline-offset: -2px;
903
+ outline-offset: calc(var(--hl-focus-offset) * -1);
904
+ }
905
+
906
+ /* Checkable items reserve room for a mark so labels line up. */
907
+ [data-hl-dropdown-menu] :is([role='menuitemcheckbox'], [role='menuitemradio'])::before {
908
+ content: '';
909
+ flex: none;
910
+ inline-size: 1em;
911
+ block-size: 1em;
912
+ line-height: 1;
913
+ text-align: center;
914
+ color: var(--hl-primary);
915
+ }
916
+
917
+ [data-hl-dropdown-menu] [role='menuitemcheckbox'][aria-checked='true']::before {
918
+ content: '\2713';
919
+ }
920
+
921
+ [data-hl-dropdown-menu] [role='menuitemradio'][aria-checked='true']::before {
922
+ background: currentcolor;
923
+ border-radius: var(--hl-radius-full);
924
+ scale: 0.5;
925
+ }
926
+
927
+ [data-hl-dropdown-menu] [role^='menuitem']:is(:disabled, [aria-disabled='true']) {
928
+ opacity: var(--hl-disabled-opacity);
929
+ cursor: not-allowed;
666
930
  }
667
931
 
668
932
  [data-hl-dropdown-menu] [role='separator'] {
669
- height: 1px;
933
+ block-size: var(--hl-border-width);
670
934
  margin: var(--hl-space-1) 0;
671
935
  background: var(--hl-border);
672
936
  border: none;
673
937
  }
938
+
939
+ @media (forced-colors: active) {
940
+ [data-hl-dropdown-menu] [role^='menuitem']:is(:disabled, [aria-disabled='true']) {
941
+ color: GrayText;
942
+ }
943
+
944
+ [data-hl-dropdown-menu] [role='separator'] {
945
+ background: CanvasText;
946
+ }
947
+ }
674
948
  }
675
949
  /**
676
- * Menubar / navigation menu: `<ul data-hl-menu role="menubar">` with optional
677
- * single-level submenus (`<ul role="menu" data-hl-menu-submenu>`). The enhancer
678
- * handles roving focus, arrow navigation, and open/close.
950
+ * Menubar / navigation menu: `<ul data-hl-menu role="menubar">` of `<li>`
951
+ * items, each optionally holding a trigger and a single-level submenu
952
+ * (`<ul role="menu">` or `[data-hl-menu-submenu]`) as siblings inside the `<li>`.
953
+ *
954
+ * No-JS baseline: a submenu shows while its `<li>` is hovered or has focus
955
+ * within it, so every link stays reachable by mouse and keyboard. The enhancer
956
+ * marks the root `data-hl-ready`, after which it owns visibility (`hidden`
957
+ * plus a top-layer `popover`) and adds roving focus, arrow keys, typeahead,
958
+ * and checkable items. It reads:
959
+ * data-hl-menu: root; `aria-orientation="vertical"` stacks it
960
+ * data-hl-menu-submenu: a submenu without `role="menu"`
961
+ * data-hl-value: a top-level trigger's value for `hl:change`
962
+ * data-hl-ready: set by the enhancer
679
963
  */
680
964
  @layer components {
681
965
  [data-hl-menu] {
@@ -697,11 +981,11 @@
697
981
  position: relative;
698
982
  }
699
983
 
700
- [data-hl-menu] [role='menuitem'] {
984
+ [data-hl-menu] [role^='menuitem'] {
701
985
  display: flex;
702
986
  align-items: center;
703
987
  gap: var(--hl-space-2);
704
- width: 100%;
988
+ inline-size: 100%;
705
989
  padding: var(--hl-space-2) var(--hl-space-3);
706
990
  border: 0;
707
991
  border-radius: var(--hl-radius-md);
@@ -709,43 +993,45 @@
709
993
  color: var(--hl-fg);
710
994
  font: inherit;
711
995
  font-size: var(--hl-text-sm);
712
- text-align: left;
713
- -webkit-text-decoration: none;
996
+ text-align: start;
714
997
  text-decoration: none;
715
998
  white-space: nowrap;
716
999
  cursor: pointer;
717
1000
  }
718
1001
 
719
- [data-hl-menu] [role='menuitem']:hover {
1002
+ [data-hl-menu] [role^='menuitem']:hover,
1003
+ [data-hl-menu] [role^='menuitem'][aria-expanded='true'] {
720
1004
  background: var(--hl-surface-2);
721
1005
  }
722
1006
 
723
- [data-hl-menu] [role='menuitem']:focus-visible {
1007
+ [data-hl-menu] [role^='menuitem']:focus-visible {
724
1008
  outline: var(--hl-focus-ring);
725
- outline-offset: -2px;
1009
+ outline-offset: calc(var(--hl-focus-offset) * -1);
726
1010
  }
727
1011
 
728
- [data-hl-menu] [role='menuitem'][aria-expanded='true'] {
729
- background: var(--hl-surface-2);
1012
+ [data-hl-menu] [role^='menuitem']:is(:disabled, [aria-disabled='true']) {
1013
+ opacity: var(--hl-disabled-opacity);
1014
+ cursor: not-allowed;
730
1015
  }
731
1016
 
732
- [data-hl-menu] [role='menuitem'][aria-haspopup]::after {
1017
+ /* Submenu chevron: a rotated square corner at the inline end. */
1018
+ [data-hl-menu] [role^='menuitem'][aria-haspopup]::after {
733
1019
  content: '';
734
- width: 0.4rem;
735
- height: 0.4rem;
736
- margin-left: auto;
737
- border-right: 1.5px solid currentcolor;
738
- border-bottom: 1.5px solid currentcolor;
739
- transform: rotate(45deg);
1020
+ inline-size: 0.4rem;
1021
+ block-size: 0.4rem;
1022
+ margin-inline-start: auto;
1023
+ border-inline-end: 1.5px solid currentcolor;
1024
+ border-block-end: 1.5px solid currentcolor;
1025
+ rotate: 45deg;
740
1026
  opacity: 0.6;
741
1027
  }
742
1028
 
743
- [data-hl-menu] [role='menu'] {
1029
+ [data-hl-menu] :is([role='menu'], [data-hl-menu-submenu]) {
744
1030
  position: absolute;
745
- top: calc(100% + var(--hl-space-1));
746
- left: 0;
1031
+ inset-block-start: calc(100% + var(--hl-space-1));
1032
+ inset-inline-start: 0;
747
1033
  z-index: var(--hl-z-dropdown);
748
- min-width: 12rem;
1034
+ min-inline-size: 12rem;
749
1035
  margin: 0;
750
1036
  padding: var(--hl-space-1);
751
1037
  list-style: none;
@@ -753,34 +1039,115 @@
753
1039
  border: var(--hl-border-width) solid var(--hl-border);
754
1040
  border-radius: var(--hl-radius-lg);
755
1041
  box-shadow: var(--hl-overlay-shadow);
1042
+ transition:
1043
+ opacity var(--hl-duration-fast) var(--hl-ease-standard),
1044
+ translate var(--hl-duration-fast) var(--hl-ease-standard),
1045
+ display var(--hl-duration-fast) allow-discrete,
1046
+ overlay var(--hl-duration-fast) allow-discrete;
756
1047
  }
757
1048
 
758
- [data-hl-menu][aria-orientation='vertical'] [role='menu'] {
759
- top: 0;
760
- left: calc(100% + var(--hl-space-1));
1049
+ [data-hl-menu][aria-orientation='vertical'] :is([role='menu'], [data-hl-menu-submenu]) {
1050
+ inset-block-start: 0;
1051
+ inset-inline-start: calc(100% + var(--hl-space-1));
761
1052
  }
762
1053
 
763
- [data-hl-menu] [role='menu'][hidden] {
1054
+ /* Closed states: `hidden` (enhancer without Popover API), a closed popover
1055
+ (enhancer with it), and the no-JS baseline below. Each is also the exit
1056
+ target of the transition. */
1057
+ [data-hl-menu]
1058
+ :is([role='menu'], [data-hl-menu-submenu]):is([hidden], [popover]:not(:popover-open)),
1059
+ [data-hl-menu]:not([data-hl-ready]) :is([role='menu'], [data-hl-menu-submenu]) {
764
1060
  display: none;
1061
+ opacity: 0;
1062
+ translate: 0 -0.25rem;
1063
+ }
1064
+
1065
+ /* No-JS baseline: reveal on hover or focus within the parent item. */
1066
+ [data-hl-menu]:not([data-hl-ready])
1067
+ li:is(:hover, :focus-within)
1068
+ > :is([role='menu'], [data-hl-menu-submenu]) {
1069
+ display: block;
1070
+ opacity: 1;
1071
+ translate: 0 0;
1072
+ }
1073
+
1074
+ @starting-style {
1075
+ [data-hl-menu] :is([role='menu'], [data-hl-menu-submenu]) {
1076
+ opacity: 0;
1077
+ translate: 0 -0.25rem;
1078
+ }
1079
+ }
1080
+
1081
+ /* Enhanced path: the submenu is a native popover in the top layer, anchored
1082
+ to its trigger. The absolute-position rules above stay as the fallback for
1083
+ engines without the Popover API. */
1084
+ [data-hl-menu] :is([role='menu'], [data-hl-menu-submenu])[popover] {
1085
+ position: fixed;
1086
+ inset: auto;
1087
+ }
1088
+
1089
+ @supports (position-area: block-end) {
1090
+ [data-hl-menu] :is([role='menu'], [data-hl-menu-submenu])[popover] {
1091
+ position-area: block-end span-inline-end;
1092
+ position-try-fallbacks: flip-block, flip-inline;
1093
+ margin-block: var(--hl-space-1);
1094
+ }
1095
+
1096
+ [data-hl-menu][aria-orientation='vertical']
1097
+ :is([role='menu'], [data-hl-menu-submenu])[popover] {
1098
+ position-area: inline-end span-block-end;
1099
+ position-try-fallbacks: flip-inline, flip-block;
1100
+ margin-block: 0;
1101
+ margin-inline: var(--hl-space-1);
1102
+ }
765
1103
  }
766
1104
 
767
1105
  [data-hl-menu] [role='separator'] {
768
- height: var(--hl-border-width);
1106
+ block-size: var(--hl-border-width);
769
1107
  margin: var(--hl-space-1) 0;
770
1108
  background: var(--hl-border);
771
1109
  }
1110
+
1111
+ @media (forced-colors: active) {
1112
+ [data-hl-menu] [role^='menuitem'][aria-expanded='true'] {
1113
+ background: Highlight;
1114
+ color: HighlightText;
1115
+ }
1116
+
1117
+ [data-hl-menu] [role^='menuitem']:is(:disabled, [aria-disabled='true']) {
1118
+ color: GrayText;
1119
+ }
1120
+
1121
+ [data-hl-menu] [role='separator'] {
1122
+ background: CanvasText;
1123
+ }
1124
+ }
772
1125
  }
1126
+ /**
1127
+ * Toast: a `[data-hl-toast-region]` live region fixed to the end corner of the
1128
+ * viewport, holding `[data-hl-toast]` notifications with an optional
1129
+ * `[data-hl-toast-close]` button.
1130
+ *
1131
+ * Toasts are inherently script-driven; with no JavaScript the region is simply
1132
+ * empty. The enhancer creates the toasts and reads:
1133
+ * data-hl-toast-region: the container
1134
+ * data-hl-toast: one notification (created by the enhancer)
1135
+ * data-hl-intent: info (default) | success | warning | danger, on a toast
1136
+ * data-hl-toast-close: dismiss button inside a toast
1137
+ * data-hl-toast-trigger, data-hl-toast-intent, data-hl-toast-duration:
1138
+ * declarative trigger buttons anywhere in the page
1139
+ */
773
1140
  @layer components {
774
1141
  [data-hl-toast-region] {
775
1142
  position: fixed;
776
1143
  z-index: var(--hl-z-toast);
777
- bottom: var(--hl-space-4);
778
- right: var(--hl-space-4);
1144
+ inset-block-end: var(--hl-space-4);
1145
+ inset-inline-end: var(--hl-space-4);
779
1146
  display: flex;
780
1147
  flex-direction: column-reverse;
781
1148
  gap: var(--hl-space-2);
782
1149
  pointer-events: none;
783
- max-width: min(90vw, 24rem);
1150
+ max-inline-size: min(90vi, 24rem);
784
1151
  }
785
1152
 
786
1153
  [data-hl-toast] {
@@ -788,40 +1155,48 @@
788
1155
  display: flex;
789
1156
  align-items: flex-start;
790
1157
  gap: var(--hl-space-3);
791
- border: 1px solid var(--hl-border);
1158
+ border: var(--hl-border-width) solid var(--hl-border);
792
1159
  border-radius: var(--hl-radius-lg);
793
1160
  padding: var(--hl-space-3) var(--hl-space-4);
794
1161
  background: var(--hl-surface);
795
1162
  box-shadow: var(--hl-overlay-shadow);
796
- animation: hl-toast-in var(--hl-duration-base) var(--hl-ease-standard);
1163
+ transition:
1164
+ opacity var(--hl-duration-base) var(--hl-ease-standard),
1165
+ translate var(--hl-duration-base) var(--hl-ease-standard);
797
1166
  }
798
1167
 
799
- [data-hl-toast][data-hl-variant='success'] {
800
- border-left: 3px solid var(--hl-success);
1168
+ /* Toasts are inserted by script, so the entry runs from @starting-style. */
1169
+ @starting-style {
1170
+ [data-hl-toast] {
1171
+ opacity: 0;
1172
+ translate: 0 var(--hl-space-2);
1173
+ }
801
1174
  }
802
1175
 
803
- [data-hl-toast][data-hl-variant='warning'] {
804
- border-left: 3px solid var(--hl-warning);
1176
+ [data-hl-toast][data-hl-intent='success'] {
1177
+ border-inline-start: 3px solid var(--hl-success);
805
1178
  }
806
1179
 
807
- [data-hl-toast][data-hl-variant='danger'] {
808
- border-left: 3px solid var(--hl-danger);
1180
+ [data-hl-toast][data-hl-intent='warning'] {
1181
+ border-inline-start: 3px solid var(--hl-warning);
809
1182
  }
810
1183
 
811
- [data-hl-toast][data-hl-variant='info'] {
812
- border-left: 3px solid var(--hl-info);
1184
+ [data-hl-toast][data-hl-intent='danger'] {
1185
+ border-inline-start: 3px solid var(--hl-danger);
1186
+ }
1187
+
1188
+ [data-hl-toast][data-hl-intent='info'] {
1189
+ border-inline-start: 3px solid var(--hl-info);
813
1190
  }
814
1191
 
815
1192
  [data-hl-toast-close] {
816
- -webkit-appearance: none;
817
- -moz-appearance: none;
818
- appearance: none;
1193
+ appearance: none;
819
1194
  border: none;
820
1195
  background: transparent;
821
1196
  cursor: pointer;
822
1197
  padding: var(--hl-space-1);
823
1198
  color: var(--hl-fg-muted);
824
- margin-left: auto;
1199
+ margin-inline-start: auto;
825
1200
  flex-shrink: 0;
826
1201
  font: inherit;
827
1202
  }
@@ -832,52 +1207,43 @@
832
1207
 
833
1208
  [data-hl-toast-close]:focus-visible {
834
1209
  outline: var(--hl-focus-ring);
835
- outline-offset: 2px;
1210
+ outline-offset: var(--hl-focus-offset);
836
1211
  border-radius: var(--hl-radius-sm);
837
1212
  }
838
-
839
- @keyframes hl-toast-in {
840
- from {
841
- opacity: 0;
842
- transform: translateY(0.5rem);
843
- }
844
-
845
- to {
846
- opacity: 1;
847
- transform: translateY(0);
848
- }
849
- }
850
-
851
- @media (prefers-reduced-motion: reduce) {
852
- [data-hl-toast] {
853
- animation: none;
854
- }
855
- }
856
1213
  }
857
1214
  /**
858
1215
  * Command palette: `<div data-hl-command>` containing a search input
859
- * (`[data-hl-command-input]`), an empty state (`[data-hl-command-empty]`), and a
860
- * `[data-hl-command-list] role="listbox"` of grouped `[role="option"]` items.
861
- * Often placed inside a `<dialog class="hl-modal">`.
1216
+ * (`.hl-command-input` or `[data-hl-command-input]`), an empty state
1217
+ * (`[data-hl-command-empty]`), and a `[data-hl-command-list] role="listbox"` of
1218
+ * grouped `[role="option"]` items. Often placed inside a `<dialog class="hl-modal">`.
1219
+ *
1220
+ * No-JS baseline: every item is listed and the empty state stays hidden,
1221
+ * since nothing can filter yet. The enhancer marks the root `data-hl-ready`
1222
+ * and then toggles `hidden` on items, groups, and the empty state.
1223
+ * data-hl-command: root
1224
+ * data-hl-command-input: filter field
1225
+ * data-hl-command-list: listbox
1226
+ * data-hl-command-group: a group wrapper (hidden when all its items are)
1227
+ * data-hl-command-empty: "no results" message
1228
+ * data-hl-ready: set by the enhancer
862
1229
  */
863
1230
  @layer components {
864
1231
  [data-hl-command] {
865
1232
  display: flex;
866
1233
  flex-direction: column;
867
- min-height: 0;
1234
+ min-block-size: 0;
868
1235
  overflow: hidden;
869
1236
  background: var(--hl-overlay);
870
1237
  border-radius: var(--hl-radius-lg);
871
1238
  }
872
1239
 
873
- [data-hl-command-input] {
1240
+ :is(.hl-command-input, [data-hl-command-input]) {
874
1241
  flex: none;
875
- width: 100%;
876
- height: var(--hl-control-height-lg);
877
- padding-left: var(--hl-space-4);
878
- padding-right: var(--hl-space-4);
1242
+ inline-size: 100%;
1243
+ block-size: var(--hl-control-height-lg);
1244
+ padding-inline: var(--hl-space-4);
879
1245
  border: 0;
880
- border-bottom: var(--hl-border-width) solid var(--hl-border);
1246
+ border-block-end: var(--hl-border-width) solid var(--hl-border);
881
1247
  border-radius: 0;
882
1248
  background: transparent;
883
1249
  color: var(--hl-fg);
@@ -885,21 +1251,19 @@
885
1251
  font-size: var(--hl-text-base);
886
1252
  }
887
1253
 
888
- [data-hl-command-input]:focus-visible {
889
- outline: none;
890
- }
891
-
892
- [data-hl-command-input]::-moz-placeholder {
893
- color: var(--hl-fg-subtle);
1254
+ /* The field is flush with the palette edge, so the ring is drawn inward. */
1255
+ :is(.hl-command-input, [data-hl-command-input]):focus-visible {
1256
+ outline: var(--hl-focus-ring);
1257
+ outline-offset: calc(var(--hl-focus-offset) * -1);
894
1258
  }
895
1259
 
896
- [data-hl-command-input]::placeholder {
1260
+ :is(.hl-command-input, [data-hl-command-input])::placeholder {
897
1261
  color: var(--hl-fg-subtle);
898
1262
  }
899
1263
 
900
1264
  [data-hl-command-list] {
901
1265
  flex: 1 1 auto;
902
- max-height: 24rem;
1266
+ max-block-size: 24rem;
903
1267
  overflow-y: auto;
904
1268
  padding: var(--hl-space-2);
905
1269
  }
@@ -938,9 +1302,14 @@
938
1302
  color: var(--hl-primary-subtle-fg);
939
1303
  }
940
1304
 
1305
+ [data-hl-command] [role='option'][aria-disabled='true'] {
1306
+ opacity: var(--hl-disabled-opacity);
1307
+ pointer-events: none;
1308
+ }
1309
+
941
1310
  [data-hl-command] [role='option'] svg {
942
- width: 1.1em;
943
- height: 1.1em;
1311
+ inline-size: 1.1em;
1312
+ block-size: 1.1em;
944
1313
  flex: none;
945
1314
  opacity: 0.7;
946
1315
  }
@@ -952,23 +1321,34 @@
952
1321
  color: var(--hl-fg-muted);
953
1322
  }
954
1323
 
955
- [data-hl-command-empty][hidden] {
1324
+ /* No-JS baseline: there is no filtering, so there are never "no results". */
1325
+ [data-hl-command-empty][hidden],
1326
+ [data-hl-command]:not([data-hl-ready]) [data-hl-command-empty] {
956
1327
  display: none;
957
1328
  }
1329
+
1330
+ @media (forced-colors: active) {
1331
+ [data-hl-command] [role='option'][aria-selected='true'] {
1332
+ background: Highlight;
1333
+ color: HighlightText;
1334
+ }
1335
+ }
958
1336
  }
959
1337
  /* Forms */
960
1338
  /**
961
- * Button: `<button class="hl-button">` (works on `<a>`/`<input>` too).
1339
+ * Button: `<button class="hl-button">` (works on `<a>`/`<input>` too). Pure
1340
+ * CSS; there is no enhancer.
962
1341
  *
963
1342
  * Color is driven by a small set of local custom properties so the
964
- * intent × variant matrix stays DRY: `data-hl-intent` swaps the accent set,
1343
+ * intent by variant matrix stays DRY: `data-hl-intent` swaps the accent set,
965
1344
  * `data-hl-variant` decides how those values are applied.
966
1345
  *
967
1346
  * data-hl-variant: solid (default) | soft | outline | ghost | link
968
1347
  * data-hl-intent: neutral (default) | primary | danger | success | warning | info
969
1348
  * data-hl-size: sm | md (default) | lg
970
- * data-hl-block: stretch to container width
1349
+ * data-hl-block: stretch to the container's inline size
971
1350
  * data-hl-icon: square, icon-only
1351
+ * data-hl-loading: shows a spinner and blocks interaction
972
1352
  */
973
1353
  @layer components {
974
1354
  .hl-button {
@@ -988,9 +1368,8 @@
988
1368
  align-items: center;
989
1369
  justify-content: center;
990
1370
  gap: var(--_gap);
991
- height: var(--_height);
992
- padding-left: var(--_pad-x);
993
- padding-right: var(--_pad-x);
1371
+ block-size: var(--_height);
1372
+ padding-inline: var(--_pad-x);
994
1373
  border: var(--hl-border-width) solid transparent;
995
1374
  border-radius: var(--hl-radius-md);
996
1375
  font-family: inherit;
@@ -998,16 +1377,17 @@
998
1377
  font-weight: var(--hl-font-medium);
999
1378
  line-height: 1;
1000
1379
  white-space: nowrap;
1001
- -webkit-text-decoration: none;
1002
1380
  text-decoration: none;
1003
1381
  cursor: pointer;
1004
1382
  -webkit-user-select: none;
1005
- -moz-user-select: none;
1006
1383
  user-select: none;
1007
1384
  background: var(--_solid-bg);
1008
1385
  color: var(--_solid-fg);
1009
1386
  transition:
1010
- 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);
1387
+ background-color var(--hl-duration-fast) var(--hl-ease-standard),
1388
+ border-color var(--hl-duration-fast) var(--hl-ease-standard),
1389
+ color var(--hl-duration-fast) var(--hl-ease-standard),
1390
+ box-shadow var(--hl-duration-fast) var(--hl-ease-standard);
1011
1391
  }
1012
1392
 
1013
1393
  .hl-button:hover {
@@ -1020,14 +1400,14 @@
1020
1400
 
1021
1401
  .hl-button:focus-visible {
1022
1402
  outline: var(--hl-focus-ring);
1023
- outline-offset: 2px;
1403
+ outline-offset: var(--hl-focus-offset);
1024
1404
  }
1025
1405
 
1026
1406
  .hl-button:disabled,
1027
1407
  .hl-button[aria-disabled='true'],
1028
1408
  .hl-button[data-hl-loading] {
1029
1409
  cursor: not-allowed;
1030
- opacity: 0.55;
1410
+ opacity: var(--hl-disabled-opacity);
1031
1411
  }
1032
1412
 
1033
1413
  .hl-button[data-hl-loading] {
@@ -1114,12 +1494,11 @@
1114
1494
  }
1115
1495
 
1116
1496
  .hl-button[data-hl-variant='link'] {
1117
- height: auto;
1497
+ block-size: auto;
1118
1498
  padding: 0;
1119
1499
  background: transparent;
1120
1500
  color: var(--_accent);
1121
1501
  border-color: transparent;
1122
- -webkit-text-decoration: underline;
1123
1502
  text-decoration: underline;
1124
1503
  text-underline-offset: 0.2em;
1125
1504
  }
@@ -1148,34 +1527,34 @@
1148
1527
 
1149
1528
  .hl-button[data-hl-block] {
1150
1529
  display: flex;
1151
- width: 100%;
1530
+ inline-size: 100%;
1152
1531
  }
1153
1532
 
1154
1533
  .hl-button[data-hl-icon] {
1155
- width: var(--_height);
1156
- padding-left: 0;
1157
- padding-right: 0;
1534
+ inline-size: var(--_height);
1535
+ padding-inline: 0;
1158
1536
  }
1159
1537
 
1160
1538
  .hl-button > svg {
1161
- width: 1.1em;
1162
- height: 1.1em;
1539
+ inline-size: 1.1em;
1540
+ block-size: 1.1em;
1163
1541
  flex: none;
1164
1542
  }
1165
1543
 
1166
1544
  .hl-button[data-hl-loading]::before {
1167
1545
  content: '';
1168
- width: 1em;
1169
- height: 1em;
1546
+ inline-size: 1em;
1547
+ block-size: 1em;
1170
1548
  border: 2px solid currentcolor;
1171
- border-top-color: transparent;
1549
+ border-block-start-color: transparent;
1172
1550
  border-radius: var(--hl-radius-full);
1173
1551
  animation: hl-button-spin 0.6s linear infinite;
1174
1552
  }
1175
1553
 
1554
+ /* A static arc still reads as "busy" without continuous motion. */
1176
1555
  @media (prefers-reduced-motion: reduce) {
1177
1556
  .hl-button[data-hl-loading]::before {
1178
- animation-duration: 1.4s;
1557
+ animation: none;
1179
1558
  }
1180
1559
  }
1181
1560
 
@@ -1194,26 +1573,45 @@
1194
1573
  }
1195
1574
 
1196
1575
  .hl-button-group > .hl-button:not(:first-child) {
1197
- margin-left: calc(var(--hl-border-width) * -1);
1576
+ margin-inline-start: calc(var(--hl-border-width) * -1);
1198
1577
  }
1199
1578
 
1200
1579
  .hl-button-group > .hl-button:first-child {
1201
- border-top-left-radius: var(--hl-radius-md);
1202
- border-bottom-left-radius: var(--hl-radius-md);
1580
+ border-start-start-radius: var(--hl-radius-md);
1581
+ border-end-start-radius: var(--hl-radius-md);
1203
1582
  }
1204
1583
 
1205
1584
  .hl-button-group > .hl-button:last-child {
1206
- border-top-right-radius: var(--hl-radius-md);
1207
- border-bottom-right-radius: var(--hl-radius-md);
1585
+ border-start-end-radius: var(--hl-radius-md);
1586
+ border-end-end-radius: var(--hl-radius-md);
1208
1587
  }
1209
1588
 
1210
1589
  .hl-button-group > .hl-button:hover,
1211
1590
  .hl-button-group > .hl-button:focus-visible {
1212
1591
  z-index: 1;
1213
1592
  }
1593
+
1594
+ /* Forced colors flatten every fill to Canvas, so the border alone tells a
1595
+ button apart from text; the link variant keeps reading as a link. */
1596
+ @media (forced-colors: active) {
1597
+ .hl-button {
1598
+ border-color: ButtonBorder;
1599
+ }
1600
+
1601
+ .hl-button[data-hl-variant='link'] {
1602
+ border-color: transparent;
1603
+ color: LinkText;
1604
+ }
1605
+
1606
+ .hl-button:disabled,
1607
+ .hl-button[aria-disabled='true'] {
1608
+ color: GrayText;
1609
+ border-color: GrayText;
1610
+ }
1611
+ }
1214
1612
  }
1215
1613
  /**
1216
- * Text input: `<input class="hl-input">`.
1614
+ * Text input: `<input class="hl-input">`. Pure CSS; there is no enhancer.
1217
1615
  * data-hl-size: sm | md (default) | lg
1218
1616
  * data-hl-invalid: error styling (pair with aria-invalid)
1219
1617
  */
@@ -1224,10 +1622,9 @@
1224
1622
  --_font: var(--hl-text-sm);
1225
1623
 
1226
1624
  display: block;
1227
- width: 100%;
1228
- height: var(--_height);
1229
- padding-left: var(--_pad-x);
1230
- padding-right: var(--_pad-x);
1625
+ inline-size: 100%;
1626
+ block-size: var(--_height);
1627
+ padding-inline: var(--_pad-x);
1231
1628
  border: var(--hl-border-width) solid var(--hl-border-strong);
1232
1629
  border-radius: var(--hl-radius-md);
1233
1630
  background: var(--hl-surface);
@@ -1236,30 +1633,27 @@
1236
1633
  font-size: var(--_font);
1237
1634
  line-height: var(--hl-leading-normal);
1238
1635
  transition:
1239
- border-color var(--hl-duration-fast) var(--hl-ease-standard), box-shadow var(--hl-duration-fast) var(--hl-ease-standard);
1240
- }
1241
-
1242
- .hl-input::-moz-placeholder {
1243
- color: var(--hl-fg-subtle);
1636
+ border-color var(--hl-duration-fast) var(--hl-ease-standard),
1637
+ box-shadow var(--hl-duration-fast) var(--hl-ease-standard);
1244
1638
  }
1245
1639
 
1246
1640
  .hl-input::placeholder {
1247
1641
  color: var(--hl-fg-subtle);
1248
1642
  }
1249
1643
 
1250
- .hl-input:hover:not(:disabled):not(:focus) {
1644
+ .hl-input:hover:not(:disabled, :focus) {
1251
1645
  border-color: var(--hl-fg-subtle);
1252
1646
  }
1253
1647
 
1254
1648
  .hl-input:focus-visible {
1255
1649
  outline: none;
1256
1650
  border-color: var(--hl-ring);
1257
- box-shadow: 0 0 0 3px color-mix(in oklab, var(--hl-ring) 30%, transparent);
1651
+ box-shadow: var(--hl-focus-shadow);
1258
1652
  }
1259
1653
 
1260
1654
  .hl-input:disabled {
1261
1655
  cursor: not-allowed;
1262
- opacity: 0.6;
1656
+ opacity: var(--hl-disabled-opacity);
1263
1657
  background: var(--hl-surface-2);
1264
1658
  }
1265
1659
 
@@ -1288,25 +1682,34 @@
1288
1682
  }
1289
1683
 
1290
1684
  .hl-input[type='file'] {
1291
- height: auto;
1292
- padding-top: var(--hl-space-2);
1293
- padding-bottom: var(--hl-space-2);
1685
+ block-size: auto;
1686
+ padding-block: var(--hl-space-2);
1294
1687
  }
1295
1688
 
1296
1689
  .hl-input[type='color'] {
1297
- width: var(--_height);
1690
+ inline-size: var(--_height);
1298
1691
  padding: var(--hl-space-1);
1299
1692
  }
1693
+
1694
+ /* Box shadows are dropped in forced colors, so focus falls back to an outline. */
1695
+ @media (forced-colors: active) {
1696
+ .hl-input:focus-visible {
1697
+ outline: var(--hl-focus-ring);
1698
+ outline-offset: var(--hl-focus-offset);
1699
+ }
1700
+ }
1300
1701
  }
1301
1702
  /**
1302
- * Multi-line text input: `<textarea class="hl-textarea">`.
1303
- * data-hl-invalid: error styling (pair with aria-invalid)
1703
+ * Multi-line text input: `<textarea class="hl-textarea">`. Pure CSS; there is
1704
+ * no enhancer.
1705
+ * data-hl-invalid: error styling (pair with aria-invalid)
1706
+ * data-hl-autosize: grows with its content where `field-sizing` is supported
1304
1707
  */
1305
1708
  @layer components {
1306
1709
  .hl-textarea {
1307
1710
  display: block;
1308
- width: 100%;
1309
- min-height: calc(var(--hl-control-height-md) * 2);
1711
+ inline-size: 100%;
1712
+ min-block-size: calc(var(--hl-control-height-md) * 2);
1310
1713
  padding: var(--hl-space-2) var(--hl-space-3);
1311
1714
  border: var(--hl-border-width) solid var(--hl-border-strong);
1312
1715
  border-radius: var(--hl-radius-md);
@@ -1317,30 +1720,27 @@
1317
1720
  line-height: var(--hl-leading-normal);
1318
1721
  resize: vertical;
1319
1722
  transition:
1320
- border-color var(--hl-duration-fast) var(--hl-ease-standard), box-shadow var(--hl-duration-fast) var(--hl-ease-standard);
1321
- }
1322
-
1323
- .hl-textarea::-moz-placeholder {
1324
- color: var(--hl-fg-subtle);
1723
+ border-color var(--hl-duration-fast) var(--hl-ease-standard),
1724
+ box-shadow var(--hl-duration-fast) var(--hl-ease-standard);
1325
1725
  }
1326
1726
 
1327
1727
  .hl-textarea::placeholder {
1328
1728
  color: var(--hl-fg-subtle);
1329
1729
  }
1330
1730
 
1331
- .hl-textarea:hover:not(:disabled):not(:focus) {
1731
+ .hl-textarea:hover:not(:disabled, :focus) {
1332
1732
  border-color: var(--hl-fg-subtle);
1333
1733
  }
1334
1734
 
1335
1735
  .hl-textarea:focus-visible {
1336
1736
  outline: none;
1337
1737
  border-color: var(--hl-ring);
1338
- box-shadow: 0 0 0 3px color-mix(in oklab, var(--hl-ring) 30%, transparent);
1738
+ box-shadow: var(--hl-focus-shadow);
1339
1739
  }
1340
1740
 
1341
1741
  .hl-textarea:disabled {
1342
1742
  cursor: not-allowed;
1343
- opacity: 0.6;
1743
+ opacity: var(--hl-disabled-opacity);
1344
1744
  background: var(--hl-surface-2);
1345
1745
  }
1346
1746
 
@@ -1354,11 +1754,26 @@
1354
1754
  border-color: var(--hl-danger);
1355
1755
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--hl-danger) 30%, transparent);
1356
1756
  }
1757
+
1758
+ /* Native autosize; engines without it keep the fixed minimum and a resizer. */
1759
+ @supports (field-sizing: content) {
1760
+ .hl-textarea[data-hl-autosize] {
1761
+ field-sizing: content;
1762
+ max-block-size: 60vb;
1763
+ }
1764
+ }
1765
+
1766
+ @media (forced-colors: active) {
1767
+ .hl-textarea:focus-visible {
1768
+ outline: var(--hl-focus-ring);
1769
+ outline-offset: var(--hl-focus-offset);
1770
+ }
1771
+ }
1357
1772
  }
1358
1773
  /**
1359
1774
  * Native select: `<span class="hl-select-wrapper"><select class="hl-select">`.
1360
1775
  * The wrapper draws a custom caret while the native control keeps full
1361
- * keyboard/mobile behavior.
1776
+ * keyboard and mobile behavior. Pure CSS; there is no enhancer.
1362
1777
  * data-hl-size: sm | md (default) | lg
1363
1778
  * data-hl-invalid: error styling (pair with aria-invalid)
1364
1779
  */
@@ -1366,19 +1781,22 @@
1366
1781
  .hl-select-wrapper {
1367
1782
  position: relative;
1368
1783
  display: inline-flex;
1369
- width: 100%;
1784
+ inline-size: 100%;
1370
1785
  }
1371
1786
 
1787
+ /* The caret is a rotated square corner; it sits at the inline end so it
1788
+ moves to the left under RTL along with the select's end padding. */
1372
1789
  .hl-select-wrapper::after {
1373
1790
  content: '';
1374
1791
  position: absolute;
1375
- top: 50%;
1376
- right: var(--hl-space-3);
1377
- width: 0.5rem;
1378
- height: 0.5rem;
1379
- border-right: 2px solid var(--hl-fg-muted);
1380
- border-bottom: 2px solid var(--hl-fg-muted);
1381
- transform: translateY(-65%) rotate(45deg);
1792
+ inset-block-start: 50%;
1793
+ inset-inline-end: var(--hl-space-3);
1794
+ inline-size: 0.5rem;
1795
+ block-size: 0.5rem;
1796
+ border-inline-end: 2px solid var(--hl-fg-muted);
1797
+ border-block-end: 2px solid var(--hl-fg-muted);
1798
+ translate: 0 -65%;
1799
+ rotate: 45deg;
1382
1800
  pointer-events: none;
1383
1801
  }
1384
1802
 
@@ -1386,15 +1804,10 @@
1386
1804
  --_height: var(--hl-control-height-md);
1387
1805
  --_font: var(--hl-text-sm);
1388
1806
 
1389
- -webkit-appearance: none;
1390
-
1391
- -moz-appearance: none;
1392
-
1393
- appearance: none;
1394
- width: 100%;
1395
- height: var(--_height);
1396
- padding-left: var(--hl-space-3);
1397
- padding-right: var(--hl-space-8);
1807
+ appearance: none;
1808
+ inline-size: 100%;
1809
+ block-size: var(--_height);
1810
+ padding-inline: var(--hl-space-3) var(--hl-space-8);
1398
1811
  border: var(--hl-border-width) solid var(--hl-border-strong);
1399
1812
  border-radius: var(--hl-radius-md);
1400
1813
  background: var(--hl-surface);
@@ -1404,22 +1817,23 @@
1404
1817
  line-height: var(--hl-leading-normal);
1405
1818
  cursor: pointer;
1406
1819
  transition:
1407
- border-color var(--hl-duration-fast) var(--hl-ease-standard), box-shadow var(--hl-duration-fast) var(--hl-ease-standard);
1820
+ border-color var(--hl-duration-fast) var(--hl-ease-standard),
1821
+ box-shadow var(--hl-duration-fast) var(--hl-ease-standard);
1408
1822
  }
1409
1823
 
1410
- .hl-select:hover:not(:disabled):not(:focus) {
1824
+ .hl-select:hover:not(:disabled, :focus) {
1411
1825
  border-color: var(--hl-fg-subtle);
1412
1826
  }
1413
1827
 
1414
1828
  .hl-select:focus-visible {
1415
1829
  outline: none;
1416
1830
  border-color: var(--hl-ring);
1417
- box-shadow: 0 0 0 3px color-mix(in oklab, var(--hl-ring) 30%, transparent);
1831
+ box-shadow: var(--hl-focus-shadow);
1418
1832
  }
1419
1833
 
1420
1834
  .hl-select:disabled {
1421
1835
  cursor: not-allowed;
1422
- opacity: 0.6;
1836
+ opacity: var(--hl-disabled-opacity);
1423
1837
  background: var(--hl-surface-2);
1424
1838
  }
1425
1839
 
@@ -1439,11 +1853,18 @@
1439
1853
  --_height: var(--hl-control-height-lg);
1440
1854
  --_font: var(--hl-text-base);
1441
1855
  }
1856
+
1857
+ @media (forced-colors: active) {
1858
+ .hl-select:focus-visible {
1859
+ outline: var(--hl-focus-ring);
1860
+ outline-offset: var(--hl-focus-offset);
1861
+ }
1862
+ }
1442
1863
  }
1443
1864
  /**
1444
- * Checkbox: `<label class="hl-checkbox"><input type="checkbox"><span>…</span></label>`.
1445
- * The native input is restyled (appearance:none) with a CSS checkmark, keeping
1446
- * full keyboard + form semantics.
1865
+ * Checkbox: `<label class="hl-checkbox"><input type="checkbox"><span>...</span></label>`.
1866
+ * The native input is restyled (appearance: none) with a CSS checkmark, keeping
1867
+ * full keyboard and form semantics. Pure CSS; there is no enhancer.
1447
1868
  */
1448
1869
  @layer components {
1449
1870
  .hl-checkbox {
@@ -1456,34 +1877,33 @@
1456
1877
  }
1457
1878
 
1458
1879
  .hl-checkbox > input[type='checkbox'] {
1459
- -webkit-appearance: none;
1460
- -moz-appearance: none;
1461
- appearance: none;
1880
+ appearance: none;
1462
1881
  flex: none;
1463
- width: 1.15rem;
1464
- height: 1.15rem;
1882
+ inline-size: 1.15rem;
1883
+ block-size: 1.15rem;
1465
1884
  margin: 0;
1466
1885
  border: var(--hl-border-width-2) solid var(--hl-border-strong);
1467
1886
  border-radius: var(--hl-radius-sm);
1468
1887
  background: var(--hl-surface);
1469
1888
  display: grid;
1470
- align-content: center;
1471
- justify-content: center;
1472
1889
  place-content: center;
1473
1890
  cursor: pointer;
1474
1891
  transition:
1475
- background-color var(--hl-duration-fast) var(--hl-ease-standard), border-color var(--hl-duration-fast) var(--hl-ease-standard);
1892
+ background-color var(--hl-duration-fast) var(--hl-ease-standard),
1893
+ border-color var(--hl-duration-fast) var(--hl-ease-standard);
1476
1894
  }
1477
1895
 
1896
+ /* The mark is a rotated L drawn with two borders; direction-neutral. */
1478
1897
  .hl-checkbox > input[type='checkbox']::after {
1479
1898
  content: '';
1480
- width: 0.34rem;
1481
- height: 0.62rem;
1899
+ inline-size: 0.34rem;
1900
+ block-size: 0.62rem;
1482
1901
  border: solid var(--hl-primary-fg);
1483
1902
  border-width: 0 2px 2px 0;
1484
- margin-top: -2px;
1485
- transform: rotate(45deg) scale(0);
1486
- transition: transform var(--hl-duration-fast) var(--hl-ease-emphasized);
1903
+ margin-block-start: -2px;
1904
+ rotate: 45deg;
1905
+ scale: 0;
1906
+ transition: scale var(--hl-duration-fast) var(--hl-ease-emphasized);
1487
1907
  }
1488
1908
 
1489
1909
  .hl-checkbox > input[type='checkbox']:checked,
@@ -1493,35 +1913,48 @@
1493
1913
  }
1494
1914
 
1495
1915
  .hl-checkbox > input[type='checkbox']:checked::after {
1496
- transform: rotate(45deg) scale(1);
1916
+ scale: 1;
1497
1917
  }
1498
1918
 
1499
1919
  .hl-checkbox > input[type='checkbox']:indeterminate::after {
1500
- width: 0.6rem;
1501
- height: 0;
1920
+ inline-size: 0.6rem;
1921
+ block-size: 0;
1502
1922
  margin: 0;
1503
1923
  border-width: 0 0 2px;
1504
- transform: none;
1924
+ rotate: none;
1925
+ scale: 1;
1505
1926
  }
1506
1927
 
1507
1928
  .hl-checkbox > input[type='checkbox']:focus-visible {
1508
1929
  outline: var(--hl-focus-ring);
1509
- outline-offset: 2px;
1930
+ outline-offset: var(--hl-focus-offset);
1510
1931
  }
1511
1932
 
1512
1933
  .hl-checkbox > input[type='checkbox']:disabled {
1513
1934
  cursor: not-allowed;
1514
- opacity: 0.55;
1935
+ opacity: var(--hl-disabled-opacity);
1515
1936
  }
1516
1937
 
1517
1938
  .hl-checkbox:has(> input:disabled) {
1518
1939
  cursor: not-allowed;
1519
1940
  color: var(--hl-fg-subtle);
1520
1941
  }
1942
+
1943
+ /* The custom-drawn mark must keep its own colors to stay visible on the
1944
+ Highlight fill; everything else follows the system palette. */
1945
+ @media (forced-colors: active) {
1946
+ .hl-checkbox > input[type='checkbox']::after {
1947
+ forced-color-adjust: none;
1948
+ border-color: HighlightText;
1949
+ }
1950
+ }
1521
1951
  }
1522
1952
  /**
1523
- * Radio: `<label class="hl-radio"><input type="radio"><span>…</span></label>`,
1524
- * grouped in `<div class="hl-radio-group" role="radiogroup">`.
1953
+ * Radio group: `<label class="hl-radio"><input type="radio"><span>...</span></label>`
1954
+ * items grouped in `<div class="hl-radio-group" role="radiogroup">`. Native
1955
+ * radios provide selection and arrow-key movement; pure CSS, there is no
1956
+ * enhancer.
1957
+ * data-hl-orientation: vertical (default) | horizontal (on the group)
1525
1958
  */
1526
1959
  @layer components {
1527
1960
  .hl-radio-group {
@@ -1546,19 +1979,15 @@
1546
1979
  }
1547
1980
 
1548
1981
  .hl-radio > input[type='radio'] {
1549
- -webkit-appearance: none;
1550
- -moz-appearance: none;
1551
- appearance: none;
1982
+ appearance: none;
1552
1983
  flex: none;
1553
- width: 1.15rem;
1554
- height: 1.15rem;
1984
+ inline-size: 1.15rem;
1985
+ block-size: 1.15rem;
1555
1986
  margin: 0;
1556
1987
  border: var(--hl-border-width-2) solid var(--hl-border-strong);
1557
1988
  border-radius: var(--hl-radius-full);
1558
1989
  background: var(--hl-surface);
1559
1990
  display: grid;
1560
- align-content: center;
1561
- justify-content: center;
1562
1991
  place-content: center;
1563
1992
  cursor: pointer;
1564
1993
  transition: border-color var(--hl-duration-fast) var(--hl-ease-standard);
@@ -1566,12 +1995,12 @@
1566
1995
 
1567
1996
  .hl-radio > input[type='radio']::after {
1568
1997
  content: '';
1569
- width: 0.6rem;
1570
- height: 0.6rem;
1998
+ inline-size: 0.6rem;
1999
+ block-size: 0.6rem;
1571
2000
  border-radius: var(--hl-radius-full);
1572
2001
  background: var(--hl-primary);
1573
- transform: scale(0);
1574
- transition: transform var(--hl-duration-fast) var(--hl-ease-emphasized);
2002
+ scale: 0;
2003
+ transition: scale var(--hl-duration-fast) var(--hl-ease-emphasized);
1575
2004
  }
1576
2005
 
1577
2006
  .hl-radio > input[type='radio']:checked {
@@ -1579,60 +2008,82 @@
1579
2008
  }
1580
2009
 
1581
2010
  .hl-radio > input[type='radio']:checked::after {
1582
- transform: scale(1);
2011
+ scale: 1;
1583
2012
  }
1584
2013
 
1585
2014
  .hl-radio > input[type='radio']:focus-visible {
1586
2015
  outline: var(--hl-focus-ring);
1587
- outline-offset: 2px;
2016
+ outline-offset: var(--hl-focus-offset);
1588
2017
  }
1589
2018
 
1590
2019
  .hl-radio > input[type='radio']:disabled {
1591
2020
  cursor: not-allowed;
1592
- opacity: 0.55;
2021
+ opacity: var(--hl-disabled-opacity);
1593
2022
  }
1594
2023
 
1595
2024
  .hl-radio:has(> input:disabled) {
1596
2025
  cursor: not-allowed;
1597
2026
  color: var(--hl-fg-subtle);
1598
2027
  }
2028
+
2029
+ /* The dot is custom-drawn, so it opts out of forced-color flattening. */
2030
+ @media (forced-colors: active) {
2031
+ .hl-radio > input[type='radio']::after {
2032
+ forced-color-adjust: none;
2033
+ background: Highlight;
2034
+ }
2035
+ }
1599
2036
  }
2037
+ /**
2038
+ * Switch: `<label data-hl-switch><input type="checkbox" role="switch"> Label</label>`.
2039
+ * The native checkbox is restyled as a track and thumb, so state, keyboard,
2040
+ * and form submission stay native. Pure CSS; there is no enhancer.
2041
+ * data-hl-switch: the label wrapper
2042
+ */
1600
2043
  @layer components {
1601
2044
  [data-hl-switch] {
2045
+ --_track-inline: 2.25rem;
2046
+ --_track-block: 1.25rem;
2047
+ --_gap: 2px;
2048
+ --_thumb: calc(var(--_track-block) - var(--_gap) * 2);
2049
+ --_travel: calc(var(--_track-inline) - var(--_track-block));
2050
+
1602
2051
  display: inline-flex;
1603
2052
  align-items: center;
1604
2053
  gap: var(--hl-space-2);
1605
2054
  }
1606
2055
 
1607
2056
  [data-hl-switch] input[type='checkbox'] {
1608
- -webkit-appearance: none;
1609
- -moz-appearance: none;
1610
- appearance: none;
1611
- width: 2.25rem;
1612
- height: 1.25rem;
1613
- border-radius: 1.25rem;
1614
- background: var(--hl-border-strong);
2057
+ appearance: none;
1615
2058
  position: relative;
1616
- outline-offset: 2px;
2059
+ inline-size: var(--_track-inline);
2060
+ block-size: var(--_track-block);
2061
+ margin: 0;
2062
+ border-radius: var(--hl-radius-full);
2063
+ background: var(--hl-border-strong);
1617
2064
  transition: background-color var(--hl-duration-fast) var(--hl-ease-standard);
1618
2065
  }
1619
2066
 
2067
+ /* The thumb rests at the inline start and travels toward the inline end,
2068
+ so it is placed logically and slides left under RTL. */
1620
2069
  [data-hl-switch] input[type='checkbox']::after {
1621
2070
  content: '';
1622
2071
  position: absolute;
1623
- top: 2px;
1624
- right: auto;
1625
- bottom: auto;
1626
- left: 2px;
1627
- width: calc(1.25rem - 4px);
1628
- height: calc(1.25rem - 4px);
1629
- border-radius: 50%;
2072
+ inset-block-start: var(--_gap);
2073
+ inset-inline-start: var(--_gap);
2074
+ inline-size: var(--_thumb);
2075
+ block-size: var(--_thumb);
2076
+ border-radius: var(--hl-radius-full);
1630
2077
  background: var(--hl-surface);
1631
- transition: transform var(--hl-duration-fast) var(--hl-ease-standard);
2078
+ transition: translate var(--hl-duration-fast) var(--hl-ease-standard);
1632
2079
  }
1633
2080
 
1634
2081
  [data-hl-switch] input[type='checkbox']:checked::after {
1635
- transform: translateX(1rem);
2082
+ translate: var(--_travel) 0;
2083
+ }
2084
+
2085
+ [data-hl-switch] input[type='checkbox']:checked:dir(rtl)::after {
2086
+ translate: calc(var(--_travel) * -1) 0;
1636
2087
  }
1637
2088
 
1638
2089
  [data-hl-switch] input[type='checkbox']:checked {
@@ -1641,10 +2092,11 @@
1641
2092
 
1642
2093
  [data-hl-switch] input[type='checkbox']:focus-visible {
1643
2094
  outline: var(--hl-focus-ring);
2095
+ outline-offset: var(--hl-focus-offset);
1644
2096
  }
1645
2097
 
1646
2098
  [data-hl-switch] input[type='checkbox']:disabled {
1647
- opacity: 0.5;
2099
+ opacity: var(--hl-disabled-opacity);
1648
2100
  cursor: not-allowed;
1649
2101
  }
1650
2102
 
@@ -1652,11 +2104,35 @@
1652
2104
  opacity: 0.7;
1653
2105
  cursor: not-allowed;
1654
2106
  }
2107
+
2108
+ /* The track needs an edge once its fill is flattened, and the custom-drawn
2109
+ thumb keeps its own colors so it stays visible on both states. */
2110
+ @media (forced-colors: active) {
2111
+ [data-hl-switch] input[type='checkbox'] {
2112
+ border: var(--hl-border-width) solid ButtonBorder;
2113
+ }
2114
+
2115
+ [data-hl-switch] input[type='checkbox']:checked {
2116
+ background: Highlight;
2117
+ border-color: Highlight;
2118
+ }
2119
+
2120
+ [data-hl-switch] input[type='checkbox']::after {
2121
+ forced-color-adjust: none;
2122
+ background: ButtonText;
2123
+ }
2124
+
2125
+ [data-hl-switch] input[type='checkbox']:checked::after {
2126
+ background: HighlightText;
2127
+ }
2128
+ }
1655
2129
  }
1656
2130
  /**
1657
2131
  * Field, accessible form-control layout: `.hl-field` stacks a `.hl-label`,
1658
2132
  * the control, `.hl-help`, and `.hl-error`. `.hl-fieldset` + `.hl-legend`
1659
- * group related fields.
2133
+ * group related fields. Pure CSS; there is no enhancer.
2134
+ * data-hl-required: on `.hl-label`, appends an asterisk
2135
+ * data-hl-invalid: on `.hl-field`, colors the label as an error
1660
2136
  */
1661
2137
  @layer components {
1662
2138
  .hl-field {
@@ -1673,7 +2149,7 @@
1673
2149
 
1674
2150
  .hl-label[data-hl-required]::after {
1675
2151
  content: '*';
1676
- margin-left: var(--hl-space-1);
2152
+ margin-inline-start: var(--hl-space-1);
1677
2153
  color: var(--hl-danger);
1678
2154
  }
1679
2155
 
@@ -1705,8 +2181,7 @@
1705
2181
  }
1706
2182
 
1707
2183
  .hl-legend {
1708
- padding-left: var(--hl-space-2);
1709
- padding-right: var(--hl-space-2);
2184
+ padding-inline: var(--hl-space-2);
1710
2185
  font-size: var(--hl-text-sm);
1711
2186
  font-weight: var(--hl-font-semibold);
1712
2187
  color: var(--hl-fg);
@@ -1714,8 +2189,14 @@
1714
2189
  }
1715
2190
  /**
1716
2191
  * Combobox: `<div data-hl-combobox>` wrapping an `<input>` and a
1717
- * `<ul role="listbox">` of `<li role="option">`. The enhancer toggles the
1718
- * listbox and manages `aria-activedescendant`.
2192
+ * `<ul role="listbox">` of `<li role="option">`.
2193
+ *
2194
+ * No-JS baseline: the listbox is hidden until the root has focus within it,
2195
+ * so the options are at least reachable and readable. The enhancer marks the
2196
+ * root `data-hl-ready` and then owns visibility through `hidden`, filtering,
2197
+ * and `aria-activedescendant`.
2198
+ * data-hl-combobox: root
2199
+ * data-hl-ready: set by the enhancer; the baseline rules stand down
1719
2200
  */
1720
2201
  @layer components {
1721
2202
  [data-hl-combobox] {
@@ -1725,11 +2206,10 @@
1725
2206
 
1726
2207
  [data-hl-combobox] [role='listbox'] {
1727
2208
  position: absolute;
1728
- top: calc(100% + var(--hl-space-1));
1729
- left: 0;
1730
- right: 0;
2209
+ inset-block-start: calc(100% + var(--hl-space-1));
2210
+ inset-inline: 0;
1731
2211
  z-index: var(--hl-z-dropdown);
1732
- max-height: 16rem;
2212
+ max-block-size: 16rem;
1733
2213
  margin: 0;
1734
2214
  padding: var(--hl-space-1);
1735
2215
  overflow-y: auto;
@@ -1745,16 +2225,11 @@
1745
2225
  @supports (anchor-name: --x) {
1746
2226
  [data-hl-combobox] [role='listbox'] {
1747
2227
  position: fixed;
1748
- top: auto;
1749
- right: auto;
1750
- bottom: auto;
1751
- left: auto;
1752
- width: anchor-size(width);
1753
- inset-area: block-end;
2228
+ inset: auto;
2229
+ inline-size: anchor-size(width);
1754
2230
  position-area: block-end;
1755
2231
  position-try-fallbacks: flip-block;
1756
- margin-top: var(--hl-space-1);
1757
- margin-bottom: var(--hl-space-1);
2232
+ margin-block: var(--hl-space-1);
1758
2233
  }
1759
2234
  }
1760
2235
 
@@ -1762,6 +2237,23 @@
1762
2237
  display: none;
1763
2238
  }
1764
2239
 
2240
+ /* No-JS baseline: reveal the list while the field has focus. */
2241
+ [data-hl-combobox]:not([data-hl-ready]) [role='listbox'] {
2242
+ display: none;
2243
+ }
2244
+
2245
+ [data-hl-combobox]:not([data-hl-ready]):focus-within [role='listbox'] {
2246
+ display: block;
2247
+ }
2248
+
2249
+ /* The input may be a plain `<input>` rather than `.hl-input`; make sure it
2250
+ still shows a focus ring. */
2251
+ [data-hl-combobox] > input:focus-visible {
2252
+ outline: none;
2253
+ border-color: var(--hl-ring);
2254
+ box-shadow: var(--hl-focus-shadow);
2255
+ }
2256
+
1765
2257
  [data-hl-combobox] [role='option'] {
1766
2258
  display: flex;
1767
2259
  align-items: center;
@@ -1784,15 +2276,27 @@
1784
2276
  }
1785
2277
 
1786
2278
  [data-hl-combobox] [role='option'][aria-disabled='true'] {
1787
- opacity: 0.5;
2279
+ opacity: var(--hl-disabled-opacity);
1788
2280
  pointer-events: none;
1789
2281
  }
2282
+
2283
+ @media (forced-colors: active) {
2284
+ [data-hl-combobox] [role='option'][aria-selected='true'] {
2285
+ background: Highlight;
2286
+ color: HighlightText;
2287
+ }
2288
+
2289
+ [data-hl-combobox] [role='option'][aria-disabled='true'] {
2290
+ color: GrayText;
2291
+ }
2292
+ }
1790
2293
  }
1791
2294
  /**
1792
2295
  * Segmented control: `<div class="hl-segmented" role="radiogroup">` of
1793
- * `<label class="hl-segmented-item"><input type="radio">…</label>` segments.
2296
+ * `<label class="hl-segmented-item"><input type="radio">...</label>` segments.
1794
2297
  * Radio inputs give free keyboard navigation; the checked segment is raised.
1795
- * A button variant using `aria-pressed="true"` is also supported.
2298
+ * A button variant using `aria-pressed="true"` is also supported. Pure CSS;
2299
+ * there is no enhancer.
1796
2300
  * data-hl-size: sm | md (default) | lg
1797
2301
  */
1798
2302
  @layer components {
@@ -1823,18 +2327,15 @@
1823
2327
  white-space: nowrap;
1824
2328
  cursor: pointer;
1825
2329
  -webkit-user-select: none;
1826
- -moz-user-select: none;
1827
2330
  user-select: none;
1828
2331
  transition:
1829
- background-color var(--hl-duration-fast) var(--hl-ease-standard), color var(--hl-duration-fast) var(--hl-ease-standard);
2332
+ background-color var(--hl-duration-fast) var(--hl-ease-standard),
2333
+ color var(--hl-duration-fast) var(--hl-ease-standard);
1830
2334
  }
1831
2335
 
1832
2336
  .hl-segmented-item > input {
1833
2337
  position: absolute;
1834
- top: 0;
1835
- right: 0;
1836
- bottom: 0;
1837
- left: 0;
2338
+ inset: 0;
1838
2339
  margin: 0;
1839
2340
  opacity: 0;
1840
2341
  cursor: pointer;
@@ -1854,12 +2355,12 @@
1854
2355
  .hl-segmented-item:has(input:focus-visible),
1855
2356
  .hl-segmented-item[aria-pressed]:focus-visible {
1856
2357
  outline: var(--hl-focus-ring);
1857
- outline-offset: 2px;
2358
+ outline-offset: var(--hl-focus-offset);
1858
2359
  }
1859
2360
 
1860
2361
  .hl-segmented-item:has(input:disabled),
1861
2362
  .hl-segmented-item:disabled {
1862
- opacity: 0.5;
2363
+ opacity: var(--hl-disabled-opacity);
1863
2364
  cursor: not-allowed;
1864
2365
  }
1865
2366
 
@@ -1872,64 +2373,72 @@
1872
2373
  padding: var(--hl-space-2) var(--hl-space-4);
1873
2374
  font-size: var(--hl-text-base);
1874
2375
  }
2376
+
2377
+ /* The raised segment relies on a shadow, which forced colors remove. */
2378
+ @media (forced-colors: active) {
2379
+ .hl-segmented-item {
2380
+ border: var(--hl-border-width) solid ButtonBorder;
2381
+ }
2382
+
2383
+ .hl-segmented-item:has(input:checked),
2384
+ .hl-segmented-item[aria-pressed='true'] {
2385
+ background: Highlight;
2386
+ color: HighlightText;
2387
+ }
2388
+ }
1875
2389
  }
1876
2390
  /**
1877
2391
  * Slider: native `<input type="range" class="hl-slider">`. Restyled track and
1878
- * thumb across WebKit/Blink and Firefox while keeping native keyboard support.
2392
+ * thumb across WebKit/Blink and Firefox while keeping native keyboard support
2393
+ * and RTL direction. Pure CSS; there is no enhancer.
1879
2394
  */
1880
2395
  @layer components {
1881
2396
  .hl-slider {
1882
2397
  --_track: 0.375rem;
1883
2398
  --_thumb: 1.15rem;
1884
2399
 
1885
- -webkit-appearance: none;
1886
-
1887
- -moz-appearance: none;
1888
-
1889
- appearance: none;
1890
- width: 100%;
1891
- height: 1.15rem;
1892
- height: var(--_thumb);
2400
+ appearance: none;
2401
+ inline-size: 100%;
2402
+ block-size: var(--_thumb);
1893
2403
  margin: 0;
1894
2404
  background: transparent;
1895
2405
  cursor: pointer;
1896
2406
  }
1897
2407
 
1898
2408
  .hl-slider::-webkit-slider-runnable-track {
1899
- height: var(--_track);
2409
+ block-size: var(--_track);
1900
2410
  border-radius: var(--hl-radius-full);
1901
2411
  background: var(--hl-surface-3);
1902
2412
  }
1903
2413
 
1904
2414
  .hl-slider::-moz-range-track {
1905
- height: var(--_track);
2415
+ block-size: var(--_track);
1906
2416
  border-radius: var(--hl-radius-full);
1907
2417
  background: var(--hl-surface-3);
1908
2418
  }
1909
2419
 
1910
2420
  .hl-slider::-moz-range-progress {
1911
- height: var(--_track);
2421
+ block-size: var(--_track);
1912
2422
  border-radius: var(--hl-radius-full);
1913
2423
  background: var(--hl-primary);
1914
2424
  }
1915
2425
 
1916
2426
  .hl-slider::-webkit-slider-thumb {
1917
- -webkit-appearance: none;
1918
- appearance: none;
1919
- width: var(--_thumb);
1920
- height: var(--_thumb);
1921
- margin-top: calc((var(--_track) - var(--_thumb)) / 2);
2427
+ appearance: none;
2428
+ inline-size: var(--_thumb);
2429
+ block-size: var(--_thumb);
2430
+ margin-block-start: calc((var(--_track) - var(--_thumb)) / 2);
1922
2431
  border: 2px solid var(--hl-surface);
1923
2432
  border-radius: var(--hl-radius-full);
1924
2433
  background: var(--hl-primary);
1925
2434
  box-shadow: var(--hl-shadow-sm);
1926
- -webkit-transition: transform var(--hl-duration-fast) var(--hl-ease-standard);
1927
- transition: transform var(--hl-duration-fast) var(--hl-ease-standard);
2435
+ -webkit-transition: scale var(--hl-duration-fast) var(--hl-ease-standard);
2436
+ transition: scale var(--hl-duration-fast) var(--hl-ease-standard);
1928
2437
  }
1929
2438
 
1930
2439
  .hl-slider::-moz-range-thumb {
1931
- width: var(--_thumb);
1932
- height: var(--_thumb);
2440
+ inline-size: var(--_thumb);
2441
+ block-size: var(--_thumb);
1933
2442
  border: 2px solid var(--hl-surface);
1934
2443
  border-radius: var(--hl-radius-full);
1935
2444
  background: var(--hl-primary);
@@ -1937,7 +2446,7 @@
1937
2446
  }
1938
2447
 
1939
2448
  .hl-slider:active::-webkit-slider-thumb {
1940
- transform: scale(1.1);
2449
+ scale: 1.1;
1941
2450
  }
1942
2451
 
1943
2452
  .hl-slider:focus-visible {
@@ -1945,22 +2454,31 @@
1945
2454
  }
1946
2455
 
1947
2456
  .hl-slider:focus-visible::-webkit-slider-thumb {
1948
- box-shadow: 0 0 0 4px color-mix(in oklab, var(--hl-ring) 35%, transparent);
2457
+ box-shadow: var(--hl-focus-shadow);
1949
2458
  }
1950
2459
 
1951
2460
  .hl-slider:focus-visible::-moz-range-thumb {
1952
- box-shadow: 0 0 0 4px color-mix(in oklab, var(--hl-ring) 35%, transparent);
2461
+ box-shadow: var(--hl-focus-shadow);
1953
2462
  }
1954
2463
 
1955
2464
  .hl-slider:disabled {
1956
2465
  cursor: not-allowed;
1957
- opacity: 0.6;
2466
+ opacity: var(--hl-disabled-opacity);
2467
+ }
2468
+
2469
+ /* Shadows vanish in forced colors, so focus falls back to an outline. */
2470
+ @media (forced-colors: active) {
2471
+ .hl-slider:focus-visible {
2472
+ outline: var(--hl-focus-ring);
2473
+ outline-offset: var(--hl-focus-offset);
2474
+ }
1958
2475
  }
1959
2476
  }
1960
2477
  /* Feedback & data display */
1961
2478
  /**
1962
- * Alert: `<div class="hl-alert" role="alert" data-hl-intent="…">` with an
1963
- * optional icon, `.hl-alert-title`, and body content.
2479
+ * Alert: `<div class="hl-alert" role="alert" data-hl-intent="...">` with an
2480
+ * optional icon, `.hl-alert-title`, and body content. Pure CSS; there is no
2481
+ * enhancer.
1964
2482
  * data-hl-intent: info (default) | success | warning | danger | neutral
1965
2483
  */
1966
2484
  @layer components {
@@ -1973,7 +2491,7 @@
1973
2491
  gap: var(--hl-space-3);
1974
2492
  padding: var(--hl-space-3) var(--hl-space-4);
1975
2493
  border: var(--hl-border-width) solid transparent;
1976
- border-left: 3px solid var(--_accent);
2494
+ border-inline-start: 3px solid var(--_accent);
1977
2495
  border-radius: var(--hl-radius-md);
1978
2496
  background: var(--_bg);
1979
2497
  color: var(--_fg);
@@ -2007,9 +2525,9 @@
2007
2525
 
2008
2526
  .hl-alert > svg:first-child {
2009
2527
  flex: none;
2010
- width: 1.25rem;
2011
- height: 1.25rem;
2012
- margin-top: 0.1rem;
2528
+ inline-size: 1.25rem;
2529
+ block-size: 1.25rem;
2530
+ margin-block-start: 0.1rem;
2013
2531
  color: var(--_accent);
2014
2532
  }
2015
2533
 
@@ -2017,7 +2535,7 @@
2017
2535
  display: flex;
2018
2536
  flex-direction: column;
2019
2537
  gap: var(--hl-space-1);
2020
- min-width: 0;
2538
+ min-inline-size: 0;
2021
2539
  }
2022
2540
 
2023
2541
  .hl-alert-title {
@@ -2029,9 +2547,17 @@
2029
2547
  .hl-alert p {
2030
2548
  margin: 0;
2031
2549
  }
2550
+
2551
+ /* Fills are flattened in forced colors, so the outline carries the shape. */
2552
+ @media (forced-colors: active) {
2553
+ .hl-alert {
2554
+ border-color: CanvasText;
2555
+ }
2556
+ }
2032
2557
  }
2033
2558
  /**
2034
- * Badge: `<span class="hl-badge" data-hl-intent="…" data-hl-variant="…">`.
2559
+ * Badge: `<span class="hl-badge" data-hl-intent="..." data-hl-variant="...">`.
2560
+ * Pure CSS; there is no enhancer.
2035
2561
  * data-hl-intent: neutral (default) | primary | danger | success | warning | info
2036
2562
  * data-hl-variant: soft (default) | solid | outline
2037
2563
  * data-hl-size: sm | md (default)
@@ -2113,10 +2639,18 @@
2113
2639
  padding: 0 var(--hl-space-1-5);
2114
2640
  font-size: 0.6875rem;
2115
2641
  }
2642
+
2643
+ /* Soft and solid fills disappear in forced colors; keep the pill outline. */
2644
+ @media (forced-colors: active) {
2645
+ .hl-badge {
2646
+ border-color: CanvasText;
2647
+ }
2648
+ }
2116
2649
  }
2117
2650
  /**
2118
2651
  * Card: `<div class="hl-card">` with optional `.hl-card-header`,
2119
2652
  * `.hl-card-body`, `.hl-card-footer`, `.hl-card-title`, `.hl-card-description`.
2653
+ * Pure CSS; there is no enhancer.
2120
2654
  * data-hl-interactive: hover/active elevation for clickable cards
2121
2655
  */
2122
2656
  @layer components {
@@ -2135,7 +2669,7 @@
2135
2669
  flex-direction: column;
2136
2670
  gap: var(--hl-space-1);
2137
2671
  padding: var(--hl-space-4) var(--hl-space-5);
2138
- border-bottom: var(--hl-border-width) solid var(--hl-border);
2672
+ border-block-end: var(--hl-border-width) solid var(--hl-border);
2139
2673
  }
2140
2674
 
2141
2675
  .hl-card-body {
@@ -2148,7 +2682,7 @@
2148
2682
  align-items: center;
2149
2683
  gap: var(--hl-space-2);
2150
2684
  padding: var(--hl-space-4) var(--hl-space-5);
2151
- border-top: var(--hl-border-width) solid var(--hl-border);
2685
+ border-block-start: var(--hl-border-width) solid var(--hl-border);
2152
2686
  background: var(--hl-surface-2);
2153
2687
  }
2154
2688
 
@@ -2168,7 +2702,9 @@
2168
2702
  .hl-card[data-hl-interactive] {
2169
2703
  cursor: pointer;
2170
2704
  transition:
2171
- 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);
2705
+ border-color var(--hl-duration-fast) var(--hl-ease-standard),
2706
+ box-shadow var(--hl-duration-base) var(--hl-ease-standard),
2707
+ translate var(--hl-duration-base) var(--hl-ease-standard);
2172
2708
  }
2173
2709
 
2174
2710
  .hl-card[data-hl-interactive]:hover {
@@ -2178,16 +2714,17 @@
2178
2714
 
2179
2715
  .hl-card[data-hl-interactive]:focus-within {
2180
2716
  outline: var(--hl-focus-ring);
2181
- outline-offset: 2px;
2717
+ outline-offset: var(--hl-focus-offset);
2182
2718
  }
2183
2719
 
2184
2720
  .hl-card[data-hl-interactive]:active {
2185
- transform: translateY(1px);
2721
+ translate: 0 1px;
2186
2722
  }
2187
2723
  }
2188
2724
  /**
2189
2725
  * Avatar: `<span class="hl-avatar">` containing an `<img>` or fallback
2190
- * initials/icon. Stack with `<div class="hl-avatar-group">`.
2726
+ * initials/icon. Stack with `<div class="hl-avatar-group">`. Pure CSS; there
2727
+ * is no enhancer.
2191
2728
  * data-hl-size: xs | sm | md (default) | lg | xl
2192
2729
  * data-hl-shape: square
2193
2730
  */
@@ -2197,25 +2734,19 @@
2197
2734
 
2198
2735
  position: relative;
2199
2736
  display: inline-grid;
2200
- align-items: center;
2201
- justify-items: center;
2202
2737
  place-items: center;
2203
2738
  flex: none;
2204
- width: 2.5rem;
2205
- width: var(--_size);
2206
- height: 2.5rem;
2207
- height: var(--_size);
2739
+ inline-size: var(--_size);
2740
+ block-size: var(--_size);
2208
2741
  border-radius: var(--hl-radius-full);
2209
2742
  overflow: hidden;
2210
2743
  background: var(--hl-surface-3);
2211
2744
  color: var(--hl-fg-muted);
2212
- font-size: calc(2.5rem * 0.4);
2213
2745
  font-size: calc(var(--_size) * 0.4);
2214
2746
  font-weight: var(--hl-font-medium);
2215
2747
  line-height: 1;
2216
2748
  text-transform: uppercase;
2217
2749
  -webkit-user-select: none;
2218
- -moz-user-select: none;
2219
2750
  user-select: none;
2220
2751
  }
2221
2752
 
@@ -2224,10 +2755,9 @@
2224
2755
  }
2225
2756
 
2226
2757
  .hl-avatar > img {
2227
- width: 100%;
2228
- height: 100%;
2229
- -o-object-fit: cover;
2230
- object-fit: cover;
2758
+ inline-size: 100%;
2759
+ block-size: 100%;
2760
+ object-fit: cover;
2231
2761
  }
2232
2762
 
2233
2763
  .hl-avatar[data-hl-size='xs'] {
@@ -2256,12 +2786,12 @@
2256
2786
  }
2257
2787
 
2258
2788
  .hl-avatar-group > .hl-avatar:not(:first-child) {
2259
- margin-left: -0.6rem;
2789
+ margin-inline-start: -0.6rem;
2260
2790
  }
2261
2791
  }
2262
2792
  /**
2263
2793
  * Progress: native `<progress class="hl-progress" value max>`. Omit `value`
2264
- * for an indeterminate bar.
2794
+ * for an indeterminate bar. Pure CSS; there is no enhancer.
2265
2795
  * data-hl-intent: primary (default) | success | warning | danger | info
2266
2796
  * data-hl-size: sm | md (default) | lg
2267
2797
  */
@@ -2270,14 +2800,9 @@
2270
2800
  --_color: var(--hl-primary);
2271
2801
  --_height: 0.5rem;
2272
2802
 
2273
- -webkit-appearance: none;
2274
-
2275
- -moz-appearance: none;
2276
-
2277
- appearance: none;
2278
- width: 100%;
2279
- height: 0.5rem;
2280
- height: var(--_height);
2803
+ appearance: none;
2804
+ inline-size: 100%;
2805
+ block-size: var(--_height);
2281
2806
  border: 0;
2282
2807
  border-radius: var(--hl-radius-full);
2283
2808
  overflow: hidden;
@@ -2316,8 +2841,8 @@
2316
2841
  .hl-progress::-webkit-progress-value {
2317
2842
  background: var(--_color);
2318
2843
  border-radius: var(--hl-radius-full);
2319
- -webkit-transition: width var(--hl-duration-base) var(--hl-ease-standard);
2320
- transition: width var(--hl-duration-base) var(--hl-ease-standard);
2844
+ -webkit-transition: inline-size var(--hl-duration-base) var(--hl-ease-standard);
2845
+ transition: inline-size var(--hl-duration-base) var(--hl-ease-standard);
2321
2846
  }
2322
2847
 
2323
2848
  .hl-progress::-moz-progress-bar {
@@ -2347,15 +2872,32 @@
2347
2872
  }
2348
2873
  }
2349
2874
 
2875
+ /* A static partial bar still signals "in progress" without motion. */
2350
2876
  @media (prefers-reduced-motion: reduce) {
2351
2877
  .hl-progress:indeterminate {
2352
- animation-duration: 3s;
2878
+ animation: none;
2879
+ background-position: 30% 0;
2880
+ }
2881
+ }
2882
+
2883
+ @media (forced-colors: active) {
2884
+ .hl-progress {
2885
+ border: var(--hl-border-width) solid CanvasText;
2886
+ }
2887
+
2888
+ .hl-progress::-webkit-progress-value {
2889
+ background: Highlight;
2890
+ }
2891
+
2892
+ .hl-progress::-moz-progress-bar {
2893
+ background: Highlight;
2353
2894
  }
2354
2895
  }
2355
2896
  }
2356
2897
  /**
2357
2898
  * Spinner: `<span class="hl-spinner" role="status" aria-label="Loading">`.
2358
- * Inherits `currentColor`, so set `color` to theme it.
2899
+ * Inherits `currentColor`, so set `color` to theme it. Pure CSS; there is no
2900
+ * enhancer.
2359
2901
  * data-hl-size: sm | md (default) | lg | xl
2360
2902
  */
2361
2903
  @layer components {
@@ -2365,22 +2907,14 @@
2365
2907
 
2366
2908
  display: inline-block;
2367
2909
  flex: none;
2368
- width: 1.25rem;
2369
- width: var(--_size);
2370
- height: 1.25rem;
2371
- height: var(--_size);
2372
- border: 2px solid color-mix(in oklab, currentcolor 25%, transparent);
2373
- border-top-color: currentcolor;
2910
+ inline-size: var(--_size);
2911
+ block-size: var(--_size);
2912
+ border: var(--_width) solid color-mix(in oklab, currentcolor 25%, transparent);
2913
+ border-block-start-color: currentcolor;
2374
2914
  border-radius: var(--hl-radius-full);
2375
2915
  animation: hl-spinner-rotate 0.6s linear infinite;
2376
2916
  }
2377
2917
 
2378
- @supports (color: color-mix(in lch, red, blue)) {
2379
- .hl-spinner {
2380
- border: var(--_width) solid color-mix(in oklab, currentcolor 25%, transparent);
2381
- }
2382
- }
2383
-
2384
2918
  .hl-spinner[data-hl-size='sm'] {
2385
2919
  --_size: 1rem;
2386
2920
  }
@@ -2401,22 +2935,33 @@
2401
2935
  }
2402
2936
  }
2403
2937
 
2938
+ /* A static arc still reads as "loading" without continuous motion. */
2404
2939
  @media (prefers-reduced-motion: reduce) {
2405
2940
  .hl-spinner {
2406
- animation-duration: 1.4s;
2941
+ animation: none;
2942
+ }
2943
+ }
2944
+
2945
+ /* The faded ring is color-mixed, which forced colors flatten; keep the arc
2946
+ visible by drawing the rest of the ring in GrayText. */
2947
+ @media (forced-colors: active) {
2948
+ .hl-spinner {
2949
+ border-color: GrayText;
2950
+ border-block-start-color: CanvasText;
2407
2951
  }
2408
2952
  }
2409
2953
  }
2410
2954
  /**
2411
- * Skeleton: `<span class="hl-skeleton" data-hl-variant="…" aria-hidden="true">`
2412
- * placeholder shown while content loads.
2413
- * data-hl-variant: rect (default) | text | circle
2955
+ * Skeleton: `<span class="hl-skeleton" data-hl-shape="..." aria-hidden="true">`
2956
+ * placeholder shown while content loads. Pure CSS; there is no enhancer.
2957
+ * Size it with inline `inline-size`/`block-size`.
2958
+ * data-hl-shape: rect (default) | text | circle
2414
2959
  */
2415
2960
  @layer components {
2416
2961
  .hl-skeleton {
2417
2962
  display: block;
2418
- width: 100%;
2419
- height: 1rem;
2963
+ inline-size: 100%;
2964
+ block-size: 1rem;
2420
2965
  border-radius: var(--hl-radius-md);
2421
2966
  background: linear-gradient(
2422
2967
  90deg,
@@ -2428,14 +2973,14 @@
2428
2973
  animation: hl-skeleton-shimmer 1.4s var(--hl-ease-standard) infinite;
2429
2974
  }
2430
2975
 
2431
- .hl-skeleton[data-hl-variant='text'] {
2432
- height: 0.7em;
2976
+ .hl-skeleton[data-hl-shape='text'] {
2977
+ block-size: 0.7em;
2433
2978
  border-radius: var(--hl-radius-sm);
2434
2979
  }
2435
2980
 
2436
- .hl-skeleton[data-hl-variant='circle'] {
2437
- width: 2.5rem;
2438
- height: 2.5rem;
2981
+ .hl-skeleton[data-hl-shape='circle'] {
2982
+ inline-size: 2.5rem;
2983
+ block-size: 2.5rem;
2439
2984
  border-radius: var(--hl-radius-full);
2440
2985
  }
2441
2986
 
@@ -2455,20 +3000,28 @@
2455
3000
  background: var(--hl-surface-3);
2456
3001
  }
2457
3002
  }
3003
+
3004
+ /* Fills flatten to Canvas in forced colors; outline the placeholder instead. */
3005
+ @media (forced-colors: active) {
3006
+ .hl-skeleton {
3007
+ border: var(--hl-border-width) solid GrayText;
3008
+ }
3009
+ }
2458
3010
  }
2459
3011
  /**
2460
3012
  * Keyboard key: `<kbd class="hl-kbd">⌘</kbd>`. Combine inline, e.g.
2461
- * `<kbd class="hl-kbd">⌘</kbd><kbd class="hl-kbd">K</kbd>`.
3013
+ * `<kbd class="hl-kbd">⌘</kbd><kbd class="hl-kbd">K</kbd>`. Pure CSS; there
3014
+ * is no enhancer.
2462
3015
  */
2463
3016
  @layer components {
2464
3017
  .hl-kbd {
2465
3018
  display: inline-flex;
2466
3019
  align-items: center;
2467
3020
  justify-content: center;
2468
- min-width: 1.5rem;
3021
+ min-inline-size: 1.5rem;
2469
3022
  padding: 0.125rem 0.4rem;
2470
3023
  border: var(--hl-border-width) solid var(--hl-border-strong);
2471
- border-bottom-width: var(--hl-border-width-2);
3024
+ border-block-end-width: var(--hl-border-width-2);
2472
3025
  border-radius: var(--hl-radius-sm);
2473
3026
  background: var(--hl-surface-2);
2474
3027
  color: var(--hl-fg);
@@ -2479,33 +3032,44 @@
2479
3032
  }
2480
3033
  }
2481
3034
  /**
2482
- * Table: `<table class="hl-table">`. Semantic table styling with optional
2483
- * zebra striping and hover.
3035
+ * Table: `<table class="hl-table">`, optionally inside
3036
+ * `<div class="hl-table-wrapper">` so wide tables scroll instead of breaking
3037
+ * the layout. Pure CSS; there is no enhancer.
2484
3038
  * data-hl-striped: zebra rows
2485
3039
  * data-hl-hover: highlight row on hover
3040
+ * data-hl-align: start (default) | center | end, on the table or a cell
3041
+ * data-hl-size: sm | md (default) | lg, cell padding density
2486
3042
  */
2487
3043
  @layer components {
3044
+ .hl-table-wrapper {
3045
+ inline-size: 100%;
3046
+ overflow-x: auto;
3047
+ overscroll-behavior-x: contain;
3048
+ }
3049
+
2488
3050
  .hl-table {
2489
- width: 100%;
3051
+ --_pad-y: var(--hl-space-2);
3052
+ --_pad-x: var(--hl-space-3);
3053
+
3054
+ inline-size: 100%;
2490
3055
  border-collapse: collapse;
2491
3056
  font-size: var(--hl-text-sm);
2492
3057
  color: var(--hl-fg);
2493
3058
  }
2494
3059
 
2495
3060
  .hl-table caption {
2496
- padding-top: var(--hl-space-2);
2497
- padding-bottom: var(--hl-space-2);
3061
+ padding-block: var(--hl-space-2);
2498
3062
  color: var(--hl-fg-muted);
2499
- text-align: left;
3063
+ text-align: start;
2500
3064
  caption-side: bottom;
2501
3065
  }
2502
3066
 
2503
3067
  .hl-table th,
2504
3068
  .hl-table td {
2505
- padding: var(--hl-space-2) var(--hl-space-3);
2506
- text-align: left;
3069
+ padding: var(--_pad-y) var(--_pad-x);
3070
+ text-align: start;
2507
3071
  vertical-align: middle;
2508
- border-bottom: var(--hl-border-width) solid var(--hl-border);
3072
+ border-block-end: var(--hl-border-width) solid var(--hl-border);
2509
3073
  }
2510
3074
 
2511
3075
  .hl-table thead th {
@@ -2514,7 +3078,7 @@
2514
3078
  text-transform: uppercase;
2515
3079
  letter-spacing: 0.03em;
2516
3080
  color: var(--hl-fg-muted);
2517
- border-bottom-color: var(--hl-border-strong);
3081
+ border-block-end-color: var(--hl-border-strong);
2518
3082
  }
2519
3083
 
2520
3084
  .hl-table tfoot td {
@@ -2530,32 +3094,63 @@
2530
3094
  background: color-mix(in oklab, var(--hl-primary) 8%, transparent);
2531
3095
  }
2532
3096
 
2533
- .hl-table td[data-hl-align='end'],
2534
- .hl-table th[data-hl-align='end'] {
2535
- text-align: right;
3097
+ .hl-table[data-hl-size='sm'] {
3098
+ --_pad-y: var(--hl-space-1);
3099
+ --_pad-x: var(--hl-space-2);
3100
+
3101
+ font-size: var(--hl-text-xs);
3102
+ }
3103
+
3104
+ .hl-table[data-hl-size='lg'] {
3105
+ --_pad-y: var(--hl-space-3);
3106
+ --_pad-x: var(--hl-space-4);
3107
+
3108
+ font-size: var(--hl-text-base);
3109
+ }
3110
+
3111
+ .hl-table[data-hl-align='start'] :is(th, td),
3112
+ .hl-table :is(th, td)[data-hl-align='start'] {
3113
+ text-align: start;
2536
3114
  }
2537
3115
 
2538
- .hl-table td[data-hl-align='center'],
2539
- .hl-table th[data-hl-align='center'] {
3116
+ .hl-table[data-hl-align='center'] :is(th, td),
3117
+ .hl-table :is(th, td)[data-hl-align='center'] {
2540
3118
  text-align: center;
2541
3119
  }
3120
+
3121
+ .hl-table[data-hl-align='end'] :is(th, td),
3122
+ .hl-table :is(th, td)[data-hl-align='end'] {
3123
+ text-align: end;
3124
+ }
3125
+
3126
+ @media (forced-colors: active) {
3127
+ .hl-table[data-hl-hover] tbody tr:hover {
3128
+ background: Highlight;
3129
+ color: HighlightText;
3130
+ }
3131
+ }
2542
3132
  }
2543
3133
  /* Navigation utilities */
3134
+ /**
3135
+ * Skip link: `<a class="hl-skip-link" href="#main">Skip to content</a>` placed
3136
+ * first in the body. Visually hidden until it receives keyboard focus, then
3137
+ * pinned to the start corner of the viewport. Pure CSS; there is no enhancer.
3138
+ */
2544
3139
  @layer components {
2545
3140
  .hl-skip-link {
2546
3141
  position: absolute;
2547
- left: -9999px;
2548
- top: auto;
2549
- width: 1px;
2550
- height: 1px;
3142
+ inset-inline-start: -9999px;
3143
+ inset-block-start: auto;
3144
+ inline-size: 1px;
3145
+ block-size: 1px;
2551
3146
  overflow: hidden;
2552
3147
  }
2553
3148
 
2554
3149
  .hl-skip-link:focus-visible {
2555
- left: 0;
2556
- top: 0;
2557
- width: auto;
2558
- height: auto;
3150
+ inset-inline-start: 0;
3151
+ inset-block-start: 0;
3152
+ inline-size: auto;
3153
+ block-size: auto;
2559
3154
  padding: var(--hl-space-2) var(--hl-space-3);
2560
3155
  background: var(--hl-fg);
2561
3156
  color: var(--hl-surface);