hydrateless 0.9.0 → 0.10.1

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.
@@ -233,11 +233,7 @@
233
233
  --hl-focus-offset: 2px;
234
234
 
235
235
  /* Z-index scale */
236
- --hl-z-base: 0;
237
236
  --hl-z-dropdown: 1000;
238
- --hl-z-sticky: 1100;
239
- --hl-z-drawer: 1200;
240
- --hl-z-modal: 1300;
241
237
  --hl-z-popover: 1400;
242
238
  --hl-z-toast: 1500;
243
239
  --hl-z-tooltip: 1600;
@@ -333,8 +329,8 @@
333
329
  --hl-danger-subtle-fg: light-dark(var(--hl-red-700), var(--hl-red-200));
334
330
 
335
331
  /* Intent: success */
336
- --hl-success: var(--hl-green-600);
337
- --hl-success-hover: var(--hl-green-700);
332
+ --hl-success: var(--hl-green-700);
333
+ --hl-success-hover: var(--hl-green-800);
338
334
  --hl-success-fg: hsl(0deg 0% 100%);
339
335
  --hl-success-subtle: light-dark(var(--hl-green-50), hsl(144deg 61% 20% / 0.35));
340
336
  --hl-success-subtle-fg: light-dark(var(--hl-green-700), var(--hl-green-200));
@@ -347,8 +343,8 @@
347
343
  --hl-warning-subtle-fg: light-dark(var(--hl-amber-800), var(--hl-amber-200));
348
344
 
349
345
  /* Intent: info */
350
- --hl-info: var(--hl-sky-600);
351
- --hl-info-hover: var(--hl-sky-700);
346
+ --hl-info: var(--hl-sky-700);
347
+ --hl-info-hover: var(--hl-sky-800);
352
348
  --hl-info-fg: hsl(0deg 0% 100%);
353
349
  --hl-info-subtle: light-dark(var(--hl-sky-50), hsl(202deg 80% 24% / 0.35));
354
350
  --hl-info-subtle-fg: light-dark(var(--hl-sky-700), var(--hl-sky-200));
@@ -514,6 +510,7 @@
514
510
 
515
511
  @layer components {
516
512
  [data-hl-tabs] {
513
+ min-inline-size: 0;
517
514
  border: var(--hl-border-width) solid var(--hl-border);
518
515
  border-radius: var(--hl-radius-lg);
519
516
  }
@@ -521,6 +518,7 @@
521
518
  .hl-tablist,
522
519
  [data-hl-tabs] [role='tablist'] {
523
520
  display: flex;
521
+ overflow-x: auto;
524
522
  gap: var(--hl-space-2);
525
523
  padding: var(--hl-space-2);
526
524
  border-block-end: var(--hl-border-width) solid var(--hl-border);
@@ -541,6 +539,7 @@
541
539
  position: relative;
542
540
  appearance: none;
543
541
  display: inline-flex;
542
+ flex: none;
544
543
  align-items: center;
545
544
  background: transparent;
546
545
  border: 0;
@@ -713,7 +712,7 @@
713
712
  * links. With no JavaScript it is a plain link list; the enhancer marks the
714
713
  * link for the heading in view with `aria-current="true"`.
715
714
  * data-hl-toc: the nav
716
- * data-hl-toc-content: optional element whose headings are observed
715
+ * data-hl-content-selector: optional element whose headings are observed
717
716
  */
718
717
 
719
718
  @layer components {
@@ -938,6 +937,9 @@
938
937
  :is(.hl-modal, dialog[data-hl-modal]) {
939
938
  inline-size: min(90vi, var(--hl-modal-inline-size));
940
939
  max-inline-size: none;
940
+
941
+ /* The reset clears the UA's auto margin; restore native dialog centering. */
942
+ margin: auto;
941
943
  padding: 0;
942
944
  border: none;
943
945
  border-radius: var(--hl-radius-lg);
@@ -1202,13 +1204,17 @@
1202
1204
  * `hidden`), and drives visibility through `data-hl-tooltip-open` with show
1203
1205
  * and hide delays, a grace period, and Escape to dismiss.
1204
1206
  * data-hl-tooltip: the trigger
1205
- * data-hl-placement: top (default) | bottom | left | right, on the trigger
1207
+ * data-hl-placement: top (default) | bottom | start | end, on the trigger
1208
+ * data-hl-side: the resolved side, set on the tip by the enhancer
1206
1209
  * data-hl-tooltip-managed: set on the trigger by the enhancer
1207
1210
  * data-hl-tooltip-open: set on the tip while shown
1208
1211
  */
1209
1212
 
1210
1213
  @layer components {
1211
1214
  [role='tooltip'] {
1215
+ /* Closed baseline tips must not intercept input or remain exposed to AT. */
1216
+ display: none;
1217
+
1212
1218
  /* Fallback placement: the JS positioner writes inline position/inset on
1213
1219
  engines without CSS anchor positioning. */
1214
1220
  position: absolute;
@@ -1252,16 +1258,51 @@
1252
1258
  }
1253
1259
  }
1254
1260
 
1255
- /* Modern placement: pin above the trigger via the anchor-name the enhancer
1256
- sets, flipping below when there's no room. */
1261
+ /* Modern placement: pin to the requested side of the trigger via the
1262
+ anchor-name the enhancer sets, flipping when there's no room. The side
1263
+ comes from `data-hl-side` on the tip (enhanced) or `data-hl-placement` on
1264
+ the preceding trigger (no-JS baseline). */
1257
1265
  @supports (anchor-name: --x) {
1266
+ :has(> [data-hl-tooltip]) {
1267
+ anchor-scope: --hl-tooltip-trigger;
1268
+ }
1269
+
1270
+ [data-hl-tooltip] {
1271
+ anchor-name: --hl-tooltip-trigger;
1272
+ }
1273
+
1258
1274
  [role='tooltip'] {
1275
+ position-anchor: --hl-tooltip-trigger;
1259
1276
  position: fixed;
1260
1277
  inset: auto;
1261
1278
  position-area: block-start;
1262
1279
  position-try-fallbacks: flip-block;
1263
1280
  margin-block: var(--hl-space-1);
1264
1281
  }
1282
+
1283
+ [role='tooltip'][data-hl-side='bottom'],
1284
+ [data-hl-tooltip][data-hl-placement^='bottom'] + [role='tooltip'] {
1285
+ position-area: block-end;
1286
+ }
1287
+
1288
+ [role='tooltip']:is([data-hl-side='start'], [data-hl-side='end']),
1289
+ [data-hl-tooltip]:is([data-hl-placement^='start'], [data-hl-placement^='end'])
1290
+ + [role='tooltip'] {
1291
+ position-try-fallbacks: flip-inline;
1292
+ margin-block: 0;
1293
+ margin-inline: var(--hl-space-1);
1294
+ translate: 0 0;
1295
+ }
1296
+
1297
+ [role='tooltip'][data-hl-side='start'],
1298
+ [data-hl-tooltip][data-hl-placement^='start'] + [role='tooltip'] {
1299
+ position-area: inline-start;
1300
+ }
1301
+
1302
+ [role='tooltip'][data-hl-side='end'],
1303
+ [data-hl-tooltip][data-hl-placement^='end'] + [role='tooltip'] {
1304
+ position-area: inline-end;
1305
+ }
1265
1306
  }
1266
1307
 
1267
1308
  /* Inverted colors flatten away; keep a visible edge on the system canvas. */
@@ -1285,7 +1326,9 @@
1285
1326
  * data-hl-dropdown-menu: the `<ul>` (or any list) of items
1286
1327
  * data-hl-value: an item's value for `hl:select`
1287
1328
  * Items are `role="menuitem"`, `menuitemcheckbox`, or `menuitemradio`, either
1288
- * directly in the list, inside `<li>`, or inside `<li><ul role="group">`.
1329
+ * directly in the list, inside `<li>`, or inside `<li><ul role="group">`. An
1330
+ * item followed by a sibling `<ul role="menu">` (or `[data-hl-submenu]`) opens
1331
+ * it as a nested submenu to the inline-end side.
1289
1332
  */
1290
1333
 
1291
1334
  @layer components {
@@ -1340,6 +1383,60 @@
1340
1383
  list-style: none;
1341
1384
  }
1342
1385
 
1386
+ /* Nested submenus share the panel styling and sit beside their trigger. */
1387
+ [data-hl-dropdown-menu] li {
1388
+ position: relative;
1389
+ }
1390
+
1391
+ [data-hl-dropdown-menu] :is([role='menu'], [data-hl-submenu]) {
1392
+ position: absolute;
1393
+ inset-block-start: 0;
1394
+ inset-inline-start: calc(100% + var(--hl-space-1));
1395
+ z-index: var(--hl-z-dropdown);
1396
+ min-inline-size: 10rem;
1397
+ margin: 0;
1398
+ padding: var(--hl-space-1);
1399
+ list-style: none;
1400
+ border: var(--hl-border-width) solid var(--hl-border);
1401
+ border-radius: var(--hl-radius-lg);
1402
+ background: var(--hl-surface);
1403
+ box-shadow: var(--hl-overlay-shadow);
1404
+ }
1405
+
1406
+ [data-hl-dropdown-menu]
1407
+ :is([role='menu'], [data-hl-submenu]):is([hidden], [popover]:not(:popover-open)) {
1408
+ display: none;
1409
+ }
1410
+
1411
+ [data-hl-dropdown-menu] :is([role='menu'], [data-hl-submenu])[popover] {
1412
+ position: fixed;
1413
+ inset: auto;
1414
+ }
1415
+
1416
+ @supports (position-area: block-end) {
1417
+ [data-hl-dropdown-menu] :is([role='menu'], [data-hl-submenu])[popover] {
1418
+ position-area: inline-end span-block-end;
1419
+ position-try-fallbacks: flip-inline, flip-block;
1420
+ margin-inline: var(--hl-space-1);
1421
+ }
1422
+ }
1423
+
1424
+ /* Submenu chevron: a rotated square corner at the inline end. */
1425
+ [data-hl-dropdown-menu] [role^='menuitem'][aria-haspopup='menu']::after {
1426
+ content: '';
1427
+ inline-size: 0.4rem;
1428
+ block-size: 0.4rem;
1429
+ margin-inline-start: auto;
1430
+ border-inline-end: 1.5px solid currentcolor;
1431
+ border-block-end: 1.5px solid currentcolor;
1432
+ rotate: -45deg;
1433
+ opacity: 0.6;
1434
+ }
1435
+
1436
+ [data-hl-dropdown-menu] [role^='menuitem'][aria-expanded='true'] {
1437
+ background: var(--hl-surface-2);
1438
+ }
1439
+
1343
1440
  [data-hl-dropdown-menu] [role^='menuitem'] {
1344
1441
  display: flex;
1345
1442
  align-items: center;
@@ -1410,8 +1507,10 @@
1410
1507
 
1411
1508
  /**
1412
1509
  * Menubar / navigation menu: `<ul data-hl-menu role="menubar">` of `<li>`
1413
- * items, each optionally holding a trigger and a single-level submenu
1414
- * (`<ul role="menu">` or `[data-hl-menu-submenu]`) as siblings inside the `<li>`.
1510
+ * items, each optionally holding a trigger and a submenu (`<ul role="menu">`
1511
+ * or `[data-hl-submenu]`) as siblings inside the `<li>`. Submenus nest: an
1512
+ * item inside a submenu may itself be followed by a submenu, which opens to
1513
+ * its inline-end side.
1415
1514
  *
1416
1515
  * No-JS baseline: a submenu shows while its `<li>` is hovered or has focus
1417
1516
  * within it, so every link stays reachable by mouse and keyboard. The enhancer
@@ -1419,7 +1518,7 @@
1419
1518
  * plus a top-layer `popover`) and adds roving focus, arrow keys, typeahead,
1420
1519
  * and checkable items. It reads:
1421
1520
  * data-hl-menu: root; `aria-orientation="vertical"` stacks it
1422
- * data-hl-menu-submenu: a submenu without `role="menu"`
1521
+ * data-hl-submenu: a submenu without `role="menu"`
1423
1522
  * data-hl-value: a top-level trigger's value for `hl:change`
1424
1523
  * data-hl-ready: set by the enhancer
1425
1524
  */
@@ -1489,7 +1588,13 @@
1489
1588
  opacity: 0.6;
1490
1589
  }
1491
1590
 
1492
- [data-hl-menu] :is([role='menu'], [data-hl-menu-submenu]) {
1591
+ /* Submenus that open to the side point their chevron that way. */
1592
+ [data-hl-menu][aria-orientation='vertical'] [role^='menuitem'][aria-haspopup]::after,
1593
+ [data-hl-menu] :is([role='menu'], [data-hl-submenu]) [role^='menuitem'][aria-haspopup]::after {
1594
+ rotate: -45deg;
1595
+ }
1596
+
1597
+ [data-hl-menu] :is([role='menu'], [data-hl-submenu]) {
1493
1598
  position: absolute;
1494
1599
  inset-block-start: calc(100% + var(--hl-space-1));
1495
1600
  inset-inline-start: 0;
@@ -1509,17 +1614,22 @@
1509
1614
  overlay var(--hl-duration-fast) allow-discrete;
1510
1615
  }
1511
1616
 
1512
- [data-hl-menu][aria-orientation='vertical'] :is([role='menu'], [data-hl-menu-submenu]) {
1617
+ /* Vertical menubars and every nested level open to the inline-end side. */
1618
+ [data-hl-menu][aria-orientation='vertical'] :is([role='menu'], [data-hl-submenu]),
1619
+ [data-hl-menu] :is([role='menu'], [data-hl-submenu]) :is([role='menu'], [data-hl-submenu]) {
1513
1620
  inset-block-start: 0;
1514
1621
  inset-inline-start: calc(100% + var(--hl-space-1));
1515
1622
  }
1516
1623
 
1624
+ [data-hl-menu] :is([role='menu'], [data-hl-submenu]) li {
1625
+ position: relative;
1626
+ }
1627
+
1517
1628
  /* Closed states: `hidden` (enhancer without Popover API), a closed popover
1518
1629
  (enhancer with it), and the no-JS baseline below. Each is also the exit
1519
1630
  target of the transition. */
1520
- [data-hl-menu]
1521
- :is([role='menu'], [data-hl-menu-submenu]):is([hidden], [popover]:not(:popover-open)),
1522
- [data-hl-menu]:not([data-hl-ready]) :is([role='menu'], [data-hl-menu-submenu]) {
1631
+ [data-hl-menu] :is([role='menu'], [data-hl-submenu]):is([hidden], [popover]:not(:popover-open)),
1632
+ [data-hl-menu]:not([data-hl-ready]) :is([role='menu'], [data-hl-submenu]) {
1523
1633
  display: none;
1524
1634
  opacity: 0;
1525
1635
  translate: 0 -0.25rem;
@@ -1528,14 +1638,14 @@
1528
1638
  /* No-JS baseline: reveal on hover or focus within the parent item. */
1529
1639
  [data-hl-menu]:not([data-hl-ready])
1530
1640
  li:is(:hover, :focus-within)
1531
- > :is([role='menu'], [data-hl-menu-submenu]) {
1641
+ > :is([role='menu'], [data-hl-submenu]) {
1532
1642
  display: block;
1533
1643
  opacity: 1;
1534
1644
  translate: 0 0;
1535
1645
  }
1536
1646
 
1537
1647
  @starting-style {
1538
- [data-hl-menu] :is([role='menu'], [data-hl-menu-submenu]) {
1648
+ [data-hl-menu] :is([role='menu'], [data-hl-submenu]) {
1539
1649
  opacity: 0;
1540
1650
  translate: 0 -0.25rem;
1541
1651
  }
@@ -1544,20 +1654,22 @@
1544
1654
  /* Enhanced path: the submenu is a native popover in the top layer, anchored
1545
1655
  to its trigger. The absolute-position rules above stay as the fallback for
1546
1656
  engines without the Popover API. */
1547
- [data-hl-menu] :is([role='menu'], [data-hl-menu-submenu])[popover] {
1657
+ [data-hl-menu] :is([role='menu'], [data-hl-submenu])[popover] {
1548
1658
  position: fixed;
1549
1659
  inset: auto;
1550
1660
  }
1551
1661
 
1552
1662
  @supports (position-area: block-end) {
1553
- [data-hl-menu] :is([role='menu'], [data-hl-menu-submenu])[popover] {
1663
+ [data-hl-menu] :is([role='menu'], [data-hl-submenu])[popover] {
1554
1664
  position-area: block-end span-inline-end;
1555
1665
  position-try-fallbacks: flip-block, flip-inline;
1556
1666
  margin-block: var(--hl-space-1);
1557
1667
  }
1558
1668
 
1559
- [data-hl-menu][aria-orientation='vertical']
1560
- :is([role='menu'], [data-hl-menu-submenu])[popover] {
1669
+ [data-hl-menu][aria-orientation='vertical'] :is([role='menu'], [data-hl-submenu])[popover],
1670
+ [data-hl-menu]
1671
+ :is([role='menu'], [data-hl-submenu])
1672
+ :is([role='menu'], [data-hl-submenu])[popover] {
1561
1673
  position-area: inline-end span-block-end;
1562
1674
  position-try-fallbacks: flip-inline, flip-block;
1563
1675
  margin-block: 0;
@@ -1745,7 +1857,7 @@
1745
1857
  font-weight: var(--hl-font-semibold);
1746
1858
  text-transform: uppercase;
1747
1859
  letter-spacing: 0.04em;
1748
- color: var(--hl-fg-subtle);
1860
+ color: var(--hl-fg-muted);
1749
1861
  }
1750
1862
 
1751
1863
  [data-hl-command] [role='option'] {
@@ -1945,7 +2057,7 @@
1945
2057
 
1946
2058
  .hl-button[data-hl-variant='outline'] {
1947
2059
  background: transparent;
1948
- color: var(--_accent);
2060
+ color: var(--_soft-fg);
1949
2061
  border-color: var(--hl-border-strong);
1950
2062
  }
1951
2063
 
@@ -1956,7 +2068,7 @@
1956
2068
 
1957
2069
  .hl-button[data-hl-variant='ghost'] {
1958
2070
  background: transparent;
1959
- color: var(--_accent);
2071
+ color: var(--_soft-fg);
1960
2072
  }
1961
2073
 
1962
2074
  .hl-button[data-hl-variant='ghost']:hover {
@@ -1967,7 +2079,7 @@
1967
2079
  block-size: auto;
1968
2080
  padding: 0;
1969
2081
  background: transparent;
1970
- color: var(--_accent);
2082
+ color: var(--_soft-fg);
1971
2083
  border-color: transparent;
1972
2084
  text-decoration: underline;
1973
2085
  text-underline-offset: 0.2em;
@@ -2341,7 +2453,12 @@
2341
2453
  /**
2342
2454
  * Checkbox: `<label class="hl-checkbox"><input type="checkbox"><span>...</span></label>`.
2343
2455
  * The native input is restyled (appearance: none) with a CSS checkmark, keeping
2344
- * full keyboard and form semantics. Pure CSS; there is no enhancer.
2456
+ * full keyboard and form semantics. A single checkbox needs no JavaScript; the
2457
+ * `data-hl-checkbox-group` enhancer adds a `data-hl-checkbox-all` master box
2458
+ * (checked/indeterminate follows the group) and `data-hl-indeterminate` for an
2459
+ * initial mixed state, both styled here through `:indeterminate`.
2460
+ * data-hl-checkbox-group: wrapper around related boxes for the enhancer
2461
+ * data-hl-checkbox-all: the master "select all" box inside the group
2345
2462
  */
2346
2463
 
2347
2464
  @layer components {
@@ -2634,7 +2751,7 @@
2634
2751
  .hl-label[data-hl-required]::after {
2635
2752
  content: '*';
2636
2753
  margin-inline-start: var(--hl-space-1);
2637
- color: var(--hl-danger);
2754
+ color: var(--hl-danger-subtle-fg);
2638
2755
  }
2639
2756
 
2640
2757
  .hl-help {
@@ -2647,11 +2764,11 @@
2647
2764
  margin: 0;
2648
2765
  font-size: var(--hl-text-xs);
2649
2766
  font-weight: var(--hl-font-medium);
2650
- color: var(--hl-danger);
2767
+ color: var(--hl-danger-subtle-fg);
2651
2768
  }
2652
2769
 
2653
2770
  .hl-field[data-hl-invalid] .hl-label {
2654
- color: var(--hl-danger);
2771
+ color: var(--hl-danger-subtle-fg);
2655
2772
  }
2656
2773
 
2657
2774
  .hl-fieldset {
@@ -2709,7 +2826,16 @@
2709
2826
  /* Modern engines pin the listbox to the input via the anchor-name the
2710
2827
  enhancer sets, so it escapes overflow-clipping ancestors. */
2711
2828
  @supports (anchor-name: --x) {
2829
+ [data-hl-combobox] {
2830
+ anchor-scope: --hl-combobox-input;
2831
+ }
2832
+
2833
+ [data-hl-combobox] > input {
2834
+ anchor-name: --hl-combobox-input;
2835
+ }
2836
+
2712
2837
  [data-hl-combobox] [role='listbox'] {
2838
+ position-anchor: --hl-combobox-input;
2713
2839
  position: fixed;
2714
2840
  inset: auto;
2715
2841
  inline-size: anchor-size(width);
@@ -2782,14 +2908,18 @@
2782
2908
  * Segmented control: `<div class="hl-segmented" role="radiogroup">` of
2783
2909
  * `<label class="hl-segmented-item"><input type="radio">...</label>` segments.
2784
2910
  * Radio inputs give free keyboard navigation; the checked segment is raised.
2785
- * A button variant using `aria-pressed="true"` is also supported. Pure CSS;
2786
- * there is no enhancer.
2911
+ * A button variant is also supported: with the enhancer (`data-hl-segmented`)
2912
+ * buttons become a `role="radio"` group with `aria-checked` and arrow keys;
2913
+ * without it, mark the active button `aria-pressed="true"`.
2787
2914
  * data-hl-size: sm | md (default) | lg
2788
2915
  */
2789
2916
 
2790
2917
  @layer components {
2791
2918
  .hl-segmented {
2792
2919
  display: inline-flex;
2920
+ flex-wrap: wrap;
2921
+ max-inline-size: 100%;
2922
+ min-inline-size: 0;
2793
2923
  align-items: stretch;
2794
2924
  gap: var(--hl-space-1);
2795
2925
  padding: var(--hl-space-1);
@@ -2801,6 +2931,7 @@
2801
2931
  .hl-segmented-item {
2802
2932
  position: relative;
2803
2933
  display: inline-flex;
2934
+ flex-shrink: 0;
2804
2935
  align-items: center;
2805
2936
  justify-content: center;
2806
2937
  gap: var(--hl-space-2);
@@ -2834,14 +2965,14 @@
2834
2965
  }
2835
2966
 
2836
2967
  .hl-segmented-item:has(input:checked),
2837
- .hl-segmented-item[aria-pressed='true'] {
2968
+ .hl-segmented-item:is([aria-pressed='true'], [aria-checked='true']) {
2838
2969
  background: var(--hl-surface);
2839
2970
  color: var(--hl-fg);
2840
2971
  box-shadow: var(--hl-shadow-sm);
2841
2972
  }
2842
2973
 
2843
2974
  .hl-segmented-item:has(input:focus-visible),
2844
- .hl-segmented-item[aria-pressed]:focus-visible {
2975
+ .hl-segmented-item:is([aria-pressed], [aria-checked]):focus-visible {
2845
2976
  outline: var(--hl-focus-ring);
2846
2977
  outline-offset: var(--hl-focus-offset);
2847
2978
  }
@@ -2869,7 +3000,7 @@
2869
3000
  }
2870
3001
 
2871
3002
  .hl-segmented-item:has(input:checked),
2872
- .hl-segmented-item[aria-pressed='true'] {
3003
+ .hl-segmented-item:is([aria-pressed='true'], [aria-checked='true']) {
2873
3004
  background: Highlight;
2874
3005
  color: HighlightText;
2875
3006
  }
@@ -2879,7 +3010,11 @@
2879
3010
  /**
2880
3011
  * Slider: native `<input type="range" class="hl-slider">`. Restyled track and
2881
3012
  * thumb across WebKit/Blink and Firefox while keeping native keyboard support
2882
- * and RTL direction. Pure CSS; there is no enhancer.
3013
+ * and RTL direction. Firefox paints the filled part of the track natively
3014
+ * (`::-moz-range-progress`); other engines get it from the
3015
+ * `--hl-slider-progress` custom property the enhancer keeps in sync when the
3016
+ * input sits inside a `[data-hl-slider]` wrapper (with an optional `<output>`).
3017
+ * data-hl-slider: wrapper around the input (and output) for the enhancer
2883
3018
  */
2884
3019
 
2885
3020
  @layer components {
@@ -2901,6 +3036,40 @@
2901
3036
  background: var(--hl-surface-3);
2902
3037
  }
2903
3038
 
3039
+ /* Fill up to the thumb once the enhancer publishes the progress. */
3040
+ .hl-slider[style*='--hl-slider-progress']::-webkit-slider-runnable-track {
3041
+ background: linear-gradient(
3042
+ to right,
3043
+ var(--hl-primary) var(--hl-slider-progress),
3044
+ var(--hl-surface-3) var(--hl-slider-progress)
3045
+ );
3046
+ }
3047
+
3048
+ :is(
3049
+ [dir='rtl'] .hl-slider,
3050
+ .hl-slider:dir(rtl)
3051
+ )[style*='--hl-slider-progress']::-webkit-slider-runnable-track {
3052
+ background: linear-gradient(
3053
+ to left,
3054
+ var(--hl-primary) var(--hl-slider-progress),
3055
+ var(--hl-surface-3) var(--hl-slider-progress)
3056
+ );
3057
+ }
3058
+
3059
+ [data-hl-slider] {
3060
+ display: flex;
3061
+ align-items: center;
3062
+ gap: var(--hl-space-3);
3063
+ }
3064
+
3065
+ [data-hl-slider] > output {
3066
+ min-inline-size: 3ch;
3067
+ font-size: var(--hl-text-sm);
3068
+ font-variant-numeric: tabular-nums;
3069
+ color: var(--hl-fg-muted);
3070
+ text-align: end;
3071
+ }
3072
+
2904
3073
  .hl-slider::-moz-range-track {
2905
3074
  block-size: var(--_track);
2906
3075
  border-radius: var(--hl-radius-full);
@@ -2969,9 +3138,13 @@
2969
3138
 
2970
3139
  /**
2971
3140
  * Alert: `<div class="hl-alert" role="alert" data-hl-intent="...">` with an
2972
- * optional icon, `.hl-alert-title`, and body content. Pure CSS; there is no
2973
- * enhancer.
2974
- * data-hl-intent: info (default) | success | warning | danger | neutral
3141
+ * optional icon, `.hl-alert-title`, and body content. Add `data-hl-alert` and
3142
+ * a `[data-hl-dismiss]` button for the dismiss enhancer, which fades the alert
3143
+ * out (`data-hl-alert-closing`) before hiding it.
3144
+ * data-hl-intent: info (default) | success | warning | danger | neutral
3145
+ * data-hl-alert: opt in to the dismiss enhancer
3146
+ * data-hl-dismiss: the dismiss button inside the alert
3147
+ * data-hl-alert-closing: set by the enhancer during the exit transition
2975
3148
  */
2976
3149
 
2977
3150
  @layer components {
@@ -2990,6 +3163,55 @@
2990
3163
  color: var(--_fg);
2991
3164
  font-size: var(--hl-text-sm);
2992
3165
  line-height: var(--hl-leading-normal);
3166
+ transition:
3167
+ opacity var(--hl-duration-base) var(--hl-ease-standard),
3168
+ translate var(--hl-duration-base) var(--hl-ease-standard);
3169
+ }
3170
+
3171
+ .hl-alert[data-hl-alert-closing] {
3172
+ opacity: 0;
3173
+ translate: 0 -0.25rem;
3174
+ }
3175
+
3176
+ /* `display: flex` above would otherwise beat the user agent's `[hidden]`. */
3177
+ .hl-alert[hidden] {
3178
+ display: none;
3179
+ }
3180
+
3181
+ .hl-alert [data-hl-dismiss] {
3182
+ display: inline-flex;
3183
+ align-items: center;
3184
+ justify-content: center;
3185
+ flex: none;
3186
+ inline-size: 1.5rem;
3187
+ block-size: 1.5rem;
3188
+ margin-inline-start: auto;
3189
+ margin-block-start: -0.125rem;
3190
+ padding: 0;
3191
+ border: 0;
3192
+ border-radius: var(--hl-radius-sm);
3193
+ background: transparent;
3194
+ color: inherit;
3195
+ font: inherit;
3196
+ line-height: 1;
3197
+ cursor: pointer;
3198
+ opacity: 0.7;
3199
+ }
3200
+
3201
+ .hl-alert [data-hl-dismiss]:hover {
3202
+ opacity: 1;
3203
+ background: color-mix(in oklab, currentcolor 10%, transparent);
3204
+ }
3205
+
3206
+ .hl-alert [data-hl-dismiss]:focus-visible {
3207
+ outline: var(--hl-focus-ring);
3208
+ outline-offset: var(--hl-focus-offset);
3209
+ opacity: 1;
3210
+ }
3211
+
3212
+ .hl-alert [data-hl-dismiss]:empty::before {
3213
+ content: '\00D7';
3214
+ font-size: var(--hl-text-lg);
2993
3215
  }
2994
3216
 
2995
3217
  .hl-alert[data-hl-intent='success'] {
@@ -3126,7 +3348,7 @@
3126
3348
 
3127
3349
  .hl-badge[data-hl-variant='outline'] {
3128
3350
  background: transparent;
3129
- color: var(--_accent);
3351
+ color: var(--_soft-fg);
3130
3352
  border-color: currentcolor;
3131
3353
  }
3132
3354
 
@@ -3240,7 +3462,7 @@
3240
3462
  border-radius: var(--hl-radius-full);
3241
3463
  overflow: hidden;
3242
3464
  background: var(--hl-surface-3);
3243
- color: var(--hl-fg-muted);
3465
+ color: var(--hl-fg);
3244
3466
  font-size: calc(var(--_size) * 0.4);
3245
3467
  font-weight: var(--hl-font-medium);
3246
3468
  line-height: 1;
@@ -3542,11 +3764,14 @@
3542
3764
  /**
3543
3765
  * Table: `<table class="hl-table">`, optionally inside
3544
3766
  * `<div class="hl-table-wrapper">` so wide tables scroll instead of breaking
3545
- * the layout. Pure CSS; there is no enhancer.
3767
+ * the layout. Add `data-hl-table` and mark headers `data-hl-sort` for the
3768
+ * sorting enhancer; it sets `aria-sort` on the active column.
3546
3769
  * data-hl-striped: zebra rows
3547
3770
  * data-hl-hover: highlight row on hover
3548
3771
  * data-hl-align: start (default) | center | end, on the table or a cell
3549
3772
  * data-hl-size: sm | md (default) | lg, cell padding density
3773
+ * data-hl-table: opt in to the sorting enhancer
3774
+ * data-hl-sort: a sortable header (value: the column key)
3550
3775
  */
3551
3776
 
3552
3777
  @layer components {
@@ -3590,6 +3815,51 @@
3590
3815
  border-block-end-color: var(--hl-border-strong);
3591
3816
  }
3592
3817
 
3818
+ /* Sortable headers: a pointer cursor, a focus ring, and a direction glyph. */
3819
+ .hl-table th[data-hl-sort] {
3820
+ cursor: pointer;
3821
+ -webkit-user-select: none;
3822
+ user-select: none;
3823
+ }
3824
+
3825
+ .hl-table th[data-hl-sort]:hover {
3826
+ color: var(--hl-fg);
3827
+ }
3828
+
3829
+ .hl-table th[data-hl-sort]:focus-visible {
3830
+ outline: var(--hl-focus-ring);
3831
+ outline-offset: calc(var(--hl-focus-offset) * -1);
3832
+ }
3833
+
3834
+ .hl-table th[data-hl-sort]::after {
3835
+ content: '';
3836
+ display: inline-block;
3837
+ inline-size: 0.35em;
3838
+ block-size: 0.35em;
3839
+ margin-inline-start: var(--hl-space-1);
3840
+ border-inline-end: 1.5px solid currentcolor;
3841
+ border-block-end: 1.5px solid currentcolor;
3842
+ opacity: 0;
3843
+ translate: 0 -0.15em;
3844
+ rotate: 45deg;
3845
+ transition: opacity var(--hl-duration-fast) var(--hl-ease-standard);
3846
+ }
3847
+
3848
+ .hl-table th[data-hl-sort]:hover::after {
3849
+ opacity: 0.4;
3850
+ }
3851
+
3852
+ .hl-table th[aria-sort='ascending']::after,
3853
+ .hl-table th[aria-sort='descending']::after {
3854
+ opacity: 1;
3855
+ color: var(--hl-primary);
3856
+ }
3857
+
3858
+ .hl-table th[aria-sort='ascending']::after {
3859
+ rotate: 225deg;
3860
+ translate: 0 0.1em;
3861
+ }
3862
+
3593
3863
  .hl-table tfoot td {
3594
3864
  font-weight: var(--hl-font-medium);
3595
3865
  color: var(--hl-fg-muted);