actual-css 0.16.1 → 0.17.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.
Files changed (119) hide show
  1. package/CHANGELOG.md +101 -0
  2. package/README.md +8 -4
  3. package/components.json +19 -4
  4. package/dist/actual.full.css +464 -80
  5. package/dist/actual.full.js +2 -1
  6. package/dist/actual.full.min.css +1 -1
  7. package/docs/design-notes/app-ui.md +37 -3
  8. package/docs/design-notes/enhancement-contract.md +3 -1
  9. package/docs/navigation.json +17 -3
  10. package/docs/pages/components/accordion.md +8 -0
  11. package/docs/pages/components/alert.md +47 -17
  12. package/docs/pages/components/app-navigation.md +2 -2
  13. package/docs/pages/components/aura.md +2 -2
  14. package/docs/pages/components/badge.md +4 -3
  15. package/docs/pages/components/button.md +3 -0
  16. package/docs/pages/components/card.md +1 -1
  17. package/docs/pages/components/chat.md +2 -2
  18. package/docs/pages/components/dialog.md +36 -0
  19. package/docs/pages/components/drawer.md +52 -8
  20. package/docs/pages/components/fab.md +2 -1
  21. package/docs/pages/components/list.md +1 -1
  22. package/docs/pages/components/meter.md +1 -1
  23. package/docs/pages/components/navbar.md +27 -3
  24. package/docs/pages/components/overview.md +17 -0
  25. package/docs/pages/components/rating.md +111 -12
  26. package/docs/pages/components/segmented.md +36 -1
  27. package/docs/pages/components/shimmer.md +2 -2
  28. package/docs/pages/components/spinner.md +2 -0
  29. package/docs/pages/components/table.md +77 -0
  30. package/docs/pages/components/timeline.md +3 -1
  31. package/docs/pages/enhancements/flyout.md +83 -14
  32. package/docs/pages/enhancements/overview.md +2 -2
  33. package/docs/pages/enhancements/status-bar.md +1 -1
  34. package/docs/pages/enhancements/tabs.md +5 -0
  35. package/docs/pages/examples/overview.md +5 -1
  36. package/docs/pages/forms/ajax.md +101 -0
  37. package/docs/pages/forms/choice-cards.md +1 -1
  38. package/docs/pages/forms/color-swatches.md +31 -2
  39. package/docs/pages/forms/detached-actions.md +1 -1
  40. package/docs/pages/forms/floating-field.md +5 -3
  41. package/docs/pages/forms/form-actions.md +1 -1
  42. package/docs/pages/forms/input-policy.md +1 -1
  43. package/docs/pages/forms/joined-controls.md +9 -4
  44. package/docs/pages/forms/otp.md +2 -2
  45. package/docs/pages/forms/overview.md +1 -1
  46. package/docs/pages/forms/password.md +1 -1
  47. package/docs/pages/forms/states-and-sizes.md +1 -1
  48. package/docs/pages/forms/sticky-actions.md +1 -1
  49. package/docs/pages/forms/unsaved-changes.md +198 -0
  50. package/docs/pages/foundations/philosophy.md +2 -1
  51. package/docs/pages/foundations/theming.md +4 -3
  52. package/docs/pages/foundations/tokens.md +30 -5
  53. package/docs/pages/foundations/typography.md +1 -1
  54. package/docs/pages/guides/introduction.md +1 -1
  55. package/docs/pages/guides/progressive-enhancement.md +31 -50
  56. package/docs/pages/guides/upgrading.md +15 -2
  57. package/docs/pages/layout/app-layout.md +1 -1
  58. package/docs/pages/layout/app-shell.md +1 -1
  59. package/docs/pages/layout/choosing.md +5 -0
  60. package/docs/pages/layout/column-layout.md +23 -9
  61. package/docs/pages/layout/media.md +1 -1
  62. package/docs/pages/layout/overview.md +1 -1
  63. package/docs/pages/layout/scroll-snap.md +1 -1
  64. package/docs/pages/layout/scroll-target.md +1 -1
  65. package/docs/pages/layout/sidebar-layout.md +1 -1
  66. package/docs/pages/layout/sidebar-shell.md +68 -0
  67. package/docs/pages/patterns/code-block.md +1 -1
  68. package/docs/pages/patterns/empty-state.md +74 -0
  69. package/docs/pages/patterns/exclusive-accordion.md +1 -1
  70. package/docs/pages/patterns/hierarchical-nav.md +41 -20
  71. package/docs/pages/patterns/icon-input.md +1 -1
  72. package/docs/pages/patterns/intent-nesting.md +1 -1
  73. package/docs/pages/patterns/navigation-list.md +5 -62
  74. package/docs/pages/patterns/overview.md +1 -1
  75. package/docs/pages/patterns/stat.md +61 -0
  76. package/docs/pages/patterns/structured-lists.md +1 -1
  77. package/docs/pages/utilities/accessibility.md +32 -10
  78. package/docs/pages/utilities/flex.md +1 -1
  79. package/docs/pages/utilities/links.md +1 -1
  80. package/docs/pages/utilities/list.md +1 -1
  81. package/docs/pages/utilities/shape.md +1 -1
  82. package/docs/pages/utilities/sizing-wrapping.md +1 -1
  83. package/docs/pages/utilities/spacing.md +1 -1
  84. package/docs/pages/utilities/text.md +1 -1
  85. package/package.json +4 -1
  86. package/reserved-classes.json +2 -0
  87. package/src/cli/actual-css.js +4 -4
  88. package/src/css/components/accordion.css +10 -6
  89. package/src/css/components/alert.css +4 -0
  90. package/src/css/components/busy.css +25 -0
  91. package/src/css/components/button.css +3 -0
  92. package/src/css/components/drawer.css +37 -3
  93. package/src/css/components/flyout.css +37 -0
  94. package/src/css/components/join.css +14 -0
  95. package/src/css/components/modal.css +3 -0
  96. package/src/css/components/navbar.css +102 -38
  97. package/src/css/components/rating.css +50 -5
  98. package/src/css/components/segmented.css +25 -2
  99. package/src/css/core/theme.css +20 -1
  100. package/src/css/core/tokens.css +4 -1
  101. package/src/css/forms/color-swatch.css +38 -19
  102. package/src/css/forms/custom-select.css +10 -0
  103. package/src/css/forms/input-icon.css +5 -3
  104. package/src/css/layout/index.css +2 -0
  105. package/src/css/layout/sidebar-shell.css +67 -0
  106. package/src/css/typography/prose.css +6 -0
  107. package/src/js/ajax.js +148 -0
  108. package/src/js/dialog.js +59 -2
  109. package/src/js/dirty.js +140 -0
  110. package/src/js/dismiss.js +25 -0
  111. package/src/js/events.js +17 -0
  112. package/src/js/focus.js +12 -0
  113. package/src/js/form-submission.js +34 -0
  114. package/src/js/full.js +2 -0
  115. package/src/js/tab.js +16 -2
  116. package/src/js/validation.js +12 -4
  117. package/src/tooling/design-tokens.js +1 -0
  118. package/src/tooling/theme-contrast.js +44 -4
  119. package/tokens.json +1 -0
@@ -86,7 +86,7 @@ select {
86
86
  --font-width: 100%;
87
87
  --line-height: 1.5;
88
88
  --line-height-tight: 1.25;
89
- --line-height-relaxed: 1.75;
89
+ --line-height-relaxed: 1.6;
90
90
  --font-weight-normal: 400;
91
91
  --font-weight-medium: 500;
92
92
  --font-weight-semibold: 600;
@@ -264,6 +264,9 @@ select {
264
264
  the hovered soft fill instead (theme.css); this mix is the fallback a
265
265
  theme without hooks falls back to. */
266
266
  --soft-fg-mix: 100%;
267
+ /* Control edge: the share of ink in --border-control (theme.css). Raise it
268
+ when a tinted or translucent surface pulls the edge under 3:1. */
269
+ --border-control-mix: 45%;
267
270
 
268
271
  /* Shared icon assets. Override these URLs when a strict CSP disallows data:. */
269
272
  --icon-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%238a8594' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
@@ -454,13 +457,32 @@ select {
454
457
  --surface-opaque: var(--surface);
455
458
  --surface-solid-fg: var(--surface);
456
459
  /* The edge that tells a control apart from the surface, where --border only
457
- separates surfaces: fields, choices, switch, OTP cells, choice cards. */
460
+ separates surfaces: fields, choices, switch, OTP cells, choice cards.
461
+ Derived from the ink: the default palette clears 3:1 against the surface
462
+ in both schemes (WCAG 1.4.11: an unchecked radio is identified by its edge
463
+ alone), where --border sat at ~1.3:1. The mix is not a guarantee for every
464
+ palette: a low-contrast ink lands under 3:1, which the contrast report
465
+ (control edge) shows. Mixed into the opaque surface so a translucent theme
466
+ still draws a solid edge. The plain fallback matters: without color-mix
467
+ the var() is invalid at computed time and takes the whole border
468
+ shorthand with it, erasing every field and choice outline. */
458
469
  --border-control: var(--border);
459
470
  /* Inherited resting field fill, shared with external control bridges.
460
471
  Component state rules still own readonly, disabled and invalid fills. */
461
472
  --control-default-bg: var(--surface);
462
473
  }
463
474
 
475
+ @supports (color: color-mix(in oklab, red, white)) {
476
+ :root,
477
+ [data-theme] {
478
+ --border-control: color-mix(
479
+ in oklab,
480
+ var(--text) var(--border-control-mix),
481
+ var(--surface-opaque)
482
+ );
483
+ }
484
+ }
485
+
464
486
  /* Soft foreground hooks — the soft ink is the intent rebated toward the local
465
487
  text so it keeps 4.5:1 against the soft hover fill (the resting fill carries
466
488
  the extra margin; variants.css soft recipe). Deliberately scoped to the
@@ -1145,6 +1167,9 @@ small {
1145
1167
 
1146
1168
  /* Overflow containment is global on `pre` (base.css); only the box is prose's. */
1147
1169
  .prose :where(pre) {
1170
+ /* why: code is scanned line by line, not read as running text; the prose
1171
+ reading leading spread a block to ~1.7 lines per line of code. */
1172
+ line-height: var(--line-height);
1148
1173
  padding: 1em;
1149
1174
  border: var(--border-width) solid var(--border);
1150
1175
  border-radius: var(--radius);
@@ -1174,6 +1199,9 @@ small {
1174
1199
  }
1175
1200
 
1176
1201
  .prose :where(table) {
1202
+ /* why: tables are scanned cell by cell, like code; the reading leading made
1203
+ every wrapped cell tall and loose. */
1204
+ line-height: var(--line-height);
1177
1205
  inline-size: 100%;
1178
1206
  border-collapse: collapse;
1179
1207
  }
@@ -1328,6 +1356,7 @@ small {
1328
1356
  * .center centered content column
1329
1357
  * .frame fixed-ratio media frame
1330
1358
  * .app-shell full-height application shell
1359
+ * .sidebar-shell persistent side region + main, each scrolling; drawer below 64rem
1331
1360
  * .app-layout topbar + scrolling main + bottom/side app navigation
1332
1361
  * .media fixed media + flexible content
1333
1362
  * .switcher peer regions: all horizontal or all stacked
@@ -1510,6 +1539,74 @@ small {
1510
1539
  flex-direction: column;
1511
1540
  }
1512
1541
 
1542
+ /*
1543
+ * Sidebar shell — a persistent side region beside the main one on a wide
1544
+ * viewport, each scrolling on its own; below 64rem the side region hides and
1545
+ * the document scrolls. The page mirrors the navigation into a dialog.drawer.
1546
+ *
1547
+ * Docs: docs/pages/layout/sidebar-shell.md
1548
+ * Design note: docs/design-notes/app-ui.md#sidebar-shell
1549
+ *
1550
+ * Structure: two direct children, an `aside` (side) and one other element
1551
+ * (main). The breakpoint is a literal; a custom property cannot sit in a
1552
+ * media condition.
1553
+ *
1554
+ * Public hooks:
1555
+ * --sidebar-shell-size
1556
+ */
1557
+ .sidebar-shell {
1558
+ --sidebar-shell-size: 16rem;
1559
+ }
1560
+
1561
+ /* Hidden below, never shown above: the aside keeps the author's display (an
1562
+ aside.stack). Where range syntax is unsupported the rule drops and the
1563
+ sidebar stacks above the content, still reachable. Screen only: a printed
1564
+ page is narrower than 64rem, and print never hides framework content. */
1565
+ @media screen and (width < 64rem) {
1566
+ .sidebar-shell > aside {
1567
+ display: none;
1568
+ }
1569
+ }
1570
+
1571
+ @media (width >= 64rem) {
1572
+ .sidebar-shell {
1573
+ display: grid;
1574
+ grid-template-columns: var(--sidebar-shell-size) minmax(0, 1fr);
1575
+ block-size: var(--viewport-block);
1576
+ }
1577
+
1578
+ /* Each region is its own scroller, so the sidebar stays put. min-block-size
1579
+ lets the grid row hold them to the viewport instead of their content. */
1580
+ .sidebar-shell > * {
1581
+ min-block-size: 0;
1582
+ overflow: auto;
1583
+ overscroll-behavior: contain;
1584
+ }
1585
+
1586
+ .sidebar-shell > aside {
1587
+ grid-column: 1;
1588
+ grid-row: 1;
1589
+ }
1590
+
1591
+ .sidebar-shell > :not(aside) {
1592
+ grid-column: 2;
1593
+ grid-row: 1;
1594
+ }
1595
+ }
1596
+
1597
+ /* Paper is one flow, side then main, nothing clipped by a scroller. Leaving
1598
+ the sidebar off the page is the application's print stylesheet. */
1599
+ @media print {
1600
+ .sidebar-shell {
1601
+ display: block;
1602
+ block-size: auto;
1603
+ }
1604
+
1605
+ .sidebar-shell > * {
1606
+ overflow: visible;
1607
+ }
1608
+ }
1609
+
1513
1610
  /*
1514
1611
  * Specialized application shell recipe: one exact DOM structure uses a
1515
1612
  * bottom navigation bar when narrow and a labelled side navigation when space
@@ -3021,16 +3118,18 @@ small {
3021
3118
  block-size: 1em;
3022
3119
  }
3023
3120
 
3024
- /* Leading: input gets start padding to clear the icon */
3121
+ /* Leading: input gets start padding to clear the icon. The text sits half a
3122
+ pad from the icon: a full pad, the same as the icon's inset from the edge,
3123
+ read as two separate items rather than an icon labelling its field. */
3025
3124
  .input-icon > :first-child:where(:not(.input)) ~ .input {
3026
- padding-inline-start: calc(var(--control-pad-x) * 2 + var(--input-icon-size));
3125
+ padding-inline-start: calc(var(--control-pad-x) * 1.5 + var(--input-icon-size));
3027
3126
  }
3028
3127
 
3029
3128
  /* Trailing: the input has a following sibling → end padding. Not tied to the
3030
3129
  input being first child, so a leading icon does not disable the trailing
3031
3130
  icon's reserved space. */
3032
3131
  .input-icon > .input:where(:not(:last-child)) {
3033
- padding-inline-end: calc(var(--control-pad-x) * 2 + var(--input-icon-size));
3132
+ padding-inline-end: calc(var(--control-pad-x) * 1.5 + var(--input-icon-size));
3034
3133
  }
3035
3134
 
3036
3135
  /*
@@ -3669,11 +3768,11 @@ small {
3669
3768
  * rows sit one gap apart like columns. Edge, selection ring and focus ring all
3670
3769
  * belong to the visible swatch.
3671
3770
  *
3672
- * The color is arbitrary, so nothing drawn on it may assume a contrast: the
3673
- * selected mark is a double ring (--text outside, --surface-opaque inside) that
3674
- * reads on any fill, and a hairline edge keeps a near-white color apart from
3675
- * the page. ::before opts out of forced colors to keep the color, so it takes
3676
- * system colors itself there.
3771
+ * The color is arbitrary, so nothing is drawn on it: the selected mark is a
3772
+ * --text ring outside the swatch (::after), past a transparent gap, so it reads
3773
+ * on any color and any background and leaves the color whole. A hairline edge
3774
+ * keeps a near-white color apart from the page. Both pseudo-elements opt out of
3775
+ * forced colors to keep the color, so they take system colors themselves there.
3677
3776
  *
3678
3777
  * Without :has() the native radio stays visible in the swatch and carries the
3679
3778
  * state; the ring needs :has() to mirror it.
@@ -3681,16 +3780,18 @@ small {
3681
3780
  * Public hooks:
3682
3781
  * --color-swatch-value (fallback-only: the color, set per swatch)
3683
3782
  * --color-swatch-size
3684
- * --color-swatch-radius
3783
+ * --color-swatch-radius (fallback-only: set it on the palette or a swatch)
3685
3784
  */
3686
3785
  .color-swatch {
3687
3786
  /* The .switch track height (switch.css); a browser test holds them equal. */
3688
3787
  --color-swatch-size: calc(var(--choice-control-size) + 0.125em);
3689
- --color-swatch-radius: var(--radius-full);
3690
3788
  /* Internal: what the hit area adds to the swatch, half on each side. One gap
3691
3789
  at most, so two neighbours never claim the same point — a wider reach let
3692
3790
  the next swatch take a click on this one's center. */
3693
3791
  --color-swatch-reach: clamp(0px, var(--control-size) - var(--color-swatch-size), var(--gap));
3792
+ /* Internal: how far the selection ring (gap + stroke) reaches past the
3793
+ swatch. The focus ring moves out by as much on a checked swatch. */
3794
+ --color-swatch-ring: 4px;
3694
3795
 
3695
3796
  position: relative;
3696
3797
  display: inline-grid;
@@ -3722,13 +3823,29 @@ small {
3722
3823
  block-size: var(--color-swatch-size);
3723
3824
  box-sizing: border-box;
3724
3825
  border: var(--border-width) solid var(--border-control);
3725
- border-radius: var(--color-swatch-radius);
3826
+ border-radius: var(--color-swatch-radius, var(--radius-full));
3726
3827
  background: var(--color-swatch-value, transparent) padding-box;
3727
3828
  /* The color is the content, as on .color (native.css). */
3728
3829
  forced-color-adjust: none;
3729
- transition:
3730
- border-color var(--duration),
3731
- box-shadow var(--duration);
3830
+ transition: border-color var(--duration);
3831
+ }
3832
+
3833
+ /* Selection ring, drawn on every swatch and colored when checked. Its negative
3834
+ margin lays it out at the swatch size: a ring wider than the grid track
3835
+ would widen it and push the swatch off-center in a tight palette. */
3836
+ .color-swatch::after {
3837
+ content: "";
3838
+ grid-area: 1 / 1;
3839
+ inline-size: calc(var(--color-swatch-size) + 2 * var(--color-swatch-ring));
3840
+ block-size: calc(var(--color-swatch-size) + 2 * var(--color-swatch-ring));
3841
+ margin: calc(-1 * var(--color-swatch-ring));
3842
+ box-sizing: border-box;
3843
+ border: calc(var(--color-swatch-ring) / 2) solid transparent;
3844
+ border-radius: calc(var(--color-swatch-radius, var(--radius-full)) + var(--color-swatch-ring));
3845
+ pointer-events: none;
3846
+ /* The gap stays transparent; forced colors would paint it. */
3847
+ forced-color-adjust: none;
3848
+ transition: border-color var(--duration);
3732
3849
  }
3733
3850
 
3734
3851
  /* Shares the swatch's cell and paints after ::before, so a native radio left
@@ -3760,10 +3877,8 @@ small {
3760
3877
  border-color: var(--text-subtle);
3761
3878
  }
3762
3879
 
3763
- .color-swatch:has(> input:checked)::before {
3764
- box-shadow:
3765
- inset 0 0 0 2px var(--text),
3766
- inset 0 0 0 4px var(--surface-opaque);
3880
+ .color-swatch:has(> input:checked)::after {
3881
+ border-color: var(--text);
3767
3882
  }
3768
3883
 
3769
3884
  /* The ring goes around the visible swatch, not the larger hit area. */
@@ -3781,6 +3896,11 @@ small {
3781
3896
  outline-offset: var(--focus-outline-offset);
3782
3897
  }
3783
3898
 
3899
+ /* Outside the selection ring, so the two never share a stroke. */
3900
+ .color-swatch:has(> input:checked:focus-visible)::before {
3901
+ outline-offset: calc(var(--focus-outline-offset) + var(--color-swatch-ring));
3902
+ }
3903
+
3784
3904
  .color-swatch:disabled {
3785
3905
  opacity: var(--disabled-opacity);
3786
3906
  cursor: not-allowed;
@@ -3800,10 +3920,8 @@ small {
3800
3920
  border-color: CanvasText;
3801
3921
  }
3802
3922
 
3803
- .color-swatch:has(> input:checked)::before {
3804
- box-shadow:
3805
- inset 0 0 0 2px CanvasText,
3806
- inset 0 0 0 4px Canvas;
3923
+ .color-swatch:has(> input:checked)::after {
3924
+ border-color: CanvasText;
3807
3925
  }
3808
3926
 
3809
3927
  .color-swatch:disabled::before {
@@ -3834,6 +3952,16 @@ small {
3834
3952
  pointer: fine
3835
3953
  ) {
3836
3954
  @supports (appearance: base-select) {
3955
+ /* why: base-select brings a UA padding-block (0.25em) that the native
3956
+ select lacks; with a 24px line it pushed a .compact select to 34px
3957
+ against --control-size 32px. min-block-size and align-items already
3958
+ center the value. Zero specificity: the reset only has to beat the UA
3959
+ sheet, and at (0,3,0) it erased the headroom .floating-field reserves,
3960
+ so the floated label sat on the value. */
3961
+ :where(.select:not([multiple], .native, [size]:not([size="1"]))) {
3962
+ padding-block: 0;
3963
+ }
3964
+
3837
3965
  .select:not([multiple], .native, [size]:not([size="1"])) {
3838
3966
  appearance: base-select;
3839
3967
  align-items: center;
@@ -4282,6 +4410,9 @@ small {
4282
4410
  }
4283
4411
 
4284
4412
  .btn.icon-only {
4413
+ /* why: beside a full-width control (.join, a flex row) it would share the
4414
+ shrink and stop being square. */
4415
+ flex: none;
4285
4416
  inline-size: var(--btn-min-size);
4286
4417
  block-size: var(--btn-min-size);
4287
4418
  padding: 0;
@@ -5050,6 +5181,10 @@ a.badge[aria-disabled="true"] {
5050
5181
  border: 0;
5051
5182
  border-inline-start: var(--alert-border-inline-start-width, 4px) solid
5052
5183
  var(--alert-border-inline-start-color, var(--intent, var(--neutral)));
5184
+ /* why: a thick flag under the large radius curves into a crescent. The
5185
+ leading corners take the small radius so the flag stays a straight bar. */
5186
+ border-start-start-radius: var(--radius-sm);
5187
+ border-end-start-radius: var(--radius-sm);
5053
5188
  }
5054
5189
 
5055
5190
  /* Admonition — structured static box with a tinted title bar and a body
@@ -5350,6 +5485,9 @@ a.badge[aria-disabled="true"] {
5350
5485
  /* Keep the surface anchored to the viewport in the top layer. This also
5351
5486
  provides the containing block for the absolutely positioned close button. */
5352
5487
  position: fixed;
5488
+ /* Restates the UA centering: a modal authored inside .stack or .cluster
5489
+ would otherwise take their child margin reset and pin to the top. */
5490
+ margin: auto;
5353
5491
 
5354
5492
  /* The root is :where(dialog).modal (0-1-0), so a single author class can
5355
5493
  outrank these defaults — no fallback-only indirection needed here. */
@@ -5701,14 +5839,17 @@ html.has-modal-open.had-scrollbar {
5701
5839
  * navigation content inside uses .nav-link and .accordion, which carry their
5702
5840
  * own link/summary styling.
5703
5841
  *
5842
+ * Sides: start (default), end, and bottom (a bottom sheet) via data-side.
5843
+ *
5704
5844
  * Public hooks:
5705
- * --drawer-size
5845
+ * --drawer-size (width on start/end, maximum height on bottom)
5706
5846
  * --drawer-pad
5707
5847
  *
5708
5848
  * The corner close control is .close (components/close.css).
5709
5849
  *
5710
5850
  * Internal:
5711
5851
  * --drawer-closed-translate (side/RTL positioning state)
5852
+ * --drawer-closed-transform (closed position; bottom changes its axis)
5712
5853
  * --drawer-focus-bleed
5713
5854
  * --drawer-close-reserve (header room for a corner close; zero without a close)
5714
5855
  * --drawer-motion-duration (shared by panel and ::backdrop so exit duration
@@ -5721,6 +5862,9 @@ html.has-modal-open.had-scrollbar {
5721
5862
  /* The inset a direct .bleed child cancels (components/bleed.css). */
5722
5863
  --surface-pad: var(--drawer-pad);
5723
5864
  --drawer-closed-translate: -100%;
5865
+ /* The closed position as one transform, so a side can change axis without
5866
+ a rule that would tie with [open] on specificity. */
5867
+ --drawer-closed-transform: translateX(var(--drawer-closed-translate));
5724
5868
  /* Header room for a corner close. Unconditional baseline: without :has()
5725
5869
  (Degraded tier) a header keeps too much room rather than a title running
5726
5870
  under the close. Zeroed when the drawer has no close. */
@@ -5759,7 +5903,7 @@ html.has-modal-open.had-scrollbar {
5759
5903
  color: var(--text);
5760
5904
  box-shadow: var(--shadow);
5761
5905
  opacity: 0;
5762
- transform: translateX(var(--drawer-closed-translate));
5906
+ transform: var(--drawer-closed-transform);
5763
5907
  /* Unsupported discrete behavior drops alone, preserving opacity/transform. */
5764
5908
  transition-property: opacity, transform, overlay, display;
5765
5909
  transition-duration: var(--drawer-motion-duration);
@@ -5813,10 +5957,32 @@ html.has-modal-open.had-scrollbar {
5813
5957
  opacity: 1;
5814
5958
  }
5815
5959
 
5960
+ /* Bottom sheet: the same drawer on the block-end edge, sized by its content
5961
+ up to --drawer-size, which reads as a height here. :where() keeps the size
5962
+ at the base rule's weight, so an application class still overrides it. */
5963
+ :where(dialog).drawer:where([data-side="bottom"]) {
5964
+ --drawer-size: 32rem;
5965
+ --drawer-closed-transform: translateY(100%);
5966
+ }
5967
+
5968
+ :where(dialog).drawer[data-side="bottom"] {
5969
+ inset-block: auto 0;
5970
+ inset-inline: 0;
5971
+ inline-size: 100%;
5972
+ block-size: auto;
5973
+ max-block-size: min(calc(var(--viewport-block) * 0.85), var(--drawer-size));
5974
+ /* The home indicator sits over the panel's last line otherwise. */
5975
+ padding-block-end: calc(var(--drawer-pad) + env(safe-area-inset-bottom, 0px));
5976
+ border-inline-end: 0;
5977
+ border-block-start: var(--border-width) solid var(--border);
5978
+ border-start-start-radius: var(--radius-lg);
5979
+ border-start-end-radius: var(--radius-lg);
5980
+ }
5981
+
5816
5982
  @starting-style {
5817
5983
  :where(dialog).drawer[open] {
5818
5984
  opacity: 0;
5819
- transform: translateX(var(--drawer-closed-translate));
5985
+ transform: var(--drawer-closed-transform);
5820
5986
  }
5821
5987
 
5822
5988
  :where(dialog).drawer[open]::backdrop {
@@ -5844,6 +6010,12 @@ html.has-modal-open.had-scrollbar {
5844
6010
  under the header or footer. */
5845
6011
  margin: calc(var(--drawer-focus-bleed) * -1);
5846
6012
  padding: var(--drawer-focus-bleed);
6013
+ /* The scrollport reaches the panel's inline-end edge and takes the panel
6014
+ padding back inside: the scrollbar sits on the edge and the content keeps
6015
+ --drawer-pad on both sides. Inside the content box, the scrollbar sat a
6016
+ focus bleed from the text with the panel padding wasted beyond it. */
6017
+ margin-inline-end: calc(var(--drawer-pad) * -1);
6018
+ padding-inline-end: var(--drawer-pad);
5847
6019
  overflow: auto;
5848
6020
  overscroll-behavior: contain;
5849
6021
  }
@@ -5997,6 +6169,9 @@ picture.bleed > img {
5997
6169
  * Runtime marker (managed by surface.js): .is-open marks an open flyout.
5998
6170
  * --surface-anchor-width is set by surface.js while an open flyout is positioned.
5999
6171
  *
6172
+ * Modifier: .scrollable keeps a header and footer in view while the one body
6173
+ * region between them scrolls.
6174
+ *
6000
6175
  * Public hooks:
6001
6176
  * --flyout-inline-size
6002
6177
  * --flyout-max-inline-size
@@ -6004,6 +6179,7 @@ picture.bleed > img {
6004
6179
  *
6005
6180
  * Internal:
6006
6181
  * --menu-item-size (derived from --control-size for menu rows)
6182
+ * --flyout-focus-bleed (focus reserve of the .scrollable body)
6007
6183
  * --available-height (measured by the positioner)
6008
6184
  * --surface-anchor-width (measured by surface.js)
6009
6185
  */
@@ -6154,6 +6330,39 @@ picture.bleed > img {
6154
6330
  margin: 0;
6155
6331
  }
6156
6332
 
6333
+ /* .scrollable: the .modal.scrollable contract on a panel with a header, one
6334
+ body and a footer — the header and footer keep their size and the body
6335
+ absorbs the overflow, so an Apply row stays in view however long the list
6336
+ or however little room the positioner leaves. Opt-in, because a menu or a
6337
+ multi-section nav panel has no single body to scroll. :where() keeps the
6338
+ display at .flyout's weight, so [hidden] and the closed popover still win
6339
+ whatever the source order. */
6340
+ .flyout:where(.scrollable) {
6341
+ display: flex;
6342
+ flex-direction: column;
6343
+ overflow: hidden;
6344
+ }
6345
+
6346
+ .flyout.scrollable > :is(header, footer) {
6347
+ flex: none;
6348
+ }
6349
+
6350
+ .flyout.scrollable > :not(:is(header, footer)) {
6351
+ /* Declared here, not as a :root alias: an inherited alias arrives already
6352
+ computed, so a --focus-ring-width override on the panel would not reach
6353
+ it. */
6354
+ --flyout-focus-bleed: calc(var(--focus-outline-offset) + var(--focus-ring-width));
6355
+
6356
+ flex: 1 1 auto;
6357
+ min-block-size: 0;
6358
+ /* Keep focus paint inside the clip without moving the content: the reserve
6359
+ reaches into the panel gap and padding, both --space-10 by default. */
6360
+ margin: calc(var(--flyout-focus-bleed) * -1);
6361
+ padding: var(--flyout-focus-bleed);
6362
+ overflow: auto;
6363
+ overscroll-behavior: contain;
6364
+ }
6365
+
6157
6366
  /* Vertical dividers — .menu-separator (menu.css) is the canonical way to
6158
6367
  separate menu items. Flyout panels that are not menus use auto grid gap
6159
6368
  declared on .flyout itself. */
@@ -6558,12 +6767,6 @@ picture.bleed > img {
6558
6767
  margin-block-start: 0;
6559
6768
  }
6560
6769
 
6561
- .accordion details > summary + ul,
6562
- .accordion details > summary + ol {
6563
- margin: 0;
6564
- padding-inline-start: 2rem;
6565
- }
6566
-
6567
6770
  /* Flush — the shell is dropped and only the shared item separators remain.
6568
6771
  Zero inline padding puts the group edge to edge inside the surface that
6569
6772
  already frames it, so no override is repeated per embedding. */
@@ -6584,6 +6787,16 @@ picture.bleed > img {
6584
6787
  --surface-pad: 0px;
6585
6788
  }
6586
6789
 
6790
+ /* A list panel keeps its marker gutter in every treatment. The .flush
6791
+ selector is required, not redundant: .flush zeroes the panel's inline
6792
+ padding at higher specificity, which would push the bullets out of the
6793
+ panel. */
6794
+ .accordion details > summary + :is(ul, ol),
6795
+ .accordion.flush details > summary + :is(ul, ol) {
6796
+ margin: 0;
6797
+ padding-inline-start: 2rem;
6798
+ }
6799
+
6587
6800
  /* Separated — each item owns a full card. The item's own border beats the
6588
6801
  shared details + details separator on specificity alone, so nothing needs
6589
6802
  undoing for the second item onwards. */
@@ -6797,8 +7010,13 @@ picture.bleed > img {
6797
7010
  * shows that spinner as a centered overlay over a faded surface. Buttons keep
6798
7011
  * their spinners inline (e.g. .btn[aria-busy] > .spinner stays inline-flex).
6799
7012
  *
7013
+ * The overlay fades in after --busy-delay, so a fast request leaves the
7014
+ * content untouched instead of flashing it. Reduced motion drops the delay
7015
+ * with every other animation (reset.css): the overlay then shows at once.
7016
+ *
6800
7017
  * Public hooks:
6801
7018
  * --busy-overlay-bg
7019
+ * --busy-delay
6802
7020
  *
6803
7021
  * Internal:
6804
7022
  * --spinner-size (overlay copy of the shared spinner hook)
@@ -6833,6 +7051,26 @@ picture.bleed > img {
6833
7051
  margin: auto;
6834
7052
  display: block;
6835
7053
  }
7054
+
7055
+ @media (prefers-reduced-motion: no-preference) {
7056
+ [aria-busy="true"]:not(.btn):has(> .spinner:last-child)::before {
7057
+ animation: actual-busy-reveal var(--duration-slow) var(--busy-delay, 300ms) ease both;
7058
+ }
7059
+
7060
+ /* Restates the spin: one animation list replaces spinner.css's. */
7061
+ [aria-busy="true"]:not(.btn) > .spinner:last-child {
7062
+ animation:
7063
+ actual-busy-reveal var(--duration-slow) var(--busy-delay, 300ms) ease both,
7064
+ actual-spin var(--duration-spin) linear infinite;
7065
+ }
7066
+ }
7067
+ }
7068
+
7069
+ /* `both` holds the from-frame through the delay. */
7070
+ @keyframes actual-busy-reveal {
7071
+ from {
7072
+ opacity: 0;
7073
+ }
6836
7074
  }
6837
7075
 
6838
7076
  @supports (selector([aria-busy="true"]:has(> .spinner:last-child))) and
@@ -7649,10 +7887,12 @@ a.avatar[aria-disabled="true"] {
7649
7887
  * --rating-color
7650
7888
  * --rating-empty
7651
7889
  * --rating-star
7890
+ * --rating-star-empty (the empty star's shape; the filled one by default)
7652
7891
  * --rating-value (display: the shown value, fractions allowed)
7653
7892
  * --rating-max (display: the number of stars)
7654
7893
  *
7655
7894
  * Internal:
7895
+ * --rating-shape
7656
7896
  * --rating-fill
7657
7897
  * --rating-direction
7658
7898
  */
@@ -7662,10 +7902,12 @@ a.avatar[aria-disabled="true"] {
7662
7902
 
7663
7903
  .rating {
7664
7904
  --rating-size: 1.25rem;
7665
- --rating-gap: 0.1rem;
7905
+ --rating-gap: var(--space-10);
7666
7906
  --rating-color: var(--intent, var(--warning));
7667
7907
  --rating-empty: var(--border);
7668
7908
  --rating-star: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='2 2 16 16'%3E%3Cpath d='M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 0 0 .95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 0 0-.364 1.118l1.07 3.292c.3.922-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 0 0-1.175 0l-2.8 2.034c-.783.57-1.838-.196-1.539-1.118l1.07-3.292a1 1 0 0 0-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 0 0 .951-.69l1.07-3.292Z'/%3E%3C/svg%3E");
7909
+ /* An outline here turns the empty stars into a shape cue (see the docs). */
7910
+ --rating-star-empty: var(--rating-star);
7669
7911
 
7670
7912
  display: inline-flex;
7671
7913
  gap: 0;
@@ -7676,19 +7918,29 @@ a.avatar[aria-disabled="true"] {
7676
7918
  appearance: none;
7677
7919
  flex: 0 0 auto;
7678
7920
  inline-size: calc(var(--rating-size) + var(--rating-gap));
7679
- block-size: var(--rating-size);
7921
+ /* Taller than the star: the hit area grows, the drawing does not. */
7922
+ block-size: calc(var(--rating-size) + var(--space-20));
7680
7923
  margin: 0;
7681
7924
  border: 0;
7682
7925
  background: var(--rating-empty);
7683
7926
  /* Contiguous radio boxes own hit-testing; the centered mask preserves the
7684
- star's proportions while leaving a purely visual gap between values. */
7685
- -webkit-mask: var(--rating-star) center / var(--rating-size) var(--rating-size) no-repeat;
7686
- mask: var(--rating-star) center / var(--rating-size) var(--rating-size) no-repeat;
7927
+ star's proportions while leaving a purely visual gap between values.
7928
+ A rule that fills a star sets --rating-shape, never mask-image: a state
7929
+ selector outranks the forced-colors mask: none below, and its mask-image
7930
+ would clip the native radio there. */
7931
+ -webkit-mask:
7932
+ var(--rating-shape, var(--rating-star-empty)) center / var(--rating-size) var(--rating-size)
7933
+ no-repeat;
7934
+ mask:
7935
+ var(--rating-shape, var(--rating-star-empty)) center / var(--rating-size) var(--rating-size)
7936
+ no-repeat;
7687
7937
  cursor: pointer;
7688
7938
  transition: background-color var(--duration);
7689
7939
  }
7690
7940
 
7691
7941
  .rating > input[type="radio"]:checked {
7942
+ --rating-shape: var(--rating-star);
7943
+
7692
7944
  background: var(--rating-color);
7693
7945
  }
7694
7946
 
@@ -7700,6 +7952,8 @@ a.avatar[aria-disabled="true"] {
7700
7952
  .rating > input[type="radio"]:focus-visible {
7701
7953
  outline: var(--focus-ring-width) solid var(--focus);
7702
7954
  outline-offset: var(--focus-outline-offset);
7955
+ --rating-shape: var(--rating-star);
7956
+
7703
7957
  background: var(--rating-color);
7704
7958
  }
7705
7959
 
@@ -7707,18 +7961,24 @@ a.avatar[aria-disabled="true"] {
7707
7961
  star. The enhancement only adds cumulative checked and hover previews. */
7708
7962
  @supports selector(:has(*)) {
7709
7963
  .rating > input[type="radio"]:has(~ input[type="radio"]:checked) {
7964
+ --rating-shape: var(--rating-star);
7965
+
7710
7966
  background: var(--rating-color);
7711
7967
  }
7712
7968
 
7713
7969
  @media (hover: hover) {
7714
7970
  .rating > input[type="radio"]:not(:disabled):hover,
7715
7971
  .rating > input[type="radio"]:has(~ input[type="radio"]:not(:disabled):hover) {
7972
+ --rating-shape: var(--rating-star);
7973
+
7716
7974
  background: var(--rating-color);
7717
7975
  }
7718
7976
 
7719
7977
  /* A hovered value previews exactly that value: later stars are emptied,
7720
7978
  including a previously checked star beyond the pointer. */
7721
7979
  .rating > input[type="radio"]:not(:disabled):hover ~ input[type="radio"] {
7980
+ --rating-shape: var(--rating-star-empty);
7981
+
7722
7982
  background: var(--rating-empty);
7723
7983
  }
7724
7984
  }
@@ -7749,6 +8009,29 @@ a.avatar[aria-disabled="true"] {
7749
8009
  repeat-x;
7750
8010
  }
7751
8011
 
8012
+ /* The filled share in the filled shape, the rest in the empty one:
8013
+ (filled star ∩ value band) ∪ empty star. With the default empty shape it
8014
+ draws exactly the single layer above. Guarded on purpose: the declaration
8015
+ holds var(), so an engine without composite keywords would not drop it at
8016
+ parse time but invalidate it at computed time, leaving no mask at all — a
8017
+ solid bar. Without it (Chromium before 120), a custom empty shape shows as
8018
+ filled-shape empty stars. */
8019
+ @supports (mask-composite: intersect) {
8020
+ .rating[role="img"] {
8021
+ mask:
8022
+ var(--rating-star) left center / calc(var(--rating-size) + var(--rating-gap))
8023
+ var(--rating-size) repeat-x intersect,
8024
+ linear-gradient(
8025
+ var(--rating-direction),
8026
+ #000 var(--rating-fill),
8027
+ transparent var(--rating-fill)
8028
+ )
8029
+ add,
8030
+ var(--rating-star-empty) left center / calc(var(--rating-size) + var(--rating-gap))
8031
+ var(--rating-size) repeat-x;
8032
+ }
8033
+ }
8034
+
7752
8035
  /* The fill starts at the inline start; only the direction changes, so the
7753
8036
  forced-colors gradient below follows it too. Safari before 16.4 has no
7754
8037
  :dir(); the attribute path is its fallback, as in avatar.css. Each selector
@@ -8484,7 +8767,9 @@ a.avatar[aria-disabled="true"] {
8484
8767
  * list shared with .drawer, fed by the shared --gap token.
8485
8768
  *
8486
8769
  * Public hooks:
8487
- * --state-selected-text (fallback-only: current-link ink, see tokens.css)
8770
+ * --nav-current-bg (fallback-only: current-link fill)
8771
+ * --nav-current-fg (fallback-only: current-link ink)
8772
+ * --nav-list-indent (fallback-only: nested .nav-list inset)
8488
8773
  *
8489
8774
  * Internal:
8490
8775
  * --gap (local value for the shared gap token)
@@ -8535,6 +8820,8 @@ a.avatar[aria-disabled="true"] {
8535
8820
  .nav-link {
8536
8821
  display: inline-flex;
8537
8822
  align-items: center;
8823
+ /* Icon + label rows; a text-only link has one flex item and shows no gap. */
8824
+ gap: var(--space-20);
8538
8825
  min-block-size: var(--control-size-sm);
8539
8826
  padding-block: 0;
8540
8827
  padding-inline: var(--space-20);
@@ -8548,43 +8835,48 @@ a.avatar[aria-disabled="true"] {
8548
8835
  cursor: pointer;
8549
8836
  }
8550
8837
 
8551
- /* nav-link serves two contracts: plain page navigation (aria-current="page")
8552
- and scrollspy, which toggles aria-current="location" on the active link.
8553
- Those two values are the contract; any other, "false" included, is inert.
8554
- Selection never changes text metrics: the shared medium weight is kept and
8555
- the current link is carried by the selected accent. */
8838
+ /* nav-link serves three contracts: plain page navigation (aria-current="page"),
8839
+ scrollspy, which toggles aria-current="location" on the active link, and
8840
+ section navigation (aria-current="true"): a link whose section holds the
8841
+ current page without being it, as on .tab. Those three values are the
8842
+ contract; any other, "false" included, is inert.
8843
+ Selection never changes text metrics: the shared medium weight is kept.
8844
+
8845
+ The current link is neutral: full --text ink over a stronger tint of it,
8846
+ against --text-muted at rest. That is a luminance step on both ink and
8847
+ fill, so the state does not rest on hue. A brand-accent ink was measured
8848
+ and dropped: on light presets the accent is already at 4.5:1 on the page,
8849
+ so any fill strong enough to carry the state pushed it under. */
8556
8850
  .nav-link:hover {
8557
8851
  background: var(--surface-subtle);
8558
8852
  color: var(--text);
8559
8853
  }
8560
8854
 
8561
8855
  /* Current last, equal specificity to :hover (0,2,0): a hovered current link
8562
- keeps the selected accent instead of dropping to --text. The surface fill is
8563
- shared with the hover rule above. */
8564
- .nav-link:is([aria-current="page"], [aria-current="location"]) {
8565
- background: var(--surface-subtle);
8566
- color: var(--state-selected-text, var(--state-selected));
8567
- }
8568
-
8569
- /* On a bar with its own --ui-bg/--ui-fg the fill is a tint of the link's own
8570
- ink, the .btn.ghost hover recipe, so it reads on light and dark bars alike
8571
- instead of snapping back to --surface-subtle. Not --ui-hover-bg: that is the
8572
- bar's own hover and can equal its fill. The ink follows --ui-fg too — the
8573
- selected accent has no contrast pair with an arbitrary bar. The baseline
8574
- above keeps the light chip where color-mix is missing, with ink that is
8575
- legible on it. */
8856
+ keeps its current fill. */
8857
+ .nav-link:is([aria-current="page"], [aria-current="location"], [aria-current="true"]) {
8858
+ background: var(--nav-current-bg, var(--surface-subtle));
8859
+ color: var(--nav-current-fg, var(--text));
8860
+ }
8861
+
8862
+ /* Fills are a tint of the link's own ink, like the .btn.ghost hover, so they
8863
+ read on light and dark bars alike, including a bar with its own
8864
+ --ui-bg/--ui-fg. Not --ui-hover-bg: that is the bar's own hover and can
8865
+ equal its fill. Current is a step above hover (8% vs 5%), so the current
8866
+ link stays apart while another is hovered. Both stay paler than the ghost
8867
+ button: a nav row is wide, and at 18% a full-width current row read as a
8868
+ pressed button. The fill only seconds the ink step, so it needs no 3:1 of
8869
+ its own. The baseline above keeps a light chip where color-mix is
8870
+ missing. */
8576
8871
  @supports (color: color-mix(in oklch, red, white)) {
8577
- .nav-link:is(:hover, [aria-current="page"], [aria-current="location"]) {
8578
- background: color-mix(in oklch, currentColor 10%, transparent);
8579
- }
8580
-
8581
8872
  .nav-link:hover {
8873
+ background: color-mix(in oklch, currentColor 5%, transparent);
8582
8874
  color: var(--ui-fg, var(--text));
8583
8875
  }
8584
8876
 
8585
- /* After :hover so a hovered current link keeps the selected accent. */
8586
- .nav-link:is([aria-current="page"], [aria-current="location"]) {
8587
- color: var(--ui-fg, var(--state-selected-text, var(--state-selected)));
8877
+ .nav-link:is([aria-current="page"], [aria-current="location"], [aria-current="true"]) {
8878
+ background: var(--nav-current-bg, color-mix(in oklch, currentColor 8%, transparent));
8879
+ color: var(--nav-current-fg, var(--ui-fg, var(--text)));
8588
8880
  }
8589
8881
  }
8590
8882
 
@@ -8608,25 +8900,80 @@ a.avatar[aria-disabled="true"] {
8608
8900
  margin: 0;
8609
8901
  }
8610
8902
 
8903
+ /* The positioning context lives on every row link, so becoming current never
8904
+ moves an app-positioned decoration (or the forced-colors trait below) to a
8905
+ new containing block. */
8611
8906
  .nav-list .nav-link {
8612
8907
  position: relative;
8613
8908
  inline-size: 100%;
8614
8909
  }
8615
8910
 
8616
- /* Vertical current indicator: inset inline-start trait in currentColor, so it
8617
- follows the forced palette without a forced-colors block and never touches
8618
- the row separators. Navbar horizontal links keep color + surface only. The
8619
- positioning context lives on every row link, so becoming current never moves
8620
- an app-positioned decoration to a new containing block.
8621
- The trait sits centered in the link's inline padding with rounded ends: flush
8622
- on the edge, a square line read as pasted onto the rounded fill. */
8623
- .nav-list .nav-link:is([aria-current="page"], [aria-current="location"])::before {
8911
+ /* Collapsible group: <details> in a row, <summary class="nav-link"> as its
8912
+ label, a nested .nav-list as its links. The summary takes the link's row,
8913
+ hover and focus; display: inline-flex already drops the list-item marker,
8914
+ the WebKit pseudo is Safari's own. */
8915
+ .nav-list summary.nav-link {
8916
+ list-style: none;
8917
+ }
8918
+
8919
+ .nav-list summary.nav-link::-webkit-details-marker {
8920
+ display: none;
8921
+ }
8922
+
8923
+ /* The open state is the native [open], so the chevron needs no script. */
8924
+ .nav-list summary.nav-link::after {
8624
8925
  content: "";
8625
- position: absolute;
8626
- inset-block: var(--space-20);
8627
- inset-inline-start: calc((var(--space-20) - 2px) / 2);
8628
- border-inline-start: 2px solid currentColor;
8629
- border-radius: var(--radius-full);
8926
+ flex: 0 0 auto;
8927
+ margin-inline-start: auto;
8928
+ inline-size: 1rem;
8929
+ block-size: 1rem;
8930
+ background-color: currentColor;
8931
+ -webkit-mask: var(--icon-chevron) center / contain no-repeat;
8932
+ mask: var(--icon-chevron) center / contain no-repeat;
8933
+ transition: transform var(--duration);
8934
+ }
8935
+
8936
+ .nav-list details[open] > summary.nav-link::after {
8937
+ transform: rotate(180deg);
8938
+ }
8939
+
8940
+ /* A nested list is indented so its labels start under the parent's label,
8941
+ past a 1em leading icon and the link gap. Fallback-only: a base
8942
+ declaration on .nav-list would reset an override at every level. */
8943
+ .nav-list .nav-list {
8944
+ margin-block-start: var(--gap);
8945
+ padding-inline-start: var(--nav-list-indent, calc(1em + var(--space-20)));
8946
+ }
8947
+
8948
+ /* Forced colors drops the fill and maps both inks to LinkText, so the current
8949
+ link would be indistinguishable: it gets a shape instead. A vertical row
8950
+ takes an inline-start trait, centered in the link's inline padding with
8951
+ rounded ends; a horizontal link an underline. */
8952
+ @media (forced-colors: active) {
8953
+ .nav-link:is([aria-current="page"], [aria-current="location"], [aria-current="true"]) {
8954
+ text-decoration: underline;
8955
+ text-underline-offset: 0.25em;
8956
+ }
8957
+
8958
+ .nav-list .nav-link:is([aria-current="page"], [aria-current="location"], [aria-current="true"]) {
8959
+ text-decoration: none;
8960
+ }
8961
+
8962
+ /* The chevron is a mask over a fill that forced colors would remap to
8963
+ Canvas, as in accordion.css. */
8964
+ .nav-list summary.nav-link::after {
8965
+ background-color: CanvasText;
8966
+ }
8967
+
8968
+ .nav-list
8969
+ .nav-link:is([aria-current="page"], [aria-current="location"], [aria-current="true"])::before {
8970
+ content: "";
8971
+ position: absolute;
8972
+ inset-block: var(--space-20);
8973
+ inset-inline-start: calc((var(--space-20) - 2px) / 2);
8974
+ border-inline-start: 2px solid currentColor;
8975
+ border-radius: var(--radius-full);
8976
+ }
8630
8977
  }
8631
8978
 
8632
8979
  /*
@@ -9142,7 +9489,8 @@ a.avatar[aria-disabled="true"] {
9142
9489
  * fill and focus ring, and the native radio stays visible to carry both.
9143
9490
  *
9144
9491
  * One row of equal shares (grid-auto-columns: 1fr), at least --control-size
9145
- * tall so it lines up with .btn and .input. Labels wrap instead of truncating;
9492
+ * tall so it lines up with .btn and .input; .vertical stacks the segments in
9493
+ * one column instead. Labels wrap instead of truncating;
9146
9494
  * a word longer than its share breaks, so the control never overflows its
9147
9495
  * container. A strip too long for one row is .tabs, which scrolls.
9148
9496
  *
@@ -9157,6 +9505,9 @@ a.avatar[aria-disabled="true"] {
9157
9505
  * --segmented-fg
9158
9506
  * --segmented-selected-bg
9159
9507
  * --segmented-selected-border
9508
+ *
9509
+ * Internal:
9510
+ * --segment-min-size
9160
9511
  */
9161
9512
  .segmented {
9162
9513
  --segmented-bg: var(--surface-subtle);
@@ -9194,8 +9545,14 @@ a.avatar[aria-disabled="true"] {
9194
9545
  own min-block-size: a <fieldset> lays its content in an anonymous box
9195
9546
  sized to the content, so a minimum on the track left the segments short.
9196
9547
  A minimum, not a height: a wrapped label grows the whole row. */
9197
- min-block-size: calc(var(--control-size) - 2 * (var(--segmented-pad) + var(--border-width)));
9548
+ --segment-min-size: calc(var(--control-size) - 2 * (var(--segmented-pad) + var(--border-width)));
9549
+
9550
+ min-block-size: var(--segment-min-size);
9551
+ /* why: the block padding gives a wrapped label room, but must never push
9552
+ one line past the minimum: .compact keeps the 16px font in a 32px control,
9553
+ where a fixed 2px made the track 33px against .btn's 32px. */
9198
9554
  padding: calc(var(--space-10) / 2) var(--space-30);
9555
+ padding-block: clamp(0px, (var(--segment-min-size) - 1lh) / 2, var(--space-10) / 2);
9199
9556
  border: 0;
9200
9557
  border-radius: calc(var(--segmented-radius) - var(--segmented-pad));
9201
9558
  background: transparent;
@@ -9216,6 +9573,19 @@ a.avatar[aria-disabled="true"] {
9216
9573
  box-shadow var(--duration);
9217
9574
  }
9218
9575
 
9576
+ /* Vertical: one segment per row, labels at the inline start. .vertical for
9577
+ radios and links, where aria-orientation is not a valid attribute; a
9578
+ vertical tablist already carries aria-orientation (what the tabs runtime
9579
+ reads for Up/Down), so the layout follows it and cannot disagree. */
9580
+ .segmented:is(.vertical, :where([aria-orientation="vertical"])) {
9581
+ grid-auto-flow: row;
9582
+ }
9583
+
9584
+ .segmented:is(.vertical, :where([aria-orientation="vertical"])) > .segment {
9585
+ justify-content: flex-start;
9586
+ text-align: start;
9587
+ }
9588
+
9219
9589
  .segment > input {
9220
9590
  margin: 0;
9221
9591
  }
@@ -9825,6 +10195,20 @@ a.list-item:is([aria-current="page"], [aria-current="true"])::before {
9825
10195
  margin-inline-start: calc(var(--border-width) * -1);
9826
10196
  }
9827
10197
 
10198
+ /* Seam between adjacent filled buttons (default, .solid, .soft): their border
10199
+ is transparent, so "Left Middle Right" read as one button. A quarter of the
10200
+ ink turns that edge into a hairline; the mix keeps a soft rim set by
10201
+ --soft-border-mix. Variants that already draw an edge, or have no fill, keep
10202
+ their border untouched. Chained :not(): a list inside :not() is above
10203
+ the Firefox 78 floor. */
10204
+ .join > .btn + .btn:not(.outline):not(.surface):not(.ghost):not(.link) {
10205
+ border-inline-start-color: color-mix(
10206
+ in oklab,
10207
+ var(--btn-border-color, var(--btn-border)),
10208
+ var(--btn-fg) 25%
10209
+ );
10210
+ }
10211
+
9828
10212
  .join > :is(:hover, :focus, :focus-within) {
9829
10213
  z-index: 1;
9830
10214
  }