actual-css 0.19.4 → 0.20.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 (95) hide show
  1. package/CHANGELOG.md +67 -0
  2. package/README.md +6 -6
  3. package/components.json +6 -3
  4. package/dist/actual.full.css +249 -50
  5. package/dist/actual.full.js +2 -2
  6. package/dist/actual.full.min.css +1 -1
  7. package/dist/types/menu.d.ts +2 -5
  8. package/docs/pages/components/accordion.md +11 -6
  9. package/docs/pages/components/alert.md +64 -62
  10. package/docs/pages/components/avatar.md +12 -12
  11. package/docs/pages/components/badge.md +15 -15
  12. package/docs/pages/components/breadcrumb.md +10 -8
  13. package/docs/pages/components/button.md +56 -7
  14. package/docs/pages/components/card.md +21 -21
  15. package/docs/pages/components/dialog.md +97 -69
  16. package/docs/pages/components/drawer.md +33 -33
  17. package/docs/pages/components/indicator.md +12 -12
  18. package/docs/pages/components/navbar.md +41 -9
  19. package/docs/pages/components/pagination.md +7 -7
  20. package/docs/pages/components/progress.md +18 -13
  21. package/docs/pages/components/rating.md +19 -19
  22. package/docs/pages/components/reveal.md +2 -0
  23. package/docs/pages/components/segmented.md +35 -31
  24. package/docs/pages/components/skeleton.md +10 -8
  25. package/docs/pages/components/spinner.md +21 -15
  26. package/docs/pages/components/table.md +26 -28
  27. package/docs/pages/enhancements/flyout.md +94 -43
  28. package/docs/pages/enhancements/in-view.md +3 -1
  29. package/docs/pages/enhancements/scrollspy.md +51 -18
  30. package/docs/pages/enhancements/tabs.md +43 -37
  31. package/docs/pages/enhancements/tooltip.md +4 -2
  32. package/docs/pages/forms/ajax.md +66 -0
  33. package/docs/pages/forms/choice-cards.md +8 -8
  34. package/docs/pages/forms/color-swatches.md +12 -12
  35. package/docs/pages/forms/form-actions.md +23 -0
  36. package/docs/pages/forms/joined-controls.md +8 -8
  37. package/docs/pages/forms/labels.md +11 -11
  38. package/docs/pages/forms/overview.md +35 -29
  39. package/docs/pages/forms/states-and-sizes.md +9 -9
  40. package/docs/pages/forms/switch.md +35 -2
  41. package/docs/pages/forms/validation.md +16 -16
  42. package/docs/pages/foundations/theming.md +32 -2
  43. package/docs/pages/foundations/tokens.md +18 -16
  44. package/docs/pages/guides/coding-agents.md +18 -0
  45. package/docs/pages/guides/introduction.md +1 -1
  46. package/llms.txt +3 -3
  47. package/package.json +5 -5
  48. package/reserved-classes.json +1 -0
  49. package/skills/actual-css/SKILL.md +7 -0
  50. package/src/cli/actual-css.js +3 -3
  51. package/src/css/components/badge.css +10 -6
  52. package/src/css/components/button.css +20 -7
  53. package/src/css/components/join.css +14 -4
  54. package/src/css/components/navbar.css +83 -1
  55. package/src/css/components/pagination.css +3 -1
  56. package/src/css/components/segmented.css +27 -7
  57. package/src/css/core/theme.css +11 -9
  58. package/src/css/core/tokens.css +7 -1
  59. package/src/css/core/variants.css +2 -0
  60. package/src/css/effects/reveal.css +15 -6
  61. package/src/css/forms/control.css +11 -1
  62. package/src/css/forms/form.css +14 -4
  63. package/src/css/forms/switch.css +32 -3
  64. package/src/js/ajax.js +18 -1
  65. package/src/js/context-menu.js +1 -3
  66. package/src/js/flyout.js +14 -5
  67. package/src/js/in-view.js +41 -30
  68. package/src/js/menu.js +9 -21
  69. package/src/js/surface.js +38 -0
  70. package/src/tooling/design-tokens.js +1 -0
  71. package/src/tooling/theme-contrast.js +24 -9
  72. package/tokens.json +1 -0
  73. package/docs/design-notes/accessibility-decisions.md +0 -63
  74. package/docs/design-notes/app-ui.md +0 -67
  75. package/docs/design-notes/architecture.md +0 -70
  76. package/docs/design-notes/browser-support.md +0 -239
  77. package/docs/design-notes/cascade-layer.md +0 -74
  78. package/docs/design-notes/column-layout.md +0 -260
  79. package/docs/design-notes/css-anchor.md +0 -87
  80. package/docs/design-notes/enhancement-contract.md +0 -193
  81. package/docs/design-notes/forced-colors.md +0 -123
  82. package/docs/design-notes/grid.md +0 -785
  83. package/docs/design-notes/motion-cost.md +0 -62
  84. package/docs/design-notes/naming.md +0 -71
  85. package/docs/design-notes/platform-alignment.md +0 -602
  86. package/docs/design-notes/popover-manual-poc.md +0 -328
  87. package/docs/design-notes/references.md +0 -336
  88. package/docs/design-notes/rich-text.md +0 -61
  89. package/docs/design-notes/spacing-units.md +0 -286
  90. package/docs/design-notes/steps.md +0 -776
  91. package/docs/design-notes/surface-reparenting.md +0 -130
  92. package/docs/design-notes/tokens.md +0 -166
  93. package/docs/design-notes/tooltip-coordinate-space.md +0 -130
  94. package/docs/design-notes/widget-primitives.md +0 -144
  95. package/docs/navigation.json +0 -176
@@ -4,6 +4,73 @@
4
4
 
5
5
  **Related terms:** modal, alert dialog, confirmation dialog.
6
6
 
7
+ ## Information modal
8
+
9
+ Use this shape for contextual information or lightweight secondary content. It
10
+ has no action button; the header close button dismisses the dialog.
11
+
12
+ ```html demo
13
+ <button class="btn"
14
+ type="button"
15
+ commandfor="details-dialog"
16
+ command="show-modal"
17
+ aria-haspopup="dialog"
18
+ aria-controls="details-dialog">
19
+ View details
20
+ </button>
21
+
22
+ <dialog class="modal"
23
+ id="details-dialog"
24
+ closedby="any"
25
+ data-dialog-dismissible>
26
+ <button class="close"
27
+ type="button"
28
+ commandfor="details-dialog"
29
+ command="request-close"
30
+ aria-controls="details-dialog"
31
+ aria-label="Close dialog"></button>
32
+
33
+ <div class="stack">
34
+ <header>
35
+ <hgroup>
36
+ <h3>Release details</h3>
37
+ <p>Changes included in this version.</p>
38
+ </hgroup>
39
+ </header>
40
+
41
+ <div>
42
+ <p>The release improves dialog behavior, scroll handling, and progressive enhancement for modern browsers.</p>
43
+ <p>There are no decisions to make here; the content can simply be dismissed when finished.</p>
44
+ </div>
45
+ </div>
46
+ </dialog>
47
+ ```
48
+
49
+ ## Usage
50
+
51
+ Modals use the platform-native `<dialog class="modal">` element with `commandfor` and `command` buttons.
52
+
53
+ Use `command="show-modal"` to open a modal dialog, or `command="--show"` to open
54
+ it non-modally.
55
+
56
+ Add `aria-haspopup="dialog"` and `aria-controls="<id>"` to opening buttons so
57
+ their semantics are present before either native or framework JavaScript runs.
58
+ The command runtime is stateless and does not pre-scan triggers.
59
+
60
+ Use `command="request-close"` for cancel-style buttons so close requests go
61
+ through the dialog's cancel lifecycle.
62
+
63
+ When a flyout command opens a dialog, closing the dialog returns focus to the
64
+ command if it can still receive focus, or to the button that opened the flyout.
65
+
66
+ Use `closedby="any"` as the no-JavaScript light-dismiss path: the native dialog
67
+ closes on backdrop click and Escape. Add `data-dialog-dismissible` so the
68
+ optional runtime takes over backdrop click and closes with the dialog's
69
+ transition; it rewrites `closedby="any"` to `closedby="closerequest"` so the
70
+ native dialog and the runtime never double-handle. `data-dialog-dismissible`
71
+ only gates backdrop click — Escape and explicit close requests always close,
72
+ unless the application cancels the `actual:dialog-cancel` event.
73
+
7
74
  ## Class reference
8
75
 
9
76
  | Class | Kind | Description |
@@ -73,31 +140,6 @@ The `.scrollable` row template follows the regions the wrapper actually holds,
73
140
  so a modal without a header, without a footer, or with an external header all
74
141
  keep the footer reachable and the body scrollable.
75
142
 
76
- ## Usage
77
-
78
- Modals use the platform-native `<dialog class="modal">` element with `commandfor` and `command` buttons.
79
-
80
- Use `command="show-modal"` to open a modal dialog, or `command="--show"` to open
81
- it non-modally.
82
-
83
- Add `aria-haspopup="dialog"` and `aria-controls="<id>"` to opening buttons so
84
- their semantics are present before either native or framework JavaScript runs.
85
- The command runtime is stateless and does not pre-scan triggers.
86
-
87
- Use `command="request-close"` for cancel-style buttons so close requests go
88
- through the dialog's cancel lifecycle.
89
-
90
- When a flyout command opens a dialog, closing the dialog returns focus to the
91
- command if it can still receive focus, or to the button that opened the flyout.
92
-
93
- Use `closedby="any"` as the no-JavaScript light-dismiss path: the native dialog
94
- closes on backdrop click and Escape. Add `data-dialog-dismissible` so the
95
- optional runtime takes over backdrop click and closes with the dialog's
96
- transition; it rewrites `closedby="any"` to `closedby="closerequest"` so the
97
- native dialog and the runtime never double-handle. `data-dialog-dismissible`
98
- only gates backdrop click — Escape and explicit close requests always close,
99
- unless the application cancels the `actual:dialog-cancel` event.
100
-
101
143
  ## Alert dialog
102
144
 
103
145
  Use this shape when the dialog interrupts the flow and asks for a decision. It
@@ -105,6 +147,8 @@ has no close icon and no light dismiss; the footer actions are the way out.
105
147
  `closedby="none"` keeps Escape and backdrop clicks from closing it, so a
106
148
  critical confirmation cannot be dismissed accidentally. With the optional
107
149
  runtime, backdrop clicks give a small static feedback instead of closing.
150
+ Name both outcomes on the buttons, “Keep project” and “Delete project”, so
151
+ each one reads without the question above it.
108
152
 
109
153
  ```html demo
110
154
  <button class="btn"
@@ -128,11 +172,11 @@ runtime, backdrop clicks give a small static feedback instead of closing.
128
172
  </div>
129
173
 
130
174
  <footer class="cluster justify-content-end">
131
- <button class="btn outline" value="cancel">Cancel</button>
175
+ <button class="btn outline" value="cancel">Keep project</button>
132
176
 
133
177
  <button class="btn danger"
134
178
  value="delete">
135
- Delete
179
+ Delete project
136
180
  </button>
137
181
  </footer>
138
182
  </form>
@@ -229,48 +273,6 @@ content and does not need modal focus or a backdrop.
229
273
  </dialog>
230
274
  ```
231
275
 
232
- ## Information modal
233
-
234
- Use this shape for contextual information or lightweight secondary content. It
235
- has no action button; the header close button dismisses the dialog.
236
-
237
- ```html demo
238
- <button class="btn"
239
- type="button"
240
- commandfor="details-dialog"
241
- command="show-modal"
242
- aria-haspopup="dialog"
243
- aria-controls="details-dialog">
244
- View details
245
- </button>
246
-
247
- <dialog class="modal"
248
- id="details-dialog"
249
- closedby="any"
250
- data-dialog-dismissible>
251
- <button class="close"
252
- type="button"
253
- commandfor="details-dialog"
254
- command="request-close"
255
- aria-controls="details-dialog"
256
- aria-label="Close dialog"></button>
257
-
258
- <div class="stack">
259
- <header>
260
- <hgroup>
261
- <h3>Release details</h3>
262
- <p>Changes included in this version.</p>
263
- </hgroup>
264
- </header>
265
-
266
- <div>
267
- <p>The release improves dialog behavior, scroll handling, and progressive enhancement for modern browsers.</p>
268
- <p>There are no decisions to make here; the content can simply be dismissed when finished.</p>
269
- </div>
270
- </div>
271
- </dialog>
272
- ```
273
-
274
276
  ## Action modal
275
277
 
276
278
  Use this shape when contextual information leads to one non-destructive next
@@ -566,6 +568,32 @@ The [Settings modal demo](../../demo/templates/settings-modal.html) uses
566
568
  `open data-dialog-open` to show its preferences on load. Close the dialog to
567
569
  reach its Open settings button and reopen it with a command.
568
570
 
571
+ ## Without JavaScript
572
+
573
+ A page can show dialogs without loading the runtime. In a browser that
574
+ implements invoker commands (`commandfor`) and `closedby`, the markup above
575
+ already opens the modal, closes it on Escape, on a `request-close` button and,
576
+ with `closedby="any"`, on a backdrop click, and returns focus to the element
577
+ that had it before opening (Safari does not focus a clicked button, so a mouse
578
+ opening may return focus to the page).
579
+
580
+ Without the runtime, the page gives up:
581
+
582
+ - the trigger itself in browsers without invoker commands, which include part
583
+ of the supported range below: the button does nothing there;
584
+ - `closedby` where it is not implemented: Escape always closes and the backdrop
585
+ never does;
586
+ - the page scroll lock behind a modal;
587
+ - the accessible name taken from the dialog's heading: write
588
+ `aria-labelledby` on the dialog instead;
589
+ - `--show`, `data-dialog-*` options, the static feedback and
590
+ `actual:dialog-cancel`.
591
+
592
+ To lock the page without the runtime, the application can add
593
+ `html:has(dialog:modal) { overflow: hidden; }`. Unlike the runtime's lock, it
594
+ cannot tell whether the page had a classic scrollbar, so a scrolling page may
595
+ shift sideways by the scrollbar's width while the modal is open.
596
+
569
597
  ## Browser support
570
598
 
571
599
  Actual relies on the native `<dialog>` API in its supported JavaScript range
@@ -4,39 +4,6 @@
4
4
 
5
5
  **Related terms:** off-canvas, side panel, side sheet, navigation drawer, bottom sheet, action sheet.
6
6
 
7
- ## Class reference
8
-
9
- | Class | Kind | Description |
10
- | --------- | ----------- | ---------------------------------------------------- |
11
- | `.drawer` | Component | Modal side or bottom sheet on the native `<dialog>`. |
12
- | `.close` | Composition | Icon-only close button, at the top end. |
13
-
14
- ## Usage
15
-
16
- - Use `dialog.drawer` for modal side-sheets that overlay the page.
17
- - Use `command="show-modal"` and `commandfor="<id>"` to open the drawer without JavaScript.
18
- - Use `form method="dialog"` for close buttons inside the drawer.
19
- - Use `data-dialog-dismissible` when backdrop click should close the drawer. It
20
- only gates backdrop click: Escape and the close button always close.
21
- - Use `closedby="none"` when the drawer must not be dismissed by the user at all
22
- (e.g. a form with unsaved changes): no backdrop close and no Escape close.
23
- - Use `[data-side="end"]` for a right-side drawer, `[data-side="bottom"]` for
24
- a [bottom sheet](#bottom-sheet).
25
- - Put the body between a `header` and a `footer`: the panel is a three-row grid
26
- whose middle region scrolls, so the footer stays reachable however long the
27
- content gets.
28
- - Permanent desktop sidebars belong in layout, not here.
29
-
30
- The panel is `--viewport-block` tall, so it follows the space a mobile browser
31
- actually leaves on screen as its URL bar collapses. A shell that fakes a
32
- viewport (an embedded preview) overrides that token rather than the drawer.
33
-
34
- The body region is a scroll container, and browsers make one keyboard-focusable
35
- so it can be scrolled without a pointer — it takes a focus ring like any other
36
- focusable element. `showModal()` focuses the first focusable thing in the
37
- drawer, so put the close button in the `header` (as both examples do) or mark
38
- your intended target `autofocus`; otherwise the body claims initial focus.
39
-
40
7
  ```html demo
41
8
  <button class="btn ghost"
42
9
  type="button"
@@ -72,6 +39,39 @@ your intended target `autofocus`; otherwise the body claims initial focus.
72
39
  </dialog>
73
40
  ```
74
41
 
42
+ ## Usage
43
+
44
+ - Use `dialog.drawer` for modal side-sheets that overlay the page.
45
+ - Use `command="show-modal"` and `commandfor="<id>"` to open the drawer without JavaScript.
46
+ - Use `form method="dialog"` for close buttons inside the drawer.
47
+ - Use `data-dialog-dismissible` when backdrop click should close the drawer. It
48
+ only gates backdrop click: Escape and the close button always close.
49
+ - Use `closedby="none"` when the drawer must not be dismissed by the user at all
50
+ (e.g. a form with unsaved changes): no backdrop close and no Escape close.
51
+ - Use `[data-side="end"]` for a right-side drawer, `[data-side="bottom"]` for
52
+ a [bottom sheet](#bottom-sheet).
53
+ - Put the body between a `header` and a `footer`: the panel is a three-row grid
54
+ whose middle region scrolls, so the footer stays reachable however long the
55
+ content gets.
56
+ - Permanent desktop sidebars belong in layout, not here.
57
+
58
+ The panel is `--viewport-block` tall, so it follows the space a mobile browser
59
+ actually leaves on screen as its URL bar collapses. A shell that fakes a
60
+ viewport (an embedded preview) overrides that token rather than the drawer.
61
+
62
+ The body region is a scroll container, and browsers make one keyboard-focusable
63
+ so it can be scrolled without a pointer — it takes a focus ring like any other
64
+ focusable element. `showModal()` focuses the first focusable thing in the
65
+ drawer, so put the close button in the `header` (as both examples do) or mark
66
+ your intended target `autofocus`; otherwise the body claims initial focus.
67
+
68
+ ## Class reference
69
+
70
+ | Class | Kind | Description |
71
+ | --------- | ----------- | ---------------------------------------------------- |
72
+ | `.drawer` | Component | Modal side or bottom sheet on the native `<dialog>`. |
73
+ | `.close` | Composition | Icon-only close button, at the top end. |
74
+
75
75
  ## Non-dismissible drawer
76
76
 
77
77
  For drawers with unsaved settings or critical actions, use `closedby="none"` so
@@ -7,18 +7,6 @@ its child at the top-end corner. The primitive does not add a background,
7
7
  size, border, or contrast ring: compose it with `.badge` or another component
8
8
  that owns its appearance.
9
9
 
10
- ## Class reference
11
-
12
- | Class | Kind | Description |
13
- | ----------------- | --------- | ----------------------------------------------- |
14
- | `.indicator` | Component | Positioning context for an overlaid child. |
15
- | `.indicator-item` | Part | Item attached to the top-end corner by default. |
16
- | `.start` | Placement | Moves the item to the inline-start corner. |
17
- | `.bottom` | Placement | Moves the item to the bottom corner. |
18
-
19
- Combine `.bottom.start` for bottom-start. Logical inline placement follows the
20
- document direction automatically.
21
-
22
10
  ```html demo
23
11
  <div class="cluster" style="padding: var(--space-40);">
24
12
  <button class="btn indicator" type="button">
@@ -34,6 +22,18 @@ document direction automatically.
34
22
  </div>
35
23
  ```
36
24
 
25
+ ## Class reference
26
+
27
+ | Class | Kind | Description |
28
+ | ----------------- | --------- | ----------------------------------------------- |
29
+ | `.indicator` | Component | Positioning context for an overlaid child. |
30
+ | `.indicator-item` | Part | Item attached to the top-end corner by default. |
31
+ | `.start` | Placement | Moves the item to the inline-start corner. |
32
+ | `.bottom` | Placement | Moves the item to the bottom corner. |
33
+
34
+ Combine `.bottom.start` for bottom-start. Logical inline placement follows the
35
+ document direction automatically.
36
+
37
37
  ## Four corners
38
38
 
39
39
  ```html demo
@@ -29,15 +29,6 @@ application shell — bottom navigation or labelled side navigation via
29
29
  `.app-layout`. The choice follows the shell contract, not a preference for
30
30
  icons. See [App navigation](app-navigation.md).
31
31
 
32
- ## Class reference
33
-
34
- | Class | Kind | Description |
35
- | --------------- | ----------- | ----------------------------------------------------- |
36
- | `.navbar` | Component | Horizontal bar shell. |
37
- | `.navbar-brand` | Composition | Brand link at the inline start. |
38
- | `.nav-link` | Component | A link item; current page via `aria-current="page"`. |
39
- | `.nav-list` | Component | Shared vertical navigation list, reused by `.drawer`. |
40
-
41
32
  ## Basic usage
42
33
 
43
34
  ```html demo
@@ -57,6 +48,16 @@ full-row hit target for vertical navigation. The [Workspaces example](../example
57
48
  shows the sectioned-sidebar composition: grouped `.nav-list` blocks with
58
49
  section titles, a pinned account footer, and the native current state.
59
50
 
51
+ ## Class reference
52
+
53
+ | Class | Kind | Description |
54
+ | --------------- | ----------- | ----------------------------------------------------- |
55
+ | `.navbar` | Component | Horizontal bar shell. |
56
+ | `.navbar-brand` | Composition | Brand link at the inline start. |
57
+ | `.nav-link` | Component | A link item; current page via `aria-current="page"`. |
58
+ | `.nav-list` | Component | Shared vertical navigation list, reused by `.drawer`. |
59
+ | `.rail` | Modifier | `.nav-list` as a table of contents on one rail. |
60
+
60
61
  ## Current link
61
62
 
62
63
  The current link (active page, selected item, highlighted menu entry) takes
@@ -77,6 +78,37 @@ solid selected pill:
77
78
  Keep the pair's contrast: a brand-colored ink on a tinted fill falls under
78
79
  4.5:1 on several light themes.
79
80
 
81
+ ## Rail / table of contents / on this page
82
+
83
+ `.nav-list.rail` hangs the links on one rail, for a table of contents, docs
84
+ navigation or a settings panel. The current link is a band on the rail
85
+ instead of a fill, and the keyboard focus outline lands its leading edge on
86
+ the same band: focus on the current link continues the band into a frame,
87
+ focus elsewhere draws its own segment, and the band stays where it is.
88
+
89
+ ```html demo
90
+ <nav aria-label="On this page">
91
+ <ul class="nav-list rail">
92
+ <li><a class="nav-link" href="#live-demo" aria-current="location">Live demo</a></li>
93
+ <li><a class="nav-link" href="#overview">Overview</a>
94
+ <ul class="nav-list">
95
+ <li><a class="nav-link" href="#formatting">Formatting</a></li>
96
+ <li><a class="nav-link" href="#content">Content</a></li>
97
+ </ul>
98
+ </li>
99
+ <li><a class="nav-link" href="#behaviors">Behaviors</a></li>
100
+ </ul>
101
+ </nav>
102
+ ```
103
+
104
+ - The rail, the band and the focus line share `--focus-ring-width`, so they
105
+ thicken together under `prefers-contrast: more`.
106
+ - A nested `.nav-list` joins the outer rail and indents one step; deeper
107
+ levels share that indent.
108
+ - The band takes `--focus`; `--nav-list-rail-color` sets the rail. In forced
109
+ colors the band widens past the rail, since both take the same system color.
110
+ - Pair it with Scrollspy to move the band while the page scrolls.
111
+
80
112
  ## Responsive: navbar + drawer
81
113
 
82
114
  There is no collapse/toggler mechanism. For a responsive navigation, keep the
@@ -12,13 +12,6 @@
12
12
  - Arrows, page numbers, and truncation ellipses share one geometric system: every item gets the same minimum footprint, and wider content (100, 1000, text labels) grows past it naturally.
13
13
  - Truncated ranges are plain text with `.muted` and `aria-hidden="true"`, not `.btn` — they are decorative, not actionable.
14
14
 
15
- ## Class reference
16
-
17
- | Class | Kind | Description |
18
- | ------------- | --------- | ------------------------------ |
19
- | `.pagination` | Component | Ordered list of page controls. |
20
- | `.sm` / `.lg` | Size | Control geometry and type. |
21
-
22
15
  ## Basic usage
23
16
 
24
17
  ```html demo
@@ -34,6 +27,13 @@
34
27
  </nav>
35
28
  ```
36
29
 
30
+ ## Class reference
31
+
32
+ | Class | Kind | Description |
33
+ | ------------- | --------- | ------------------------------ |
34
+ | `.pagination` | Component | Ordered list of page controls. |
35
+ | `.sm` / `.lg` | Size | Control geometry and type. |
36
+
37
37
  ## Truncated ranges
38
38
 
39
39
  Truncated ranges are plain text (`<span class="muted" aria-hidden="true">`), not
@@ -2,26 +2,31 @@
2
2
 
3
3
  > Indeterminate or determinate indicator of task completion.
4
4
 
5
- - Use native `<progress class="progress">`.
6
- - Shares meter styling DNA.
7
- - Supports indeterminate progress by omitting `value`.
8
- - Can be connected to a busy region with `aria-describedby`.
9
- - Never self-close `<progress>`.
10
-
11
5
  ```html demo
12
6
  <div class="stack">
13
- <progress class="progress" value="60" max="100"></progress>
14
- <progress class="progress" value="30" max="100"></progress>
15
- <progress class="progress" value="90" max="100"></progress>
16
- <progress class="progress"></progress>
7
+ <progress class="progress" aria-label="Upload progress" value="60" max="100"></progress>
8
+ <progress class="progress" aria-label="Download progress" value="30" max="100"></progress>
9
+ <progress class="progress" aria-label="Export progress" value="90" max="100"></progress>
10
+ <progress class="progress" aria-label="Preparing report"></progress>
17
11
 
18
12
  <section aria-busy="true" aria-describedby="upload-progress">
19
- <h2>Uploading files</h2>
20
- <progress class="progress" id="upload-progress" value="60" max="100">60%</progress>
13
+ <h2 id="upload-label">Uploading files</h2>
14
+ <progress class="progress" id="upload-progress" aria-labelledby="upload-label"
15
+ value="60" max="100">60%</progress>
21
16
  </section>
22
17
  </div>
23
18
  ```
24
19
 
20
+ ## Usage
21
+
22
+ - Use `<progress class="progress">` for task completion and a [meter](meter.md)
23
+ for a measurement within a fixed range, such as current disk usage.
24
+ - Set `value` and `max` when work completed can be measured. Omit `value`
25
+ while the amount is unknown, or use a [spinner](spinner.md) when a compact
26
+ pending indicator is enough.
27
+ - Name the task with a `<label>`, `aria-labelledby` or `aria-label`.
28
+ For a busy region, point its `aria-describedby` at the progress bar.
29
+
25
30
  ## CSS hooks
26
31
 
27
32
  - `--progress-track` — unfilled track color.
@@ -33,7 +38,7 @@ thickness, and a design asks for a 4px or a 12px bar, not for a "small" one. Set
33
38
  on the element, or better, on an application class.
34
39
 
35
40
  ```css
36
- .storage-meter {
41
+ .upload-progress {
37
42
  --bar-height: 0.375rem;
38
43
  }
39
44
  ```
@@ -8,25 +8,6 @@ order ascending. The cumulative fill and hover preview use `:has()` as a
8
8
  progressive enhancement; older supported browsers show only the selected star
9
9
  filled while the control remains fully functional.
10
10
 
11
- ## Class reference
12
-
13
- | Class | Kind | Description |
14
- | --------------------- | --------- | -------------------------------- |
15
- | `.rating` | Component | Radio group presented as stars. |
16
- | `.rating[role="img"]` | Component | Read-only display of a value. |
17
- | `.sm` / `.lg` | Size | Smaller or larger star geometry. |
18
-
19
- ## Anatomy
20
-
21
- ```text
22
- fieldset.field-group.flush + .field with help or error text
23
- ├── legend.field-label names the group
24
- └── .rating
25
- └── input[type="radio"] ×1..N, ascending values, aria-label each
26
-
27
- .rating[role="img"] empty; aria-label and --rating-value
28
- ```
29
-
30
11
  ## Rate this item
31
12
 
32
13
  ```html demo
@@ -48,6 +29,25 @@ to name its value. `.field-group.flush` drops the native fieldset frame. Add
48
29
  validation error. In forced-colors mode the stars deliberately return to
49
30
  native platform radios so checked and focus states remain unambiguous.
50
31
 
32
+ ## Class reference
33
+
34
+ | Class | Kind | Description |
35
+ | --------------------- | --------- | -------------------------------- |
36
+ | `.rating` | Component | Radio group presented as stars. |
37
+ | `.rating[role="img"]` | Component | Read-only display of a value. |
38
+ | `.sm` / `.lg` | Size | Smaller or larger star geometry. |
39
+
40
+ ## Anatomy
41
+
42
+ ```text
43
+ fieldset.field-group.flush + .field with help or error text
44
+ ├── legend.field-label names the group
45
+ └── .rating
46
+ └── input[type="radio"] ×1..N, ascending values, aria-label each
47
+
48
+ .rating[role="img"] empty; aria-label and --rating-value
49
+ ```
50
+
51
51
  ## Required rating
52
52
 
53
53
  Add `required` to the radios. With [form validation](../forms/validation.md),
@@ -23,6 +23,7 @@ Try the [Appearance effects catalogue](../../demo/templates/appearance.html#reve
23
23
  to compare entrances, adjust the viewing speed, and replay staggered groups.
24
24
 
25
25
  - Use `.reveal` alone for content in the first screen; add `data-enhance="in-view"` for content below the fold.
26
+ - Add `data-enhance="in-view"` to a reveal that holds links or controls, even in the first screen: the runtime finishes the entrance as soon as focus enters it. `.reveal` alone leaves a focused control fading in.
26
27
  - Load the runtime with `actual-css/js/full`, or register only `actual-css/js/in-view`.
27
28
  - Do not combine `.reveal` with another animated class on the same element, such as `.shimmer` or `.spinner`: one `animation` replaces the other. Nest one inside the other instead. Transitions are unaffected, so `.reveal` can sit on a `.btn` or a card.
28
29
  - The entrance replays whenever the element is rendered again after `display: none`, for example inside a tab panel or a `[hidden]` toggle. Keep Reveal outside content that toggles if the replay is unwanted.
@@ -52,3 +53,4 @@ The group itself is the observed element; its children carry the motion and need
52
53
  - `--reveal-duration` — entrance duration for one element or one group child.
53
54
  - `--reveal-distance` — vertical offset the content travels while appearing.
54
55
  - `--reveal-stagger` — delay between two consecutive children of `.reveal-group`; it also scales the cap, which stays at eight steps.
56
+ - `--reveal-delay` — pause before the entrance, or before a group's first child; the stagger counts from it.
@@ -2,7 +2,7 @@
2
2
 
3
3
  > One compact choice among a few options, on a shared track with the selected segment raised.
4
4
 
5
- **Related terms:** segmented control, toggle group, pill tabs, view switcher, button group, option list, preset list, vertical radio group.
5
+ **Related terms:** segmented control, toggle group, pill tabs, view switcher, content switcher, button group, option list, preset list, vertical radio group.
6
6
 
7
7
  `.segmented` is the track and each `.segment` a direct child. The look is
8
8
  shared; the semantics come from the markup, so pick the anatomy by what the
@@ -20,24 +20,6 @@ any control. A long label wraps instead of truncating, and the row grows with
20
20
  it. A parent that stretches its children (`.stack`) makes it full width; add
21
21
  `.align-self-start` to keep it at its content width.
22
22
 
23
- ## Anatomy
24
-
25
- One tree per use; the track and segment classes are the same in all three.
26
-
27
- ```text
28
- fieldset.segmented
29
- ├── legend (may be .sr-only)
30
- └── label.segment ×2..N
31
- ├── input[type="radio"]
32
- └── label text
33
-
34
- .segmented[role="tablist"]
35
- └── button.segment[role="tab"] ×2..N, one aria-selected="true"
36
-
37
- nav.segmented
38
- └── a.segment ×2..N, at most one aria-current="page"
39
- ```
40
-
41
23
  ## Pick a value
42
24
 
43
25
  Wrap each radio in its label. The radio is visually hidden but stays focusable
@@ -77,6 +59,24 @@ runtime unchanged: it reads the roles, not the classes.
77
59
  </nav>
78
60
  ```
79
61
 
62
+ ## Anatomy
63
+
64
+ One tree per use; the track and segment classes are the same in all three.
65
+
66
+ ```text
67
+ fieldset.segmented
68
+ ├── legend (may be .sr-only)
69
+ └── label.segment ×2..N
70
+ ├── input[type="radio"]
71
+ └── label text
72
+
73
+ .segmented[role="tablist"]
74
+ └── button.segment[role="tab"] ×2..N, one aria-selected="true"
75
+
76
+ nav.segmented
77
+ └── a.segment ×2..N, at most one aria-current="page"
78
+ ```
79
+
80
80
  ## Vertical
81
81
 
82
82
  `.vertical` stacks the segments in one column with their labels at the inline
@@ -94,14 +94,15 @@ which both stacks it and gives the tabs runtime Up and Down.
94
94
  </fieldset>
95
95
  ```
96
96
 
97
- ## When to use something else
97
+ ## Choosing a control
98
98
 
99
- - Several options on at once (bold, italic): `.join` of `.btn` with
100
- `aria-pressed`, see [joined controls](../forms/joined-controls.md).
101
- - More options than fit on one row: [tabs](../enhancements/tabs.md), whose
102
- strip scrolls.
103
- - Long or descriptive options: [choice cards](../forms/choice-cards.md) or
104
- plain radios.
99
+ - Use a segmented control for a compact choice such as list or grid view of
100
+ the same collection. Use [tabs](../enhancements/tabs.md) to give distinct
101
+ sections such as General, Security, and Billing a place of their own.
102
+ - Use [joined controls](../forms/joined-controls.md) with `aria-pressed` when
103
+ several options, such as Bold and Italic, can be active together.
104
+ - Use [choice cards](../forms/choice-cards.md) or plain radios for options
105
+ that need descriptions.
105
106
 
106
107
  ## Hooks
107
108
 
@@ -111,8 +112,11 @@ which both stacks it and gives the tabs runtime Up and Down.
111
112
  - `--segmented-radius` — track corner radius.
112
113
  - `--segmented-fg` — label ink of the unselected segments; the selected one
113
114
  takes `--text`.
114
- - `--segmented-selected-bg` — fill of the selected segment. Its shadow follows
115
- `--shadow`, so a flat theme removes it at the theme level.
116
- - `--segmented-selected-border` — hairline around the selected segment. It is
117
- what sets the segment apart where its fill is darker than the track; a theme
118
- whose fill is lighter can fade it.
115
+ - `--segmented-selected-bg` — fill of the selected segment: `--surface-raised`
116
+ in a light scheme, lifted above the track in a dark one. Its shadow follows
117
+ `--shadow`; a flat theme sets `--shadow-color: transparent`, not
118
+ `--shadow: none`, which would also drop the edge below.
119
+ - `--segmented-selected-border` — hairline around the selected segment, none
120
+ by default. Set it once on a theme root, for example a flat light theme,
121
+ where fill and ink alone barely set the selected segment apart from the
122
+ track.