hydrateless 0.8.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/README.md +120 -0
  2. package/dist/accordion.css +20 -8
  3. package/dist/alert.css +15 -7
  4. package/dist/avatar.css +8 -14
  5. package/dist/badge.css +9 -1
  6. package/dist/breadcrumb.css +7 -3
  7. package/dist/button.css +48 -28
  8. package/dist/card.css +8 -5
  9. package/dist/checkbox.css +31 -22
  10. package/dist/combobox.css +43 -15
  11. package/dist/command-palette.css +123 -0
  12. package/dist/components.css +1103 -566
  13. package/dist/disclosure.css +27 -29
  14. package/dist/drawer.css +76 -48
  15. package/dist/dropdown.css +82 -22
  16. package/dist/field.css +5 -4
  17. package/dist/hydrateless.css +1333 -1321
  18. package/dist/hydrateless.min.css +1 -1
  19. package/dist/input.css +20 -17
  20. package/dist/kbd.css +4 -3
  21. package/dist/menu.css +91 -45
  22. package/dist/modal.css +63 -14
  23. package/dist/pagination.css +20 -11
  24. package/dist/popover.css +34 -12
  25. package/dist/progress.css +23 -12
  26. package/dist/{radio.css → radio-group.css} +23 -16
  27. package/dist/reset.css +7 -2
  28. package/dist/{segmented.css → segmented-control.css} +21 -10
  29. package/dist/select.css +28 -22
  30. package/dist/separator.css +9 -9
  31. package/dist/skeleton.css +18 -10
  32. package/dist/skip-link.css +13 -8
  33. package/dist/slider.css +28 -25
  34. package/dist/spinner.css +17 -14
  35. package/dist/switch.css +55 -18
  36. package/dist/table.css +52 -15
  37. package/dist/tabs.css +35 -11
  38. package/dist/textarea.css +26 -12
  39. package/dist/theme.css +5 -24
  40. package/dist/toast.css +40 -36
  41. package/dist/toc.css +17 -4
  42. package/dist/tokens.css +208 -179
  43. package/dist/tooltip.css +45 -15
  44. package/package.json +4 -4
  45. package/dist/command.css +0 -102
@@ -2,66 +2,64 @@
2
2
  /**
3
3
  * Disclosure: a styled native `<details>`. The class and the `data-hl-disclosure`
4
4
  * attribute (which also opts into the state enhancer) are interchangeable, so
5
- * plain HTML needs only one of them. Exclusive groups need no JavaScript:
6
- * give related disclosures the same `name` attribute.
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.
7
10
  */
8
11
  @layer components {
9
- details.hl-disclosure, details[data-hl-disclosure] {
10
- border: 1px solid var(--hl-border);
12
+ details:is(.hl-disclosure, [data-hl-disclosure]) {
13
+ border: var(--hl-border-width) solid var(--hl-border);
11
14
  border-radius: var(--hl-radius-lg);
12
15
  background: var(--hl-surface);
13
16
  }
14
17
 
15
- details.hl-disclosure > summary, details[data-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);
16
22
  list-style: none;
17
23
  cursor: pointer;
18
24
  padding: var(--hl-space-3) var(--hl-space-4);
19
25
  }
20
26
 
21
- details.hl-disclosure > summary::-webkit-details-marker {
22
- display: none;
23
- }
24
-
25
- details[data-hl-disclosure] > summary::-webkit-details-marker {
27
+ details:is(.hl-disclosure, [data-hl-disclosure]) > summary::-webkit-details-marker {
26
28
  display: none;
27
29
  }
28
30
 
29
- details.hl-disclosure > summary:focus-visible {
30
- outline: var(--hl-focus-ring);
31
- outline-offset: 2px;
32
- }
33
-
34
- details[data-hl-disclosure] > summary:focus-visible {
31
+ details:is(.hl-disclosure, [data-hl-disclosure]) > summary:focus-visible {
35
32
  outline: var(--hl-focus-ring);
36
- outline-offset: 2px;
33
+ outline-offset: var(--hl-focus-offset);
37
34
  }
38
35
 
39
- 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 {
40
38
  content: '\25B8';
41
- float: right;
42
- 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);
43
41
  }
44
42
 
45
- details[data-hl-disclosure] > summary::after {
46
- content: '\25B8';
47
- float: right;
48
- transition: transform var(--hl-duration-fast) var(--hl-ease-standard);
43
+ details:is(.hl-disclosure, [data-hl-disclosure])[open] > summary::after {
44
+ rotate: 90deg;
49
45
  }
50
46
 
51
- details.hl-disclosure[open] > summary::after {
52
- 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;
53
51
  }
54
52
 
55
- details[data-hl-disclosure][open] > summary::after {
56
- transform: rotate(90deg);
53
+ details:is(.hl-disclosure, [data-hl-disclosure])[open]:dir(rtl) > summary::after {
54
+ rotate: -90deg;
57
55
  }
58
56
 
59
- details.hl-disclosure > .hl-disclosure-panel, details[data-hl-disclosure] > .hl-disclosure-panel {
57
+ details:is(.hl-disclosure, [data-hl-disclosure]) > .hl-disclosure-panel {
60
58
  padding: var(--hl-space-3) var(--hl-space-4) var(--hl-space-4);
61
59
  }
62
60
  }
63
61
  /**
64
- * Tabs. Two markups are supported and styled together:
62
+ * Tabs: `<div data-hl-tabs>`. Two markups are supported and styled together:
65
63
  *
66
64
  * - CSS-only baseline: `.hl-tablist` of `<label class="hl-tab">` wrapping a
67
65
  * radio, then a `.hl-tabpanels` of `.hl-tabpanel`s. `:has(input:checked)`
@@ -69,6 +67,10 @@
69
67
  * - Enhanced: the enhancer adds `role="tab"`/`tabpanel`, roving focus, and
70
68
  * `aria-selected`, toggles `[hidden]` on panels, and marks the root
71
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.
72
74
  */
73
75
  @layer components {
74
76
  [data-hl-tabs] {
@@ -81,15 +83,23 @@
81
83
  display: flex;
82
84
  gap: var(--hl-space-2);
83
85
  padding: var(--hl-space-2);
84
- 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);
85
97
  }
86
98
 
87
99
  .hl-tab,
88
100
  [data-hl-tabs] [role='tab'] {
89
101
  position: relative;
90
- -webkit-appearance: none;
91
- -moz-appearance: none;
92
- appearance: none;
102
+ appearance: none;
93
103
  display: inline-flex;
94
104
  align-items: center;
95
105
  background: transparent;
@@ -104,10 +114,7 @@
104
114
  /* The baseline keeps selection in a visually hidden radio per tab label. */
105
115
  .hl-tab > input[type='radio'] {
106
116
  position: absolute;
107
- top: 0;
108
- right: 0;
109
- bottom: 0;
110
- left: 0;
117
+ inset: 0;
111
118
  margin: 0;
112
119
  opacity: 0;
113
120
  cursor: pointer;
@@ -121,13 +128,13 @@
121
128
  .hl-tab:has(input:focus-visible),
122
129
  [data-hl-tabs] [role='tab']:focus-visible {
123
130
  outline: var(--hl-focus-ring);
124
- outline-offset: 2px;
131
+ outline-offset: var(--hl-focus-offset);
125
132
  }
126
133
 
127
134
  .hl-tab:has(input:disabled),
128
135
  [data-hl-tabs] [role='tab'][disabled],
129
136
  [data-hl-tabs] [role='tab'][aria-disabled='true'] {
130
- opacity: 0.5;
137
+ opacity: var(--hl-disabled-opacity);
131
138
  cursor: not-allowed;
132
139
  }
133
140
 
@@ -186,22 +193,49 @@
186
193
  [data-hl-tabs]:not([data-hl-ready]) [role='tabpanel'] ~ [role='tabpanel'] {
187
194
  display: none;
188
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
+ }
189
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
+ */
190
221
  @layer components {
191
222
  [data-hl-accordion] {
192
- border: 1px solid var(--hl-border);
223
+ border: var(--hl-border-width) solid var(--hl-border);
193
224
  border-radius: var(--hl-radius-lg);
194
225
  }
195
226
 
196
227
  [data-hl-accordion] > details {
197
- border-top: 1px solid var(--hl-border);
228
+ border-block-start: var(--hl-border-width) solid var(--hl-border);
198
229
  }
199
230
 
200
231
  [data-hl-accordion] > details:first-child {
201
- border-top: 0;
232
+ border-block-start: 0;
202
233
  }
203
234
 
204
235
  [data-hl-accordion] > details > summary {
236
+ display: flex;
237
+ align-items: center;
238
+ gap: var(--hl-space-2);
205
239
  list-style: none;
206
240
  cursor: pointer;
207
241
  padding: var(--hl-space-3) var(--hl-space-4);
@@ -213,27 +247,34 @@
213
247
 
214
248
  [data-hl-accordion] > details > summary:focus-visible {
215
249
  outline: var(--hl-focus-ring);
216
- outline-offset: 2px;
250
+ outline-offset: var(--hl-focus-offset);
217
251
  }
218
252
 
253
+ /* The chevron sits at the inline end so it lands on the left under RTL. */
219
254
  [data-hl-accordion] > details > summary::after {
220
255
  content: '\25BE';
221
- float: right;
222
- transform: rotate(0deg);
223
- 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);
224
258
  }
225
259
 
226
260
  [data-hl-accordion] > details[open] > summary::after {
227
- transform: rotate(180deg);
261
+ rotate: 180deg;
228
262
  }
229
263
 
230
264
  [data-hl-accordion] > details > .hl-accordion-panel {
231
265
  padding: var(--hl-space-3) var(--hl-space-4) var(--hl-space-4);
232
266
  }
233
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
+ */
234
275
  @layer components {
235
276
  nav[data-hl-toc] {
236
- border: 1px solid var(--hl-border);
277
+ border: var(--hl-border-width) solid var(--hl-border);
237
278
  border-radius: var(--hl-radius-lg);
238
279
  padding: var(--hl-space-3);
239
280
  }
@@ -254,13 +295,12 @@
254
295
  padding: var(--hl-space-1) var(--hl-space-2);
255
296
  border-radius: var(--hl-radius-sm);
256
297
  color: inherit;
257
- -webkit-text-decoration: none;
258
298
  text-decoration: none;
259
299
  }
260
300
 
261
301
  nav[data-hl-toc] a:focus-visible {
262
302
  outline: var(--hl-focus-ring);
263
- outline-offset: -2px;
303
+ outline-offset: calc(var(--hl-focus-offset) * -1);
264
304
  }
265
305
 
266
306
  nav[data-hl-toc] a[aria-current='true'] {
@@ -268,9 +308,22 @@
268
308
  }
269
309
 
270
310
  nav[data-hl-toc] ul ul {
271
- 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
+ }
272
319
  }
273
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
+ */
274
327
  @layer components {
275
328
  nav[data-hl-breadcrumb] ol {
276
329
  display: flex;
@@ -295,19 +348,17 @@
295
348
 
296
349
  nav[data-hl-breadcrumb] a {
297
350
  color: var(--hl-primary);
298
- -webkit-text-decoration: none;
299
351
  text-decoration: none;
300
352
  border-radius: var(--hl-radius-sm);
301
353
  }
302
354
 
303
355
  nav[data-hl-breadcrumb] a:hover {
304
- -webkit-text-decoration: underline;
305
356
  text-decoration: underline;
306
357
  }
307
358
 
308
359
  nav[data-hl-breadcrumb] a:focus-visible {
309
360
  outline: var(--hl-focus-ring);
310
- outline-offset: 2px;
361
+ outline-offset: var(--hl-focus-offset);
311
362
  }
312
363
 
313
364
  nav[data-hl-breadcrumb] [aria-current='page'] {
@@ -317,7 +368,8 @@
317
368
  /**
318
369
  * Pagination: `<nav class="hl-pagination" aria-label="Pagination">` wrapping a
319
370
  * list of `.hl-pagination-item` links/buttons; mark the active page with
320
- * `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.
321
373
  */
322
374
  @layer components {
323
375
  .hl-pagination ul {
@@ -335,17 +387,15 @@
335
387
  align-items: center;
336
388
  justify-content: center;
337
389
  gap: var(--hl-space-1);
338
- min-width: 2.25rem;
339
- height: 2.25rem;
340
- padding-left: var(--hl-space-2);
341
- 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);
342
393
  border: var(--hl-border-width) solid transparent;
343
394
  border-radius: var(--hl-radius-md);
344
395
  background: transparent;
345
396
  color: var(--hl-fg);
346
397
  font: inherit;
347
398
  font-size: var(--hl-text-sm);
348
- -webkit-text-decoration: none;
349
399
  text-decoration: none;
350
400
  cursor: pointer;
351
401
  transition: background-color var(--hl-duration-fast) var(--hl-ease-standard);
@@ -357,7 +407,7 @@
357
407
 
358
408
  .hl-pagination-item:focus-visible {
359
409
  outline: var(--hl-focus-ring);
360
- outline-offset: 2px;
410
+ outline-offset: var(--hl-focus-offset);
361
411
  }
362
412
 
363
413
  .hl-pagination-item[aria-current='page'] {
@@ -368,7 +418,7 @@
368
418
 
369
419
  .hl-pagination-item[aria-disabled='true'],
370
420
  .hl-pagination-item:disabled {
371
- opacity: 0.45;
421
+ opacity: var(--hl-disabled-opacity);
372
422
  pointer-events: none;
373
423
  }
374
424
 
@@ -376,17 +426,29 @@
376
426
  display: inline-flex;
377
427
  align-items: center;
378
428
  justify-content: center;
379
- min-width: 2.25rem;
380
- height: 2.25rem;
429
+ min-inline-size: var(--hl-control-block-size);
430
+ block-size: var(--hl-control-block-size);
381
431
  color: var(--hl-fg-subtle);
382
432
  -webkit-user-select: none;
383
- -moz-user-select: none;
384
433
  user-select: none;
385
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
+ }
386
446
  }
387
447
  /**
388
448
  * Separator: `<hr class="hl-separator">` or
389
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)
390
452
  */
391
453
  @layer components {
392
454
  .hl-separator {
@@ -395,157 +457,239 @@
395
457
  background: var(--hl-border);
396
458
  }
397
459
 
398
- .hl-separator:not([aria-orientation='vertical']):not([data-hl-orientation='vertical']) {
399
- width: 100%;
400
- height: var(--hl-border-width);
401
- margin-top: var(--hl-space-4);
402
- 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);
403
464
  }
404
465
 
405
466
  .hl-separator[aria-orientation='vertical'],
406
467
  .hl-separator[data-hl-orientation='vertical'] {
407
468
  align-self: stretch;
408
- width: var(--hl-border-width);
409
- min-height: 1rem;
410
- margin-left: var(--hl-space-4);
411
- 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);
412
472
  }
413
473
  }
414
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
+ */
415
484
  @layer components {
416
- .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;
417
489
  border: none;
418
490
  border-radius: var(--hl-radius-lg);
419
- padding: 0;
420
- max-width: min(90vw, 640px);
421
- width: 100%;
422
491
  background: var(--hl-surface);
423
492
  color: var(--hl-fg);
424
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
+ }
425
512
  }
426
513
 
427
- .hl-modal::backdrop {
514
+ :is(.hl-modal, dialog[data-hl-modal])::backdrop {
428
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;
521
+ }
522
+
523
+ :is(.hl-modal, dialog[data-hl-modal])[open]::backdrop {
524
+ opacity: 1;
429
525
  }
430
526
 
431
- .hl-modal .hl-modal-header,
432
- .hl-modal .hl-modal-body,
433
- .hl-modal .hl-modal-footer {
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) {
434
534
  padding: var(--hl-space-4);
435
535
  }
436
536
 
437
- .hl-modal .hl-modal-header {
438
- 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);
439
539
  }
440
540
 
441
- .hl-modal .hl-modal-footer {
442
- 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);
443
543
  }
444
544
 
445
- .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 {
446
548
  outline: var(--hl-focus-ring);
447
- 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
+ }
448
557
  }
449
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
+ */
450
569
  @layer components {
451
- dialog.hl-drawer {
452
- border: none;
453
- padding: 0;
454
- width: min(90vw, 360px);
455
- 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;
456
579
  margin: 0;
580
+ padding: 0;
581
+ border: none;
457
582
  background: var(--hl-surface);
458
583
  color: var(--hl-fg);
459
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;
460
589
  }
461
590
 
462
- dialog.hl-drawer::backdrop {
463
- background: var(--hl-scrim);
464
- }
591
+ :is(.hl-drawer, dialog[data-hl-drawer])[data-hl-side='start'] {
592
+ --_slide: -100%;
465
593
 
466
- .hl-drawer[open] {
467
- animation: hl-drawer-in-right var(--hl-duration-base) var(--hl-ease-standard);
594
+ inset-inline: 0 auto;
468
595
  }
469
596
 
470
- @keyframes hl-drawer-in-right {
471
- from {
472
- transform: translateX(100%);
473
- }
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
+ }
474
601
 
475
- to {
476
- transform: translateX(0%);
477
- }
602
+ :is(.hl-drawer, dialog[data-hl-drawer])[data-hl-side='start']:dir(rtl) {
603
+ --_slide: 100%;
478
604
  }
479
605
 
480
- @keyframes hl-drawer-in-left {
481
- from {
482
- transform: translateX(-100%);
483
- }
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
+ }
484
610
 
485
- to {
486
- transform: translateX(0%);
487
- }
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;
488
615
  }
489
616
 
490
- @media (prefers-reduced-motion: reduce) {
491
- .hl-drawer[open] {
492
- animation: none;
617
+ @starting-style {
618
+ :is(.hl-drawer, dialog[data-hl-drawer])[open] {
619
+ translate: var(--_slide) 0;
493
620
  }
494
621
  }
495
622
 
496
- .hl-drawer[data-side='left'] {
497
- width: auto;
498
- top: 0;
499
- right: auto;
500
- bottom: 0;
501
- 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;
502
630
  }
503
631
 
504
- .hl-drawer[data-side='left'][open] {
505
- animation-name: hl-drawer-in-left;
632
+ :is(.hl-drawer, dialog[data-hl-drawer])[open]::backdrop {
633
+ opacity: 1;
506
634
  }
507
635
 
508
- .hl-drawer[data-side='right'] {
509
- width: auto;
510
- top: 0;
511
- right: 0;
512
- bottom: 0;
513
- left: auto;
636
+ @starting-style {
637
+ :is(.hl-drawer, dialog[data-hl-drawer])[open]::backdrop {
638
+ opacity: 0;
639
+ }
514
640
  }
515
641
 
516
- .hl-drawer .hl-drawer-header,
517
- .hl-drawer .hl-drawer-body,
518
- .hl-drawer .hl-drawer-footer {
642
+ :is(.hl-drawer, dialog[data-hl-drawer])
643
+ :is(.hl-drawer-header, .hl-drawer-body, .hl-drawer-footer) {
519
644
  padding: var(--hl-space-4);
520
645
  }
521
646
 
522
- .hl-drawer .hl-drawer-header {
523
- 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);
654
+ }
655
+
656
+ :is(.hl-drawer, dialog[data-hl-drawer]) .hl-drawer-footer {
657
+ border-block-start: var(--hl-border-width) solid var(--hl-border);
524
658
  }
525
659
 
526
- .hl-drawer .hl-drawer-footer {
527
- border-top: 1px solid var(--hl-border);
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);
528
665
  }
529
666
  }
530
667
  /**
531
668
  * Popover: a `[popover] [data-hl-popover]` surface opened by a
532
- * `<button popovertarget="…">` (or `command="toggle-popover"`). The browser
533
- * owns the top layer, light-dismiss, and Escape with no JavaScript; the
534
- * enhancer only mirrors `aria-expanded`, adds optional hover, and runs the JS
535
- * 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)
536
676
  */
537
677
  @layer components {
538
678
  [data-hl-popover] {
539
679
  margin: 0;
540
- width: -moz-max-content;
541
- width: max-content;
542
- max-width: min(92vw, 22rem);
680
+ inline-size: max-content;
681
+ max-inline-size: min(92vi, 22rem);
543
682
  border: var(--hl-border-width) solid var(--hl-border);
544
683
  border-radius: var(--hl-radius-lg);
545
684
  padding: var(--hl-space-3);
546
685
  background: var(--hl-surface);
547
686
  color: var(--hl-fg);
548
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;
549
693
  }
550
694
 
551
695
  /* Until the `popover` attribute is present (author omitted it and JS hasn't
@@ -554,10 +698,21 @@
554
698
  display: none;
555
699
  }
556
700
 
557
- /* Engines without the Popover API can't promote it to the top layer, so the
558
- 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. */
559
705
  [data-hl-popover]:not(:popover-open) {
560
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
+ }
561
716
  }
562
717
 
563
718
  /* Modern placement: anchor to the invoking control (the popover's implicit
@@ -566,21 +721,32 @@
566
721
  @supports (position-area: block-end) {
567
722
  [data-hl-popover] {
568
723
  position: fixed;
569
- inset-area: block-end;
570
724
  position-area: block-end;
571
725
  position-try-fallbacks: flip-block, flip-inline;
572
- margin-top: var(--hl-space-1);
573
- margin-bottom: var(--hl-space-1);
726
+ margin-block: var(--hl-space-1);
574
727
  }
575
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
+ }
576
735
  }
577
736
  /**
578
737
  * Tooltip: a `[role="tooltip"]` element described by a `[data-hl-tooltip]`
579
- * trigger. With no JavaScript it shows on the trigger's `:hover`/`:focus-visible`
580
- * (the tip must be the trigger's next sibling). When the enhancer runs it marks
581
- * the trigger `data-hl-tooltip-managed` and drives visibility through
582
- * `data-hl-tooltip-open` instead, adding show/hide delays, a grace period, and
583
- * 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
584
750
  */
585
751
  @layer components {
586
752
  [role='tooltip'] {
@@ -588,26 +754,43 @@
588
754
  engines without CSS anchor positioning. */
589
755
  position: absolute;
590
756
  z-index: var(--hl-z-tooltip);
591
- width: -moz-max-content;
592
- width: max-content;
593
- max-width: 32ch;
757
+ inline-size: max-content;
758
+ max-inline-size: 32ch;
594
759
  margin: 0;
595
760
  padding: var(--hl-space-1) var(--hl-space-2);
761
+ border: 0;
596
762
  border-radius: var(--hl-radius-sm);
597
763
  background: var(--hl-fg);
598
764
  color: var(--hl-surface);
599
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;
600
773
  }
601
774
 
602
775
  [role='tooltip'][hidden] {
603
776
  display: none;
604
777
  }
605
778
 
606
- /* No-JS baseline: reveal while the adjacent trigger is hovered or focused.
607
- Suppressed once the enhancer takes over (trigger gains -managed). */
608
- [data-hl-tooltip]:not([data-hl-tooltip-managed]):hover + [role='tooltip'],
609
- [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'] {
610
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
+ }
611
794
  }
612
795
 
613
796
  /* Modern placement: pin above the trigger via the anchor-name the enhancer
@@ -615,20 +798,34 @@
615
798
  @supports (anchor-name: --x) {
616
799
  [role='tooltip'] {
617
800
  position: fixed;
618
- inset-area: block-start;
801
+ inset: auto;
619
802
  position-area: block-start;
620
803
  position-try-fallbacks: flip-block;
621
- margin-top: var(--hl-space-1);
622
- 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;
623
812
  }
624
813
  }
625
814
  }
626
815
  /**
627
816
  * Dropdown menu button: `<div data-hl-dropdown>` wrapping a
628
- * `[data-hl-dropdown-trigger]` button and a `[data-hl-dropdown-menu]` list. The
629
- * enhancer turns the menu into a native `popover` the trigger controls through
630
- * `popovertarget`, so opening, Escape, and light-dismiss need no JavaScript;
631
- * 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">`.
632
829
  */
633
830
  @layer components {
634
831
  [data-hl-dropdown] {
@@ -637,72 +834,132 @@
637
834
 
638
835
  [data-hl-dropdown-menu] {
639
836
  margin: 0;
640
- min-width: 10rem;
837
+ min-inline-size: 10rem;
641
838
  border: var(--hl-border-width) solid var(--hl-border);
642
839
  border-radius: var(--hl-radius-lg);
643
840
  background: var(--hl-surface);
644
841
  box-shadow: var(--hl-overlay-shadow);
645
842
  padding: var(--hl-space-1);
646
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;
647
849
  }
648
850
 
649
- /* Before the menu is promoted to a popover (JS not yet loaded), hide it. */
650
- [data-hl-dropdown-menu]:not([popover]) {
651
- display: none;
652
- }
653
-
851
+ /* Closed state doubles as the exit target. Engines without the Popover API
852
+ drop this rule, so nothing is hidden by accident. */
654
853
  [data-hl-dropdown-menu]:not(:popover-open) {
655
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
+ }
656
864
  }
657
865
 
658
866
  /* Open below the trigger, start-aligned, flipping when cramped. */
659
867
  @supports (position-area: block-end) {
660
868
  [data-hl-dropdown-menu] {
661
869
  position: fixed;
662
- inset-area: block-end span-inline-end;
663
870
  position-area: block-end span-inline-end;
664
871
  position-try-fallbacks: flip-block, flip-inline;
665
- margin-top: var(--hl-space-1);
666
- margin-bottom: var(--hl-space-1);
872
+ margin-block: var(--hl-space-1);
667
873
  }
668
874
  }
669
875
 
670
- [data-hl-dropdown-menu] [role='menuitem'] {
671
- display: block;
672
- 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%;
673
887
  padding: var(--hl-space-2) var(--hl-space-3);
674
888
  border: none;
675
889
  border-radius: var(--hl-radius-sm);
676
890
  background: transparent;
677
- text-align: left;
891
+ text-align: start;
678
892
  cursor: pointer;
679
893
  color: inherit;
680
894
  font: inherit;
681
895
  }
682
896
 
683
- [data-hl-dropdown-menu] [role='menuitem']:hover,
684
- [data-hl-dropdown-menu] [role='menuitem'][data-hl-active] {
897
+ [data-hl-dropdown-menu] [role^='menuitem']:hover {
685
898
  background: var(--hl-surface-2);
686
899
  }
687
900
 
688
- [data-hl-dropdown-menu] [role='menuitem']:focus-visible {
901
+ [data-hl-dropdown-menu] [role^='menuitem']:focus-visible {
689
902
  outline: var(--hl-focus-ring);
690
- 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;
691
930
  }
692
931
 
693
932
  [data-hl-dropdown-menu] [role='separator'] {
694
- height: 1px;
933
+ block-size: var(--hl-border-width);
695
934
  margin: var(--hl-space-1) 0;
696
935
  background: var(--hl-border);
697
936
  border: none;
698
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
+ }
699
948
  }
700
949
  /**
701
- * Menubar / navigation menu: `<ul data-hl-menu role="menubar">` with optional
702
- * single-level submenus (`<ul role="menu" data-hl-menu-submenu>`). The enhancer
703
- * handles roving focus, arrow navigation, and open/close, promoting each
704
- * submenu to a native popover so it renders in the top layer, anchored to its
705
- * trigger with CSS anchor positioning.
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
706
963
  */
707
964
  @layer components {
708
965
  [data-hl-menu] {
@@ -724,11 +981,11 @@
724
981
  position: relative;
725
982
  }
726
983
 
727
- [data-hl-menu] [role='menuitem'] {
984
+ [data-hl-menu] [role^='menuitem'] {
728
985
  display: flex;
729
986
  align-items: center;
730
987
  gap: var(--hl-space-2);
731
- width: 100%;
988
+ inline-size: 100%;
732
989
  padding: var(--hl-space-2) var(--hl-space-3);
733
990
  border: 0;
734
991
  border-radius: var(--hl-radius-md);
@@ -736,43 +993,45 @@
736
993
  color: var(--hl-fg);
737
994
  font: inherit;
738
995
  font-size: var(--hl-text-sm);
739
- text-align: left;
740
- -webkit-text-decoration: none;
996
+ text-align: start;
741
997
  text-decoration: none;
742
998
  white-space: nowrap;
743
999
  cursor: pointer;
744
1000
  }
745
1001
 
746
- [data-hl-menu] [role='menuitem']:hover {
1002
+ [data-hl-menu] [role^='menuitem']:hover,
1003
+ [data-hl-menu] [role^='menuitem'][aria-expanded='true'] {
747
1004
  background: var(--hl-surface-2);
748
1005
  }
749
1006
 
750
- [data-hl-menu] [role='menuitem']:focus-visible {
1007
+ [data-hl-menu] [role^='menuitem']:focus-visible {
751
1008
  outline: var(--hl-focus-ring);
752
- outline-offset: -2px;
1009
+ outline-offset: calc(var(--hl-focus-offset) * -1);
753
1010
  }
754
1011
 
755
- [data-hl-menu] [role='menuitem'][aria-expanded='true'] {
756
- 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;
757
1015
  }
758
1016
 
759
- [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 {
760
1019
  content: '';
761
- width: 0.4rem;
762
- height: 0.4rem;
763
- margin-left: auto;
764
- border-right: 1.5px solid currentcolor;
765
- border-bottom: 1.5px solid currentcolor;
766
- 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;
767
1026
  opacity: 0.6;
768
1027
  }
769
1028
 
770
- [data-hl-menu] [role='menu'] {
1029
+ [data-hl-menu] :is([role='menu'], [data-hl-menu-submenu]) {
771
1030
  position: absolute;
772
- top: calc(100% + var(--hl-space-1));
773
- left: 0;
1031
+ inset-block-start: calc(100% + var(--hl-space-1));
1032
+ inset-inline-start: 0;
774
1033
  z-index: var(--hl-z-dropdown);
775
- min-width: 12rem;
1034
+ min-inline-size: 12rem;
776
1035
  margin: 0;
777
1036
  padding: var(--hl-space-1);
778
1037
  list-style: none;
@@ -780,65 +1039,115 @@
780
1039
  border: var(--hl-border-width) solid var(--hl-border);
781
1040
  border-radius: var(--hl-radius-lg);
782
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;
783
1047
  }
784
1048
 
785
- [data-hl-menu][aria-orientation='vertical'] [role='menu'] {
786
- top: 0;
787
- 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));
788
1052
  }
789
1053
 
790
- [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]) {
791
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
+ }
792
1079
  }
793
1080
 
794
1081
  /* Enhanced path: the submenu is a native popover in the top layer, anchored
795
1082
  to its trigger. The absolute-position rules above stay as the fallback for
796
1083
  engines without the Popover API. */
797
- [data-hl-menu] [role='menu'][popover] {
1084
+ [data-hl-menu] :is([role='menu'], [data-hl-menu-submenu])[popover] {
798
1085
  position: fixed;
799
- top: auto;
800
- right: auto;
801
- bottom: auto;
802
- left: auto;
1086
+ inset: auto;
803
1087
  }
804
1088
 
805
1089
  @supports (position-area: block-end) {
806
- [data-hl-menu] [role='menu'][popover] {
807
- inset-area: block-end span-inline-end;
1090
+ [data-hl-menu] :is([role='menu'], [data-hl-menu-submenu])[popover] {
808
1091
  position-area: block-end span-inline-end;
809
1092
  position-try-fallbacks: flip-block, flip-inline;
810
- margin-top: var(--hl-space-1);
811
- margin-bottom: var(--hl-space-1);
1093
+ margin-block: var(--hl-space-1);
812
1094
  }
813
1095
 
814
- [data-hl-menu][aria-orientation='vertical'] [role='menu'][popover] {
815
- inset-area: inline-end span-block-end;
1096
+ [data-hl-menu][aria-orientation='vertical']
1097
+ :is([role='menu'], [data-hl-menu-submenu])[popover] {
816
1098
  position-area: inline-end span-block-end;
817
1099
  position-try-fallbacks: flip-inline, flip-block;
818
- margin-top: 0;
819
- margin-bottom: 0;
820
- margin-left: var(--hl-space-1);
821
- margin-right: var(--hl-space-1);
1100
+ margin-block: 0;
1101
+ margin-inline: var(--hl-space-1);
822
1102
  }
823
1103
  }
824
1104
 
825
1105
  [data-hl-menu] [role='separator'] {
826
- height: var(--hl-border-width);
1106
+ block-size: var(--hl-border-width);
827
1107
  margin: var(--hl-space-1) 0;
828
1108
  background: var(--hl-border);
829
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
+ }
830
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
+ */
831
1140
  @layer components {
832
1141
  [data-hl-toast-region] {
833
1142
  position: fixed;
834
1143
  z-index: var(--hl-z-toast);
835
- bottom: var(--hl-space-4);
836
- right: var(--hl-space-4);
1144
+ inset-block-end: var(--hl-space-4);
1145
+ inset-inline-end: var(--hl-space-4);
837
1146
  display: flex;
838
1147
  flex-direction: column-reverse;
839
1148
  gap: var(--hl-space-2);
840
1149
  pointer-events: none;
841
- max-width: min(90vw, 24rem);
1150
+ max-inline-size: min(90vi, 24rem);
842
1151
  }
843
1152
 
844
1153
  [data-hl-toast] {
@@ -846,40 +1155,48 @@
846
1155
  display: flex;
847
1156
  align-items: flex-start;
848
1157
  gap: var(--hl-space-3);
849
- border: 1px solid var(--hl-border);
1158
+ border: var(--hl-border-width) solid var(--hl-border);
850
1159
  border-radius: var(--hl-radius-lg);
851
1160
  padding: var(--hl-space-3) var(--hl-space-4);
852
1161
  background: var(--hl-surface);
853
1162
  box-shadow: var(--hl-overlay-shadow);
854
- 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);
855
1166
  }
856
1167
 
857
- [data-hl-toast][data-hl-variant='success'] {
858
- 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
+ }
859
1174
  }
860
1175
 
861
- [data-hl-toast][data-hl-variant='warning'] {
862
- border-left: 3px solid var(--hl-warning);
1176
+ [data-hl-toast][data-hl-intent='success'] {
1177
+ border-inline-start: 3px solid var(--hl-success);
863
1178
  }
864
1179
 
865
- [data-hl-toast][data-hl-variant='danger'] {
866
- border-left: 3px solid var(--hl-danger);
1180
+ [data-hl-toast][data-hl-intent='warning'] {
1181
+ border-inline-start: 3px solid var(--hl-warning);
867
1182
  }
868
1183
 
869
- [data-hl-toast][data-hl-variant='info'] {
870
- 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);
871
1190
  }
872
1191
 
873
1192
  [data-hl-toast-close] {
874
- -webkit-appearance: none;
875
- -moz-appearance: none;
876
- appearance: none;
1193
+ appearance: none;
877
1194
  border: none;
878
1195
  background: transparent;
879
1196
  cursor: pointer;
880
1197
  padding: var(--hl-space-1);
881
1198
  color: var(--hl-fg-muted);
882
- margin-left: auto;
1199
+ margin-inline-start: auto;
883
1200
  flex-shrink: 0;
884
1201
  font: inherit;
885
1202
  }
@@ -890,52 +1207,43 @@
890
1207
 
891
1208
  [data-hl-toast-close]:focus-visible {
892
1209
  outline: var(--hl-focus-ring);
893
- outline-offset: 2px;
1210
+ outline-offset: var(--hl-focus-offset);
894
1211
  border-radius: var(--hl-radius-sm);
895
1212
  }
896
-
897
- @keyframes hl-toast-in {
898
- from {
899
- opacity: 0;
900
- transform: translateY(0.5rem);
901
- }
902
-
903
- to {
904
- opacity: 1;
905
- transform: translateY(0);
906
- }
907
- }
908
-
909
- @media (prefers-reduced-motion: reduce) {
910
- [data-hl-toast] {
911
- animation: none;
912
- }
913
- }
914
1213
  }
915
1214
  /**
916
1215
  * Command palette: `<div data-hl-command>` containing a search input
917
- * (`[data-hl-command-input]`), an empty state (`[data-hl-command-empty]`), and a
918
- * `[data-hl-command-list] role="listbox"` of grouped `[role="option"]` items.
919
- * 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
920
1229
  */
921
1230
  @layer components {
922
1231
  [data-hl-command] {
923
1232
  display: flex;
924
1233
  flex-direction: column;
925
- min-height: 0;
1234
+ min-block-size: 0;
926
1235
  overflow: hidden;
927
1236
  background: var(--hl-overlay);
928
1237
  border-radius: var(--hl-radius-lg);
929
1238
  }
930
1239
 
931
- [data-hl-command-input] {
1240
+ :is(.hl-command-input, [data-hl-command-input]) {
932
1241
  flex: none;
933
- width: 100%;
934
- height: var(--hl-control-height-lg);
935
- padding-left: var(--hl-space-4);
936
- 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);
937
1245
  border: 0;
938
- border-bottom: var(--hl-border-width) solid var(--hl-border);
1246
+ border-block-end: var(--hl-border-width) solid var(--hl-border);
939
1247
  border-radius: 0;
940
1248
  background: transparent;
941
1249
  color: var(--hl-fg);
@@ -943,21 +1251,19 @@
943
1251
  font-size: var(--hl-text-base);
944
1252
  }
945
1253
 
946
- [data-hl-command-input]:focus-visible {
947
- outline: none;
948
- }
949
-
950
- [data-hl-command-input]::-moz-placeholder {
951
- 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);
952
1258
  }
953
1259
 
954
- [data-hl-command-input]::placeholder {
1260
+ :is(.hl-command-input, [data-hl-command-input])::placeholder {
955
1261
  color: var(--hl-fg-subtle);
956
1262
  }
957
1263
 
958
1264
  [data-hl-command-list] {
959
1265
  flex: 1 1 auto;
960
- max-height: 24rem;
1266
+ max-block-size: 24rem;
961
1267
  overflow-y: auto;
962
1268
  padding: var(--hl-space-2);
963
1269
  }
@@ -996,9 +1302,14 @@
996
1302
  color: var(--hl-primary-subtle-fg);
997
1303
  }
998
1304
 
1305
+ [data-hl-command] [role='option'][aria-disabled='true'] {
1306
+ opacity: var(--hl-disabled-opacity);
1307
+ pointer-events: none;
1308
+ }
1309
+
999
1310
  [data-hl-command] [role='option'] svg {
1000
- width: 1.1em;
1001
- height: 1.1em;
1311
+ inline-size: 1.1em;
1312
+ block-size: 1.1em;
1002
1313
  flex: none;
1003
1314
  opacity: 0.7;
1004
1315
  }
@@ -1010,23 +1321,34 @@
1010
1321
  color: var(--hl-fg-muted);
1011
1322
  }
1012
1323
 
1013
- [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] {
1014
1327
  display: none;
1015
1328
  }
1329
+
1330
+ @media (forced-colors: active) {
1331
+ [data-hl-command] [role='option'][aria-selected='true'] {
1332
+ background: Highlight;
1333
+ color: HighlightText;
1334
+ }
1335
+ }
1016
1336
  }
1017
1337
  /* Forms */
1018
1338
  /**
1019
- * 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.
1020
1341
  *
1021
1342
  * Color is driven by a small set of local custom properties so the
1022
- * 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,
1023
1344
  * `data-hl-variant` decides how those values are applied.
1024
1345
  *
1025
1346
  * data-hl-variant: solid (default) | soft | outline | ghost | link
1026
1347
  * data-hl-intent: neutral (default) | primary | danger | success | warning | info
1027
1348
  * data-hl-size: sm | md (default) | lg
1028
- * data-hl-block: stretch to container width
1349
+ * data-hl-block: stretch to the container's inline size
1029
1350
  * data-hl-icon: square, icon-only
1351
+ * data-hl-loading: shows a spinner and blocks interaction
1030
1352
  */
1031
1353
  @layer components {
1032
1354
  .hl-button {
@@ -1046,9 +1368,8 @@
1046
1368
  align-items: center;
1047
1369
  justify-content: center;
1048
1370
  gap: var(--_gap);
1049
- height: var(--_height);
1050
- padding-left: var(--_pad-x);
1051
- padding-right: var(--_pad-x);
1371
+ block-size: var(--_height);
1372
+ padding-inline: var(--_pad-x);
1052
1373
  border: var(--hl-border-width) solid transparent;
1053
1374
  border-radius: var(--hl-radius-md);
1054
1375
  font-family: inherit;
@@ -1056,16 +1377,17 @@
1056
1377
  font-weight: var(--hl-font-medium);
1057
1378
  line-height: 1;
1058
1379
  white-space: nowrap;
1059
- -webkit-text-decoration: none;
1060
1380
  text-decoration: none;
1061
1381
  cursor: pointer;
1062
1382
  -webkit-user-select: none;
1063
- -moz-user-select: none;
1064
1383
  user-select: none;
1065
1384
  background: var(--_solid-bg);
1066
1385
  color: var(--_solid-fg);
1067
1386
  transition:
1068
- 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);
1069
1391
  }
1070
1392
 
1071
1393
  .hl-button:hover {
@@ -1078,14 +1400,14 @@
1078
1400
 
1079
1401
  .hl-button:focus-visible {
1080
1402
  outline: var(--hl-focus-ring);
1081
- outline-offset: 2px;
1403
+ outline-offset: var(--hl-focus-offset);
1082
1404
  }
1083
1405
 
1084
1406
  .hl-button:disabled,
1085
1407
  .hl-button[aria-disabled='true'],
1086
1408
  .hl-button[data-hl-loading] {
1087
1409
  cursor: not-allowed;
1088
- opacity: 0.55;
1410
+ opacity: var(--hl-disabled-opacity);
1089
1411
  }
1090
1412
 
1091
1413
  .hl-button[data-hl-loading] {
@@ -1172,12 +1494,11 @@
1172
1494
  }
1173
1495
 
1174
1496
  .hl-button[data-hl-variant='link'] {
1175
- height: auto;
1497
+ block-size: auto;
1176
1498
  padding: 0;
1177
1499
  background: transparent;
1178
1500
  color: var(--_accent);
1179
1501
  border-color: transparent;
1180
- -webkit-text-decoration: underline;
1181
1502
  text-decoration: underline;
1182
1503
  text-underline-offset: 0.2em;
1183
1504
  }
@@ -1206,34 +1527,34 @@
1206
1527
 
1207
1528
  .hl-button[data-hl-block] {
1208
1529
  display: flex;
1209
- width: 100%;
1530
+ inline-size: 100%;
1210
1531
  }
1211
1532
 
1212
1533
  .hl-button[data-hl-icon] {
1213
- width: var(--_height);
1214
- padding-left: 0;
1215
- padding-right: 0;
1534
+ inline-size: var(--_height);
1535
+ padding-inline: 0;
1216
1536
  }
1217
1537
 
1218
1538
  .hl-button > svg {
1219
- width: 1.1em;
1220
- height: 1.1em;
1539
+ inline-size: 1.1em;
1540
+ block-size: 1.1em;
1221
1541
  flex: none;
1222
1542
  }
1223
1543
 
1224
1544
  .hl-button[data-hl-loading]::before {
1225
1545
  content: '';
1226
- width: 1em;
1227
- height: 1em;
1546
+ inline-size: 1em;
1547
+ block-size: 1em;
1228
1548
  border: 2px solid currentcolor;
1229
- border-top-color: transparent;
1549
+ border-block-start-color: transparent;
1230
1550
  border-radius: var(--hl-radius-full);
1231
1551
  animation: hl-button-spin 0.6s linear infinite;
1232
1552
  }
1233
1553
 
1554
+ /* A static arc still reads as "busy" without continuous motion. */
1234
1555
  @media (prefers-reduced-motion: reduce) {
1235
1556
  .hl-button[data-hl-loading]::before {
1236
- animation-duration: 1.4s;
1557
+ animation: none;
1237
1558
  }
1238
1559
  }
1239
1560
 
@@ -1252,26 +1573,45 @@
1252
1573
  }
1253
1574
 
1254
1575
  .hl-button-group > .hl-button:not(:first-child) {
1255
- margin-left: calc(var(--hl-border-width) * -1);
1576
+ margin-inline-start: calc(var(--hl-border-width) * -1);
1256
1577
  }
1257
1578
 
1258
1579
  .hl-button-group > .hl-button:first-child {
1259
- border-top-left-radius: var(--hl-radius-md);
1260
- 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);
1261
1582
  }
1262
1583
 
1263
1584
  .hl-button-group > .hl-button:last-child {
1264
- border-top-right-radius: var(--hl-radius-md);
1265
- 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);
1266
1587
  }
1267
1588
 
1268
1589
  .hl-button-group > .hl-button:hover,
1269
1590
  .hl-button-group > .hl-button:focus-visible {
1270
1591
  z-index: 1;
1271
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
+ }
1272
1612
  }
1273
1613
  /**
1274
- * Text input: `<input class="hl-input">`.
1614
+ * Text input: `<input class="hl-input">`. Pure CSS; there is no enhancer.
1275
1615
  * data-hl-size: sm | md (default) | lg
1276
1616
  * data-hl-invalid: error styling (pair with aria-invalid)
1277
1617
  */
@@ -1282,10 +1622,9 @@
1282
1622
  --_font: var(--hl-text-sm);
1283
1623
 
1284
1624
  display: block;
1285
- width: 100%;
1286
- height: var(--_height);
1287
- padding-left: var(--_pad-x);
1288
- padding-right: var(--_pad-x);
1625
+ inline-size: 100%;
1626
+ block-size: var(--_height);
1627
+ padding-inline: var(--_pad-x);
1289
1628
  border: var(--hl-border-width) solid var(--hl-border-strong);
1290
1629
  border-radius: var(--hl-radius-md);
1291
1630
  background: var(--hl-surface);
@@ -1294,30 +1633,27 @@
1294
1633
  font-size: var(--_font);
1295
1634
  line-height: var(--hl-leading-normal);
1296
1635
  transition:
1297
- border-color var(--hl-duration-fast) var(--hl-ease-standard), box-shadow var(--hl-duration-fast) var(--hl-ease-standard);
1298
- }
1299
-
1300
- .hl-input::-moz-placeholder {
1301
- 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);
1302
1638
  }
1303
1639
 
1304
1640
  .hl-input::placeholder {
1305
1641
  color: var(--hl-fg-subtle);
1306
1642
  }
1307
1643
 
1308
- .hl-input:hover:not(:disabled):not(:focus) {
1644
+ .hl-input:hover:not(:disabled, :focus) {
1309
1645
  border-color: var(--hl-fg-subtle);
1310
1646
  }
1311
1647
 
1312
1648
  .hl-input:focus-visible {
1313
1649
  outline: none;
1314
1650
  border-color: var(--hl-ring);
1315
- box-shadow: 0 0 0 3px color-mix(in oklab, var(--hl-ring) 30%, transparent);
1651
+ box-shadow: var(--hl-focus-shadow);
1316
1652
  }
1317
1653
 
1318
1654
  .hl-input:disabled {
1319
1655
  cursor: not-allowed;
1320
- opacity: 0.6;
1656
+ opacity: var(--hl-disabled-opacity);
1321
1657
  background: var(--hl-surface-2);
1322
1658
  }
1323
1659
 
@@ -1346,25 +1682,34 @@
1346
1682
  }
1347
1683
 
1348
1684
  .hl-input[type='file'] {
1349
- height: auto;
1350
- padding-top: var(--hl-space-2);
1351
- padding-bottom: var(--hl-space-2);
1685
+ block-size: auto;
1686
+ padding-block: var(--hl-space-2);
1352
1687
  }
1353
1688
 
1354
1689
  .hl-input[type='color'] {
1355
- width: var(--_height);
1690
+ inline-size: var(--_height);
1356
1691
  padding: var(--hl-space-1);
1357
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
+ }
1358
1701
  }
1359
1702
  /**
1360
- * Multi-line text input: `<textarea class="hl-textarea">`.
1361
- * 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
1362
1707
  */
1363
1708
  @layer components {
1364
1709
  .hl-textarea {
1365
1710
  display: block;
1366
- width: 100%;
1367
- min-height: calc(var(--hl-control-height-md) * 2);
1711
+ inline-size: 100%;
1712
+ min-block-size: calc(var(--hl-control-height-md) * 2);
1368
1713
  padding: var(--hl-space-2) var(--hl-space-3);
1369
1714
  border: var(--hl-border-width) solid var(--hl-border-strong);
1370
1715
  border-radius: var(--hl-radius-md);
@@ -1375,30 +1720,27 @@
1375
1720
  line-height: var(--hl-leading-normal);
1376
1721
  resize: vertical;
1377
1722
  transition:
1378
- border-color var(--hl-duration-fast) var(--hl-ease-standard), box-shadow var(--hl-duration-fast) var(--hl-ease-standard);
1379
- }
1380
-
1381
- .hl-textarea::-moz-placeholder {
1382
- 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);
1383
1725
  }
1384
1726
 
1385
1727
  .hl-textarea::placeholder {
1386
1728
  color: var(--hl-fg-subtle);
1387
1729
  }
1388
1730
 
1389
- .hl-textarea:hover:not(:disabled):not(:focus) {
1731
+ .hl-textarea:hover:not(:disabled, :focus) {
1390
1732
  border-color: var(--hl-fg-subtle);
1391
1733
  }
1392
1734
 
1393
1735
  .hl-textarea:focus-visible {
1394
1736
  outline: none;
1395
1737
  border-color: var(--hl-ring);
1396
- box-shadow: 0 0 0 3px color-mix(in oklab, var(--hl-ring) 30%, transparent);
1738
+ box-shadow: var(--hl-focus-shadow);
1397
1739
  }
1398
1740
 
1399
1741
  .hl-textarea:disabled {
1400
1742
  cursor: not-allowed;
1401
- opacity: 0.6;
1743
+ opacity: var(--hl-disabled-opacity);
1402
1744
  background: var(--hl-surface-2);
1403
1745
  }
1404
1746
 
@@ -1412,11 +1754,26 @@
1412
1754
  border-color: var(--hl-danger);
1413
1755
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--hl-danger) 30%, transparent);
1414
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
+ }
1415
1772
  }
1416
1773
  /**
1417
1774
  * Native select: `<span class="hl-select-wrapper"><select class="hl-select">`.
1418
1775
  * The wrapper draws a custom caret while the native control keeps full
1419
- * keyboard/mobile behavior.
1776
+ * keyboard and mobile behavior. Pure CSS; there is no enhancer.
1420
1777
  * data-hl-size: sm | md (default) | lg
1421
1778
  * data-hl-invalid: error styling (pair with aria-invalid)
1422
1779
  */
@@ -1424,19 +1781,22 @@
1424
1781
  .hl-select-wrapper {
1425
1782
  position: relative;
1426
1783
  display: inline-flex;
1427
- width: 100%;
1784
+ inline-size: 100%;
1428
1785
  }
1429
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. */
1430
1789
  .hl-select-wrapper::after {
1431
1790
  content: '';
1432
1791
  position: absolute;
1433
- top: 50%;
1434
- right: var(--hl-space-3);
1435
- width: 0.5rem;
1436
- height: 0.5rem;
1437
- border-right: 2px solid var(--hl-fg-muted);
1438
- border-bottom: 2px solid var(--hl-fg-muted);
1439
- 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;
1440
1800
  pointer-events: none;
1441
1801
  }
1442
1802
 
@@ -1444,15 +1804,10 @@
1444
1804
  --_height: var(--hl-control-height-md);
1445
1805
  --_font: var(--hl-text-sm);
1446
1806
 
1447
- -webkit-appearance: none;
1448
-
1449
- -moz-appearance: none;
1450
-
1451
- appearance: none;
1452
- width: 100%;
1453
- height: var(--_height);
1454
- padding-left: var(--hl-space-3);
1455
- 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);
1456
1811
  border: var(--hl-border-width) solid var(--hl-border-strong);
1457
1812
  border-radius: var(--hl-radius-md);
1458
1813
  background: var(--hl-surface);
@@ -1462,22 +1817,23 @@
1462
1817
  line-height: var(--hl-leading-normal);
1463
1818
  cursor: pointer;
1464
1819
  transition:
1465
- 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);
1466
1822
  }
1467
1823
 
1468
- .hl-select:hover:not(:disabled):not(:focus) {
1824
+ .hl-select:hover:not(:disabled, :focus) {
1469
1825
  border-color: var(--hl-fg-subtle);
1470
1826
  }
1471
1827
 
1472
1828
  .hl-select:focus-visible {
1473
1829
  outline: none;
1474
1830
  border-color: var(--hl-ring);
1475
- box-shadow: 0 0 0 3px color-mix(in oklab, var(--hl-ring) 30%, transparent);
1831
+ box-shadow: var(--hl-focus-shadow);
1476
1832
  }
1477
1833
 
1478
1834
  .hl-select:disabled {
1479
1835
  cursor: not-allowed;
1480
- opacity: 0.6;
1836
+ opacity: var(--hl-disabled-opacity);
1481
1837
  background: var(--hl-surface-2);
1482
1838
  }
1483
1839
 
@@ -1497,11 +1853,18 @@
1497
1853
  --_height: var(--hl-control-height-lg);
1498
1854
  --_font: var(--hl-text-base);
1499
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
+ }
1500
1863
  }
1501
1864
  /**
1502
- * Checkbox: `<label class="hl-checkbox"><input type="checkbox"><span>…</span></label>`.
1503
- * The native input is restyled (appearance:none) with a CSS checkmark, keeping
1504
- * 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.
1505
1868
  */
1506
1869
  @layer components {
1507
1870
  .hl-checkbox {
@@ -1514,34 +1877,33 @@
1514
1877
  }
1515
1878
 
1516
1879
  .hl-checkbox > input[type='checkbox'] {
1517
- -webkit-appearance: none;
1518
- -moz-appearance: none;
1519
- appearance: none;
1880
+ appearance: none;
1520
1881
  flex: none;
1521
- width: 1.15rem;
1522
- height: 1.15rem;
1882
+ inline-size: 1.15rem;
1883
+ block-size: 1.15rem;
1523
1884
  margin: 0;
1524
1885
  border: var(--hl-border-width-2) solid var(--hl-border-strong);
1525
1886
  border-radius: var(--hl-radius-sm);
1526
1887
  background: var(--hl-surface);
1527
1888
  display: grid;
1528
- align-content: center;
1529
- justify-content: center;
1530
1889
  place-content: center;
1531
1890
  cursor: pointer;
1532
1891
  transition:
1533
- 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);
1534
1894
  }
1535
1895
 
1896
+ /* The mark is a rotated L drawn with two borders; direction-neutral. */
1536
1897
  .hl-checkbox > input[type='checkbox']::after {
1537
1898
  content: '';
1538
- width: 0.34rem;
1539
- height: 0.62rem;
1899
+ inline-size: 0.34rem;
1900
+ block-size: 0.62rem;
1540
1901
  border: solid var(--hl-primary-fg);
1541
1902
  border-width: 0 2px 2px 0;
1542
- margin-top: -2px;
1543
- transform: rotate(45deg) scale(0);
1544
- 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);
1545
1907
  }
1546
1908
 
1547
1909
  .hl-checkbox > input[type='checkbox']:checked,
@@ -1551,35 +1913,48 @@
1551
1913
  }
1552
1914
 
1553
1915
  .hl-checkbox > input[type='checkbox']:checked::after {
1554
- transform: rotate(45deg) scale(1);
1916
+ scale: 1;
1555
1917
  }
1556
1918
 
1557
1919
  .hl-checkbox > input[type='checkbox']:indeterminate::after {
1558
- width: 0.6rem;
1559
- height: 0;
1920
+ inline-size: 0.6rem;
1921
+ block-size: 0;
1560
1922
  margin: 0;
1561
1923
  border-width: 0 0 2px;
1562
- transform: none;
1924
+ rotate: none;
1925
+ scale: 1;
1563
1926
  }
1564
1927
 
1565
1928
  .hl-checkbox > input[type='checkbox']:focus-visible {
1566
1929
  outline: var(--hl-focus-ring);
1567
- outline-offset: 2px;
1930
+ outline-offset: var(--hl-focus-offset);
1568
1931
  }
1569
1932
 
1570
1933
  .hl-checkbox > input[type='checkbox']:disabled {
1571
1934
  cursor: not-allowed;
1572
- opacity: 0.55;
1935
+ opacity: var(--hl-disabled-opacity);
1573
1936
  }
1574
1937
 
1575
1938
  .hl-checkbox:has(> input:disabled) {
1576
1939
  cursor: not-allowed;
1577
1940
  color: var(--hl-fg-subtle);
1578
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
+ }
1579
1951
  }
1580
1952
  /**
1581
- * Radio: `<label class="hl-radio"><input type="radio"><span>…</span></label>`,
1582
- * 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)
1583
1958
  */
1584
1959
  @layer components {
1585
1960
  .hl-radio-group {
@@ -1604,19 +1979,15 @@
1604
1979
  }
1605
1980
 
1606
1981
  .hl-radio > input[type='radio'] {
1607
- -webkit-appearance: none;
1608
- -moz-appearance: none;
1609
- appearance: none;
1982
+ appearance: none;
1610
1983
  flex: none;
1611
- width: 1.15rem;
1612
- height: 1.15rem;
1984
+ inline-size: 1.15rem;
1985
+ block-size: 1.15rem;
1613
1986
  margin: 0;
1614
1987
  border: var(--hl-border-width-2) solid var(--hl-border-strong);
1615
1988
  border-radius: var(--hl-radius-full);
1616
1989
  background: var(--hl-surface);
1617
1990
  display: grid;
1618
- align-content: center;
1619
- justify-content: center;
1620
1991
  place-content: center;
1621
1992
  cursor: pointer;
1622
1993
  transition: border-color var(--hl-duration-fast) var(--hl-ease-standard);
@@ -1624,12 +1995,12 @@
1624
1995
 
1625
1996
  .hl-radio > input[type='radio']::after {
1626
1997
  content: '';
1627
- width: 0.6rem;
1628
- height: 0.6rem;
1998
+ inline-size: 0.6rem;
1999
+ block-size: 0.6rem;
1629
2000
  border-radius: var(--hl-radius-full);
1630
2001
  background: var(--hl-primary);
1631
- transform: scale(0);
1632
- transition: transform var(--hl-duration-fast) var(--hl-ease-emphasized);
2002
+ scale: 0;
2003
+ transition: scale var(--hl-duration-fast) var(--hl-ease-emphasized);
1633
2004
  }
1634
2005
 
1635
2006
  .hl-radio > input[type='radio']:checked {
@@ -1637,60 +2008,82 @@
1637
2008
  }
1638
2009
 
1639
2010
  .hl-radio > input[type='radio']:checked::after {
1640
- transform: scale(1);
2011
+ scale: 1;
1641
2012
  }
1642
2013
 
1643
2014
  .hl-radio > input[type='radio']:focus-visible {
1644
2015
  outline: var(--hl-focus-ring);
1645
- outline-offset: 2px;
2016
+ outline-offset: var(--hl-focus-offset);
1646
2017
  }
1647
2018
 
1648
2019
  .hl-radio > input[type='radio']:disabled {
1649
2020
  cursor: not-allowed;
1650
- opacity: 0.55;
2021
+ opacity: var(--hl-disabled-opacity);
1651
2022
  }
1652
2023
 
1653
2024
  .hl-radio:has(> input:disabled) {
1654
2025
  cursor: not-allowed;
1655
2026
  color: var(--hl-fg-subtle);
1656
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
+ }
1657
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
+ */
1658
2043
  @layer components {
1659
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
+
1660
2051
  display: inline-flex;
1661
2052
  align-items: center;
1662
2053
  gap: var(--hl-space-2);
1663
2054
  }
1664
2055
 
1665
2056
  [data-hl-switch] input[type='checkbox'] {
1666
- -webkit-appearance: none;
1667
- -moz-appearance: none;
1668
- appearance: none;
1669
- width: 2.25rem;
1670
- height: 1.25rem;
1671
- border-radius: 1.25rem;
1672
- background: var(--hl-border-strong);
2057
+ appearance: none;
1673
2058
  position: relative;
1674
- 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);
1675
2064
  transition: background-color var(--hl-duration-fast) var(--hl-ease-standard);
1676
2065
  }
1677
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. */
1678
2069
  [data-hl-switch] input[type='checkbox']::after {
1679
2070
  content: '';
1680
2071
  position: absolute;
1681
- top: 2px;
1682
- right: auto;
1683
- bottom: auto;
1684
- left: 2px;
1685
- width: calc(1.25rem - 4px);
1686
- height: calc(1.25rem - 4px);
1687
- 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);
1688
2077
  background: var(--hl-surface);
1689
- transition: transform var(--hl-duration-fast) var(--hl-ease-standard);
2078
+ transition: translate var(--hl-duration-fast) var(--hl-ease-standard);
1690
2079
  }
1691
2080
 
1692
2081
  [data-hl-switch] input[type='checkbox']:checked::after {
1693
- 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;
1694
2087
  }
1695
2088
 
1696
2089
  [data-hl-switch] input[type='checkbox']:checked {
@@ -1699,10 +2092,11 @@
1699
2092
 
1700
2093
  [data-hl-switch] input[type='checkbox']:focus-visible {
1701
2094
  outline: var(--hl-focus-ring);
2095
+ outline-offset: var(--hl-focus-offset);
1702
2096
  }
1703
2097
 
1704
2098
  [data-hl-switch] input[type='checkbox']:disabled {
1705
- opacity: 0.5;
2099
+ opacity: var(--hl-disabled-opacity);
1706
2100
  cursor: not-allowed;
1707
2101
  }
1708
2102
 
@@ -1710,11 +2104,35 @@
1710
2104
  opacity: 0.7;
1711
2105
  cursor: not-allowed;
1712
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
+ }
1713
2129
  }
1714
2130
  /**
1715
2131
  * Field, accessible form-control layout: `.hl-field` stacks a `.hl-label`,
1716
2132
  * the control, `.hl-help`, and `.hl-error`. `.hl-fieldset` + `.hl-legend`
1717
- * 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
1718
2136
  */
1719
2137
  @layer components {
1720
2138
  .hl-field {
@@ -1731,7 +2149,7 @@
1731
2149
 
1732
2150
  .hl-label[data-hl-required]::after {
1733
2151
  content: '*';
1734
- margin-left: var(--hl-space-1);
2152
+ margin-inline-start: var(--hl-space-1);
1735
2153
  color: var(--hl-danger);
1736
2154
  }
1737
2155
 
@@ -1763,8 +2181,7 @@
1763
2181
  }
1764
2182
 
1765
2183
  .hl-legend {
1766
- padding-left: var(--hl-space-2);
1767
- padding-right: var(--hl-space-2);
2184
+ padding-inline: var(--hl-space-2);
1768
2185
  font-size: var(--hl-text-sm);
1769
2186
  font-weight: var(--hl-font-semibold);
1770
2187
  color: var(--hl-fg);
@@ -1772,8 +2189,14 @@
1772
2189
  }
1773
2190
  /**
1774
2191
  * Combobox: `<div data-hl-combobox>` wrapping an `<input>` and a
1775
- * `<ul role="listbox">` of `<li role="option">`. The enhancer toggles the
1776
- * 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
1777
2200
  */
1778
2201
  @layer components {
1779
2202
  [data-hl-combobox] {
@@ -1783,11 +2206,10 @@
1783
2206
 
1784
2207
  [data-hl-combobox] [role='listbox'] {
1785
2208
  position: absolute;
1786
- top: calc(100% + var(--hl-space-1));
1787
- left: 0;
1788
- right: 0;
2209
+ inset-block-start: calc(100% + var(--hl-space-1));
2210
+ inset-inline: 0;
1789
2211
  z-index: var(--hl-z-dropdown);
1790
- max-height: 16rem;
2212
+ max-block-size: 16rem;
1791
2213
  margin: 0;
1792
2214
  padding: var(--hl-space-1);
1793
2215
  overflow-y: auto;
@@ -1803,16 +2225,11 @@
1803
2225
  @supports (anchor-name: --x) {
1804
2226
  [data-hl-combobox] [role='listbox'] {
1805
2227
  position: fixed;
1806
- top: auto;
1807
- right: auto;
1808
- bottom: auto;
1809
- left: auto;
1810
- width: anchor-size(width);
1811
- inset-area: block-end;
2228
+ inset: auto;
2229
+ inline-size: anchor-size(width);
1812
2230
  position-area: block-end;
1813
2231
  position-try-fallbacks: flip-block;
1814
- margin-top: var(--hl-space-1);
1815
- margin-bottom: var(--hl-space-1);
2232
+ margin-block: var(--hl-space-1);
1816
2233
  }
1817
2234
  }
1818
2235
 
@@ -1820,6 +2237,23 @@
1820
2237
  display: none;
1821
2238
  }
1822
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
+
1823
2257
  [data-hl-combobox] [role='option'] {
1824
2258
  display: flex;
1825
2259
  align-items: center;
@@ -1842,15 +2276,27 @@
1842
2276
  }
1843
2277
 
1844
2278
  [data-hl-combobox] [role='option'][aria-disabled='true'] {
1845
- opacity: 0.5;
2279
+ opacity: var(--hl-disabled-opacity);
1846
2280
  pointer-events: none;
1847
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
+ }
1848
2293
  }
1849
2294
  /**
1850
2295
  * Segmented control: `<div class="hl-segmented" role="radiogroup">` of
1851
- * `<label class="hl-segmented-item"><input type="radio">…</label>` segments.
2296
+ * `<label class="hl-segmented-item"><input type="radio">...</label>` segments.
1852
2297
  * Radio inputs give free keyboard navigation; the checked segment is raised.
1853
- * 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.
1854
2300
  * data-hl-size: sm | md (default) | lg
1855
2301
  */
1856
2302
  @layer components {
@@ -1881,18 +2327,15 @@
1881
2327
  white-space: nowrap;
1882
2328
  cursor: pointer;
1883
2329
  -webkit-user-select: none;
1884
- -moz-user-select: none;
1885
2330
  user-select: none;
1886
2331
  transition:
1887
- 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);
1888
2334
  }
1889
2335
 
1890
2336
  .hl-segmented-item > input {
1891
2337
  position: absolute;
1892
- top: 0;
1893
- right: 0;
1894
- bottom: 0;
1895
- left: 0;
2338
+ inset: 0;
1896
2339
  margin: 0;
1897
2340
  opacity: 0;
1898
2341
  cursor: pointer;
@@ -1912,12 +2355,12 @@
1912
2355
  .hl-segmented-item:has(input:focus-visible),
1913
2356
  .hl-segmented-item[aria-pressed]:focus-visible {
1914
2357
  outline: var(--hl-focus-ring);
1915
- outline-offset: 2px;
2358
+ outline-offset: var(--hl-focus-offset);
1916
2359
  }
1917
2360
 
1918
2361
  .hl-segmented-item:has(input:disabled),
1919
2362
  .hl-segmented-item:disabled {
1920
- opacity: 0.5;
2363
+ opacity: var(--hl-disabled-opacity);
1921
2364
  cursor: not-allowed;
1922
2365
  }
1923
2366
 
@@ -1930,64 +2373,72 @@
1930
2373
  padding: var(--hl-space-2) var(--hl-space-4);
1931
2374
  font-size: var(--hl-text-base);
1932
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
+ }
1933
2389
  }
1934
2390
  /**
1935
2391
  * Slider: native `<input type="range" class="hl-slider">`. Restyled track and
1936
- * 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.
1937
2394
  */
1938
2395
  @layer components {
1939
2396
  .hl-slider {
1940
2397
  --_track: 0.375rem;
1941
2398
  --_thumb: 1.15rem;
1942
2399
 
1943
- -webkit-appearance: none;
1944
-
1945
- -moz-appearance: none;
1946
-
1947
- appearance: none;
1948
- width: 100%;
1949
- height: 1.15rem;
1950
- height: var(--_thumb);
2400
+ appearance: none;
2401
+ inline-size: 100%;
2402
+ block-size: var(--_thumb);
1951
2403
  margin: 0;
1952
2404
  background: transparent;
1953
2405
  cursor: pointer;
1954
2406
  }
1955
2407
 
1956
2408
  .hl-slider::-webkit-slider-runnable-track {
1957
- height: var(--_track);
2409
+ block-size: var(--_track);
1958
2410
  border-radius: var(--hl-radius-full);
1959
2411
  background: var(--hl-surface-3);
1960
2412
  }
1961
2413
 
1962
2414
  .hl-slider::-moz-range-track {
1963
- height: var(--_track);
2415
+ block-size: var(--_track);
1964
2416
  border-radius: var(--hl-radius-full);
1965
2417
  background: var(--hl-surface-3);
1966
2418
  }
1967
2419
 
1968
2420
  .hl-slider::-moz-range-progress {
1969
- height: var(--_track);
2421
+ block-size: var(--_track);
1970
2422
  border-radius: var(--hl-radius-full);
1971
2423
  background: var(--hl-primary);
1972
2424
  }
1973
2425
 
1974
2426
  .hl-slider::-webkit-slider-thumb {
1975
- -webkit-appearance: none;
1976
- appearance: none;
1977
- width: var(--_thumb);
1978
- height: var(--_thumb);
1979
- 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);
1980
2431
  border: 2px solid var(--hl-surface);
1981
2432
  border-radius: var(--hl-radius-full);
1982
2433
  background: var(--hl-primary);
1983
2434
  box-shadow: var(--hl-shadow-sm);
1984
- -webkit-transition: transform var(--hl-duration-fast) var(--hl-ease-standard);
1985
- 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);
1986
2437
  }
1987
2438
 
1988
2439
  .hl-slider::-moz-range-thumb {
1989
- width: var(--_thumb);
1990
- height: var(--_thumb);
2440
+ inline-size: var(--_thumb);
2441
+ block-size: var(--_thumb);
1991
2442
  border: 2px solid var(--hl-surface);
1992
2443
  border-radius: var(--hl-radius-full);
1993
2444
  background: var(--hl-primary);
@@ -1995,7 +2446,7 @@
1995
2446
  }
1996
2447
 
1997
2448
  .hl-slider:active::-webkit-slider-thumb {
1998
- transform: scale(1.1);
2449
+ scale: 1.1;
1999
2450
  }
2000
2451
 
2001
2452
  .hl-slider:focus-visible {
@@ -2003,22 +2454,31 @@
2003
2454
  }
2004
2455
 
2005
2456
  .hl-slider:focus-visible::-webkit-slider-thumb {
2006
- box-shadow: 0 0 0 4px color-mix(in oklab, var(--hl-ring) 35%, transparent);
2457
+ box-shadow: var(--hl-focus-shadow);
2007
2458
  }
2008
2459
 
2009
2460
  .hl-slider:focus-visible::-moz-range-thumb {
2010
- box-shadow: 0 0 0 4px color-mix(in oklab, var(--hl-ring) 35%, transparent);
2461
+ box-shadow: var(--hl-focus-shadow);
2011
2462
  }
2012
2463
 
2013
2464
  .hl-slider:disabled {
2014
2465
  cursor: not-allowed;
2015
- 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
+ }
2016
2475
  }
2017
2476
  }
2018
2477
  /* Feedback & data display */
2019
2478
  /**
2020
- * Alert: `<div class="hl-alert" role="alert" data-hl-intent="…">` with an
2021
- * 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.
2022
2482
  * data-hl-intent: info (default) | success | warning | danger | neutral
2023
2483
  */
2024
2484
  @layer components {
@@ -2031,7 +2491,7 @@
2031
2491
  gap: var(--hl-space-3);
2032
2492
  padding: var(--hl-space-3) var(--hl-space-4);
2033
2493
  border: var(--hl-border-width) solid transparent;
2034
- border-left: 3px solid var(--_accent);
2494
+ border-inline-start: 3px solid var(--_accent);
2035
2495
  border-radius: var(--hl-radius-md);
2036
2496
  background: var(--_bg);
2037
2497
  color: var(--_fg);
@@ -2065,9 +2525,9 @@
2065
2525
 
2066
2526
  .hl-alert > svg:first-child {
2067
2527
  flex: none;
2068
- width: 1.25rem;
2069
- height: 1.25rem;
2070
- margin-top: 0.1rem;
2528
+ inline-size: 1.25rem;
2529
+ block-size: 1.25rem;
2530
+ margin-block-start: 0.1rem;
2071
2531
  color: var(--_accent);
2072
2532
  }
2073
2533
 
@@ -2075,7 +2535,7 @@
2075
2535
  display: flex;
2076
2536
  flex-direction: column;
2077
2537
  gap: var(--hl-space-1);
2078
- min-width: 0;
2538
+ min-inline-size: 0;
2079
2539
  }
2080
2540
 
2081
2541
  .hl-alert-title {
@@ -2087,9 +2547,17 @@
2087
2547
  .hl-alert p {
2088
2548
  margin: 0;
2089
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
+ }
2090
2557
  }
2091
2558
  /**
2092
- * 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.
2093
2561
  * data-hl-intent: neutral (default) | primary | danger | success | warning | info
2094
2562
  * data-hl-variant: soft (default) | solid | outline
2095
2563
  * data-hl-size: sm | md (default)
@@ -2171,10 +2639,18 @@
2171
2639
  padding: 0 var(--hl-space-1-5);
2172
2640
  font-size: 0.6875rem;
2173
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
+ }
2174
2649
  }
2175
2650
  /**
2176
2651
  * Card: `<div class="hl-card">` with optional `.hl-card-header`,
2177
2652
  * `.hl-card-body`, `.hl-card-footer`, `.hl-card-title`, `.hl-card-description`.
2653
+ * Pure CSS; there is no enhancer.
2178
2654
  * data-hl-interactive: hover/active elevation for clickable cards
2179
2655
  */
2180
2656
  @layer components {
@@ -2193,7 +2669,7 @@
2193
2669
  flex-direction: column;
2194
2670
  gap: var(--hl-space-1);
2195
2671
  padding: var(--hl-space-4) var(--hl-space-5);
2196
- border-bottom: var(--hl-border-width) solid var(--hl-border);
2672
+ border-block-end: var(--hl-border-width) solid var(--hl-border);
2197
2673
  }
2198
2674
 
2199
2675
  .hl-card-body {
@@ -2206,7 +2682,7 @@
2206
2682
  align-items: center;
2207
2683
  gap: var(--hl-space-2);
2208
2684
  padding: var(--hl-space-4) var(--hl-space-5);
2209
- border-top: var(--hl-border-width) solid var(--hl-border);
2685
+ border-block-start: var(--hl-border-width) solid var(--hl-border);
2210
2686
  background: var(--hl-surface-2);
2211
2687
  }
2212
2688
 
@@ -2226,7 +2702,9 @@
2226
2702
  .hl-card[data-hl-interactive] {
2227
2703
  cursor: pointer;
2228
2704
  transition:
2229
- 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);
2230
2708
  }
2231
2709
 
2232
2710
  .hl-card[data-hl-interactive]:hover {
@@ -2236,16 +2714,17 @@
2236
2714
 
2237
2715
  .hl-card[data-hl-interactive]:focus-within {
2238
2716
  outline: var(--hl-focus-ring);
2239
- outline-offset: 2px;
2717
+ outline-offset: var(--hl-focus-offset);
2240
2718
  }
2241
2719
 
2242
2720
  .hl-card[data-hl-interactive]:active {
2243
- transform: translateY(1px);
2721
+ translate: 0 1px;
2244
2722
  }
2245
2723
  }
2246
2724
  /**
2247
2725
  * Avatar: `<span class="hl-avatar">` containing an `<img>` or fallback
2248
- * 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.
2249
2728
  * data-hl-size: xs | sm | md (default) | lg | xl
2250
2729
  * data-hl-shape: square
2251
2730
  */
@@ -2255,25 +2734,19 @@
2255
2734
 
2256
2735
  position: relative;
2257
2736
  display: inline-grid;
2258
- align-items: center;
2259
- justify-items: center;
2260
2737
  place-items: center;
2261
2738
  flex: none;
2262
- width: 2.5rem;
2263
- width: var(--_size);
2264
- height: 2.5rem;
2265
- height: var(--_size);
2739
+ inline-size: var(--_size);
2740
+ block-size: var(--_size);
2266
2741
  border-radius: var(--hl-radius-full);
2267
2742
  overflow: hidden;
2268
2743
  background: var(--hl-surface-3);
2269
2744
  color: var(--hl-fg-muted);
2270
- font-size: calc(2.5rem * 0.4);
2271
2745
  font-size: calc(var(--_size) * 0.4);
2272
2746
  font-weight: var(--hl-font-medium);
2273
2747
  line-height: 1;
2274
2748
  text-transform: uppercase;
2275
2749
  -webkit-user-select: none;
2276
- -moz-user-select: none;
2277
2750
  user-select: none;
2278
2751
  }
2279
2752
 
@@ -2282,10 +2755,9 @@
2282
2755
  }
2283
2756
 
2284
2757
  .hl-avatar > img {
2285
- width: 100%;
2286
- height: 100%;
2287
- -o-object-fit: cover;
2288
- object-fit: cover;
2758
+ inline-size: 100%;
2759
+ block-size: 100%;
2760
+ object-fit: cover;
2289
2761
  }
2290
2762
 
2291
2763
  .hl-avatar[data-hl-size='xs'] {
@@ -2314,12 +2786,12 @@
2314
2786
  }
2315
2787
 
2316
2788
  .hl-avatar-group > .hl-avatar:not(:first-child) {
2317
- margin-left: -0.6rem;
2789
+ margin-inline-start: -0.6rem;
2318
2790
  }
2319
2791
  }
2320
2792
  /**
2321
2793
  * Progress: native `<progress class="hl-progress" value max>`. Omit `value`
2322
- * for an indeterminate bar.
2794
+ * for an indeterminate bar. Pure CSS; there is no enhancer.
2323
2795
  * data-hl-intent: primary (default) | success | warning | danger | info
2324
2796
  * data-hl-size: sm | md (default) | lg
2325
2797
  */
@@ -2328,14 +2800,9 @@
2328
2800
  --_color: var(--hl-primary);
2329
2801
  --_height: 0.5rem;
2330
2802
 
2331
- -webkit-appearance: none;
2332
-
2333
- -moz-appearance: none;
2334
-
2335
- appearance: none;
2336
- width: 100%;
2337
- height: 0.5rem;
2338
- height: var(--_height);
2803
+ appearance: none;
2804
+ inline-size: 100%;
2805
+ block-size: var(--_height);
2339
2806
  border: 0;
2340
2807
  border-radius: var(--hl-radius-full);
2341
2808
  overflow: hidden;
@@ -2374,8 +2841,8 @@
2374
2841
  .hl-progress::-webkit-progress-value {
2375
2842
  background: var(--_color);
2376
2843
  border-radius: var(--hl-radius-full);
2377
- -webkit-transition: width var(--hl-duration-base) var(--hl-ease-standard);
2378
- 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);
2379
2846
  }
2380
2847
 
2381
2848
  .hl-progress::-moz-progress-bar {
@@ -2405,15 +2872,32 @@
2405
2872
  }
2406
2873
  }
2407
2874
 
2875
+ /* A static partial bar still signals "in progress" without motion. */
2408
2876
  @media (prefers-reduced-motion: reduce) {
2409
2877
  .hl-progress:indeterminate {
2410
- 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;
2411
2894
  }
2412
2895
  }
2413
2896
  }
2414
2897
  /**
2415
2898
  * Spinner: `<span class="hl-spinner" role="status" aria-label="Loading">`.
2416
- * Inherits `currentColor`, so set `color` to theme it.
2899
+ * Inherits `currentColor`, so set `color` to theme it. Pure CSS; there is no
2900
+ * enhancer.
2417
2901
  * data-hl-size: sm | md (default) | lg | xl
2418
2902
  */
2419
2903
  @layer components {
@@ -2423,22 +2907,14 @@
2423
2907
 
2424
2908
  display: inline-block;
2425
2909
  flex: none;
2426
- width: 1.25rem;
2427
- width: var(--_size);
2428
- height: 1.25rem;
2429
- height: var(--_size);
2430
- border: 2px solid color-mix(in oklab, currentcolor 25%, transparent);
2431
- 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;
2432
2914
  border-radius: var(--hl-radius-full);
2433
2915
  animation: hl-spinner-rotate 0.6s linear infinite;
2434
2916
  }
2435
2917
 
2436
- @supports (color: color-mix(in lch, red, blue)) {
2437
- .hl-spinner {
2438
- border: var(--_width) solid color-mix(in oklab, currentcolor 25%, transparent);
2439
- }
2440
- }
2441
-
2442
2918
  .hl-spinner[data-hl-size='sm'] {
2443
2919
  --_size: 1rem;
2444
2920
  }
@@ -2459,22 +2935,33 @@
2459
2935
  }
2460
2936
  }
2461
2937
 
2938
+ /* A static arc still reads as "loading" without continuous motion. */
2462
2939
  @media (prefers-reduced-motion: reduce) {
2463
2940
  .hl-spinner {
2464
- 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;
2465
2951
  }
2466
2952
  }
2467
2953
  }
2468
2954
  /**
2469
- * Skeleton: `<span class="hl-skeleton" data-hl-variant="…" aria-hidden="true">`
2470
- * placeholder shown while content loads.
2471
- * 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
2472
2959
  */
2473
2960
  @layer components {
2474
2961
  .hl-skeleton {
2475
2962
  display: block;
2476
- width: 100%;
2477
- height: 1rem;
2963
+ inline-size: 100%;
2964
+ block-size: 1rem;
2478
2965
  border-radius: var(--hl-radius-md);
2479
2966
  background: linear-gradient(
2480
2967
  90deg,
@@ -2486,14 +2973,14 @@
2486
2973
  animation: hl-skeleton-shimmer 1.4s var(--hl-ease-standard) infinite;
2487
2974
  }
2488
2975
 
2489
- .hl-skeleton[data-hl-variant='text'] {
2490
- height: 0.7em;
2976
+ .hl-skeleton[data-hl-shape='text'] {
2977
+ block-size: 0.7em;
2491
2978
  border-radius: var(--hl-radius-sm);
2492
2979
  }
2493
2980
 
2494
- .hl-skeleton[data-hl-variant='circle'] {
2495
- width: 2.5rem;
2496
- height: 2.5rem;
2981
+ .hl-skeleton[data-hl-shape='circle'] {
2982
+ inline-size: 2.5rem;
2983
+ block-size: 2.5rem;
2497
2984
  border-radius: var(--hl-radius-full);
2498
2985
  }
2499
2986
 
@@ -2513,20 +3000,28 @@
2513
3000
  background: var(--hl-surface-3);
2514
3001
  }
2515
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
+ }
2516
3010
  }
2517
3011
  /**
2518
3012
  * Keyboard key: `<kbd class="hl-kbd">⌘</kbd>`. Combine inline, e.g.
2519
- * `<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.
2520
3015
  */
2521
3016
  @layer components {
2522
3017
  .hl-kbd {
2523
3018
  display: inline-flex;
2524
3019
  align-items: center;
2525
3020
  justify-content: center;
2526
- min-width: 1.5rem;
3021
+ min-inline-size: 1.5rem;
2527
3022
  padding: 0.125rem 0.4rem;
2528
3023
  border: var(--hl-border-width) solid var(--hl-border-strong);
2529
- border-bottom-width: var(--hl-border-width-2);
3024
+ border-block-end-width: var(--hl-border-width-2);
2530
3025
  border-radius: var(--hl-radius-sm);
2531
3026
  background: var(--hl-surface-2);
2532
3027
  color: var(--hl-fg);
@@ -2537,33 +3032,44 @@
2537
3032
  }
2538
3033
  }
2539
3034
  /**
2540
- * Table: `<table class="hl-table">`. Semantic table styling with optional
2541
- * 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.
2542
3038
  * data-hl-striped: zebra rows
2543
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
2544
3042
  */
2545
3043
  @layer components {
3044
+ .hl-table-wrapper {
3045
+ inline-size: 100%;
3046
+ overflow-x: auto;
3047
+ overscroll-behavior-x: contain;
3048
+ }
3049
+
2546
3050
  .hl-table {
2547
- width: 100%;
3051
+ --_pad-y: var(--hl-space-2);
3052
+ --_pad-x: var(--hl-space-3);
3053
+
3054
+ inline-size: 100%;
2548
3055
  border-collapse: collapse;
2549
3056
  font-size: var(--hl-text-sm);
2550
3057
  color: var(--hl-fg);
2551
3058
  }
2552
3059
 
2553
3060
  .hl-table caption {
2554
- padding-top: var(--hl-space-2);
2555
- padding-bottom: var(--hl-space-2);
3061
+ padding-block: var(--hl-space-2);
2556
3062
  color: var(--hl-fg-muted);
2557
- text-align: left;
3063
+ text-align: start;
2558
3064
  caption-side: bottom;
2559
3065
  }
2560
3066
 
2561
3067
  .hl-table th,
2562
3068
  .hl-table td {
2563
- padding: var(--hl-space-2) var(--hl-space-3);
2564
- text-align: left;
3069
+ padding: var(--_pad-y) var(--_pad-x);
3070
+ text-align: start;
2565
3071
  vertical-align: middle;
2566
- border-bottom: var(--hl-border-width) solid var(--hl-border);
3072
+ border-block-end: var(--hl-border-width) solid var(--hl-border);
2567
3073
  }
2568
3074
 
2569
3075
  .hl-table thead th {
@@ -2572,7 +3078,7 @@
2572
3078
  text-transform: uppercase;
2573
3079
  letter-spacing: 0.03em;
2574
3080
  color: var(--hl-fg-muted);
2575
- border-bottom-color: var(--hl-border-strong);
3081
+ border-block-end-color: var(--hl-border-strong);
2576
3082
  }
2577
3083
 
2578
3084
  .hl-table tfoot td {
@@ -2588,32 +3094,63 @@
2588
3094
  background: color-mix(in oklab, var(--hl-primary) 8%, transparent);
2589
3095
  }
2590
3096
 
2591
- .hl-table td[data-hl-align='end'],
2592
- .hl-table th[data-hl-align='end'] {
2593
- 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;
2594
3114
  }
2595
3115
 
2596
- .hl-table td[data-hl-align='center'],
2597
- .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'] {
2598
3118
  text-align: center;
2599
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
+ }
2600
3132
  }
2601
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
+ */
2602
3139
  @layer components {
2603
3140
  .hl-skip-link {
2604
3141
  position: absolute;
2605
- left: -9999px;
2606
- top: auto;
2607
- width: 1px;
2608
- height: 1px;
3142
+ inset-inline-start: -9999px;
3143
+ inset-block-start: auto;
3144
+ inline-size: 1px;
3145
+ block-size: 1px;
2609
3146
  overflow: hidden;
2610
3147
  }
2611
3148
 
2612
3149
  .hl-skip-link:focus-visible {
2613
- left: 0;
2614
- top: 0;
2615
- width: auto;
2616
- height: auto;
3150
+ inset-inline-start: 0;
3151
+ inset-block-start: 0;
3152
+ inline-size: auto;
3153
+ block-size: auto;
2617
3154
  padding: var(--hl-space-2) var(--hl-space-3);
2618
3155
  background: var(--hl-fg);
2619
3156
  color: var(--hl-surface);