actual-css 0.15.1 → 0.16.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 (49) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/README.md +10 -7
  3. package/components.json +46 -2
  4. package/dist/actual.full.css +129 -13
  5. package/dist/actual.full.js +1 -1
  6. package/dist/actual.full.min.css +1 -1
  7. package/docs/design-notes/enhancement-contract.md +11 -3
  8. package/docs/design-notes/tokens.md +2 -0
  9. package/docs/pages/components/accordion.md +5 -0
  10. package/docs/pages/components/avatar.md +10 -0
  11. package/docs/pages/components/bleed.md +4 -0
  12. package/docs/pages/components/card.md +6 -0
  13. package/docs/pages/components/chat.md +20 -0
  14. package/docs/pages/components/dialog.md +26 -0
  15. package/docs/pages/components/rating.md +29 -5
  16. package/docs/pages/components/steps.md +5 -3
  17. package/docs/pages/enhancements/status-bar.md +1 -0
  18. package/docs/pages/examples/overview.md +2 -0
  19. package/docs/pages/forms/choice-cards.md +2 -1
  20. package/docs/pages/forms/date-picker.md +6 -0
  21. package/docs/pages/forms/overview.md +1 -0
  22. package/docs/pages/forms/sticky-actions.md +2 -0
  23. package/docs/pages/foundations/theming.md +19 -3
  24. package/docs/pages/guides/introduction.md +1 -1
  25. package/docs/pages/guides/progressive-enhancement.md +22 -0
  26. package/docs/pages/guides/upgrading.md +2 -2
  27. package/docs/pages/layout/choosing.md +18 -4
  28. package/docs/pages/layout/scroll-snap.md +69 -2
  29. package/llms.txt +2 -1
  30. package/package.json +5 -3
  31. package/skills/actual-css/SKILL.md +5 -4
  32. package/skills/actual-css/references/api-and-vocabulary.md +2 -1
  33. package/src/css/components/avatar.css +4 -2
  34. package/src/css/components/card.css +1 -1
  35. package/src/css/components/chat.css +5 -1
  36. package/src/css/components/menu.css +2 -0
  37. package/src/css/components/rating.css +66 -0
  38. package/src/css/components/status-bar.css +4 -2
  39. package/src/css/core/theme.css +4 -1
  40. package/src/css/core/tokens.css +8 -2
  41. package/src/css/forms/choice-card.css +5 -2
  42. package/src/css/forms/form.css +17 -1
  43. package/src/css/forms/range.css +11 -1
  44. package/src/css/layout/measure.css +2 -0
  45. package/src/js/dialog.js +40 -9
  46. package/src/js/enhance.js +16 -3
  47. package/src/js/selectors.js +10 -2
  48. package/src/js/status.js +71 -10
  49. package/tokens.json +117 -0
@@ -77,7 +77,8 @@ than the registration root, without crossing shadow boundaries.
77
77
  - **A self-describing `data-*`** is for a leaf whose attribute is simultaneously
78
78
  the opt-in and the configuration (`data-tooltip`, `data-mask`, `data-filter`,
79
79
  `data-context-menu`).
80
- - **Elements that are their own opt-in** need nothing (`<dialog>`).
80
+ - **Elements that are their own opt-in** need nothing (`<dialog>` outside a
81
+ Web Component).
81
82
 
82
83
  `data-enhance` is explicitly **not** a mandatory prefix for every module.
83
84
 
@@ -106,6 +107,10 @@ leaves it—even when the element remains connected elsewhere. An enhancer's
106
107
  cleanup must therefore be authoritative and idempotent: it releases its state
107
108
  when called and must not repeat the root-membership decision.
108
109
 
110
+ An optional `enhance()` acceptance predicate narrows lifecycle membership
111
+ without another observer. Discovery and the removal sweep recheck it, so moves
112
+ across a behavioral boundary clean up or initialize the element as needed.
113
+
109
114
  Core lifecycle primitives accept a `Document`, `Element`, or `DocumentFragment`
110
115
  root, and command targets resolve in the trigger's document or shadow root.
111
116
  Built-in auto-registration observes the document tree. It does not discover or
@@ -142,8 +147,11 @@ framework.
142
147
  token.** The markup already carries `role="status"` everywhere, so semantics
143
148
  alone scope the document-wide lookup.
144
149
 
145
- **D5 — `<dialog>` gets no token.** It is its own opt-in: semantic, native,
146
- CSS-agnostic.
150
+ **D5 — `<dialog>` is its own opt-in outside Web Components.** Custom-element
151
+ ancestors and shadow roots reserve lifecycle ownership for the component.
152
+ `data-enhance="dialog"` delegates it explicitly to Actual, independently of
153
+ presentation classes. Both discovery and dialog command resolution apply this
154
+ boundary; the command router leaves rejected targets' native clicks alone.
147
155
 
148
156
  **D6 — `validation.js` accepts `[data-field-error]` as an alias for
149
157
  `.field-error`, and keeps `.field` / `.danger` as an optional, degrading
@@ -47,6 +47,8 @@ Neutral roles may lean toward the palette's ambient hue — by default the prima
47
47
 
48
48
  Semantic intents are curated colors, not mechanical derivatives of `--primary`. Danger, warning, and success stay recognizable for their function, but they are chosen as members of the theme palette rather than copied independently from a generic scale. Neither intents nor neutrals are derived from `--primary` at runtime: the relationship is a design decision recorded in the theme's own values.
49
49
 
50
+ Actual ships a theme, not a palette. A palette lists available colors (`blue-100` … `blue-900`); a theme assigns meaning (primary, danger, surface, text). Components consume only the roles, so bundled color scales would add hundreds of custom properties the framework never reads and widen the public API without adding behavior. Applications bring their own source — a palette library, brand guidelines, literal values — and map it to the roles at the theme boundary.
51
+
50
52
  Color should reinforce structure and meaning, not carry them alone. Information hierarchy and semantic states should remain understandable when hue is removed or unavailable. Desaturating a composition is a useful review heuristic, not a conformance test.
51
53
 
52
54
  ## Soft foreground calibration
@@ -168,3 +168,8 @@ recipe repeats it on its own property:
168
168
  }
169
169
  }
170
170
  ```
171
+
172
+ The [playful FAQ template](../../demo/templates/playful-faq.html) applies this
173
+ recipe with a local palette and animates the panel opening and closing (smooth
174
+ expand / collapse, height animation) through `::details-content`, without
175
+ JavaScript.
@@ -78,6 +78,12 @@ is suppressed inside the avatar.
78
78
  </div>
79
79
  ```
80
80
 
81
+ An image trigger has no visible text, so its `aria-label` is the whole name.
82
+ A trigger that shows initials uses them as its visible label: keep them in the
83
+ accessible name, as in `aria-label="JD, Jane Doe: profile menu"`, so a speech
84
+ user can say what they see (WCAG 2.5.3, *Label in Name*). A name without the
85
+ initials fails that check even when the initials are `aria-hidden`.
86
+
81
87
  ## Avatar stack
82
88
 
83
89
  Set `.sm` or `.lg` on `.avatar-stack` to size the group; its avatars inherit
@@ -113,3 +119,7 @@ Prefer intents for avatar colors. Inside `.avatar-stack`, `--avatar-size` and
113
119
  the stack set, so the whole group resizes together; set `--avatar-size` on an
114
120
  individual avatar to opt one out. `--avatar-stack-overlap` is derived from
115
121
  `--avatar-stack-size`, not `--avatar-size`.
122
+
123
+ Wide two-letter initials (`MW`) fill most of a `.sm` disc, so even the default
124
+ overlap can graze the second letter there. Set `--avatar-stack-overlap: 0` on
125
+ that stack, or keep initials stacks at the default size.
@@ -3,6 +3,10 @@
3
3
  `.bleed` lets a direct child of a padded surface reach its edges. Use it for a
4
4
  full-width image, a colored header or footer, or a notice band.
5
5
 
6
+ `.bleed` is relative to a padded surface. A full-width band on a page is a
7
+ different mechanism: keep the landmark full width and put `.center` inside it.
8
+ See [Center](../layout/center.md).
9
+
6
10
  It works inside `.card`, `.drawer`, a modal's direct `<form>` or `.stack`, and
7
11
  an accordion panel. The accordion panel owns the padding, so place `.bleed`
8
12
  directly inside the panel, after the summary. A deeper descendant stays within
@@ -68,6 +68,12 @@ start-aligned group, `cluster form-actions` for a form's action row,
68
68
  `.justify-content-end` to push actions right. The footer stays anchored to the
69
69
  bottom either way.
70
70
 
71
+ Each child of the slot is one side of the row. A heading and its subtitle placed
72
+ as two direct children split apart, the subtitle pushed to the far side; group
73
+ them in an `<hgroup>` so they stay one block, title above description. Text that
74
+ is not a split row (a centered intro, a stacked title) belongs in a plain
75
+ `<div>`, not in the `<header>` slot.
76
+
71
77
  ```html demo
72
78
  <div style="max-inline-size: 32rem">
73
79
  <article class="card">
@@ -30,6 +30,24 @@ also follows right-to-left writing direction. The avatar is optional. Bubble
30
30
  colors compose with intents and shared variants: `.primary`, `.primary.soft`,
31
31
  and `.primary.outline` all work without chat-specific color classes.
32
32
 
33
+ The avatar sits beside the last line by default, as in messaging. For a long
34
+ message with a footer — an assistant answer, a comment with its actions — set
35
+ `--chat-avatar-align: start` to keep it beside the header.
36
+
37
+ ```html demo
38
+ <div class="chat chat-start" style="--chat-avatar-align: start">
39
+ <div class="chat-avatar avatar sm" role="img" aria-label="Assistant">
40
+ <span aria-hidden="true">A</span>
41
+ </div>
42
+ <div class="chat-header">Assistant <time datetime="2026-08-18T21:31">21:31</time></div>
43
+ <div class="chat-bubble">
44
+ Three invoices are overdue. The largest, INV-2041, is 47 days late; I drafted a
45
+ reminder for it and left the other two for review.
46
+ </div>
47
+ <div class="chat-footer">Sources: Invoices, Customer contacts</div>
48
+ </div>
49
+ ```
50
+
33
51
  For a live conversation, put an appropriate live-region or `role="log"` on the
34
52
  conversation container according to the product's announcement needs. Do not
35
53
  put `role="log"` on individual messages.
@@ -53,3 +71,5 @@ Formatting needs a hosted editor instead — see the
53
71
 
54
72
  - `--chat-gap` — gap between the avatar and message content.
55
73
  - `--chat-max-size` — maximum inline size of a bubble.
74
+ - `--chat-avatar-align` — the avatar's block alignment: `end` (default) beside
75
+ the last line, `start` beside the header for long messages with a footer.
@@ -585,6 +585,32 @@ transition.
585
585
 
586
586
  ## Notes
587
587
 
588
+ ### Web Components
589
+
590
+ The dialog runtime automatically enhances ordinary page dialogs. Dialogs inside
591
+ a custom element (including nested light DOM hosts) or a Shadow DOM keep their
592
+ component's native lifecycle; Actual leaves their `command` buttons untouched.
593
+ The `.modal` styles remain independent of this behavior.
594
+
595
+ To delegate a light DOM dialog to Actual, add `data-enhance="dialog"` before
596
+ inserting it, including when a custom element is only an application container:
597
+
598
+ ```html
599
+ <my-app>
600
+ <dialog class="modal" id="preferences" data-enhance="dialog">
601
+ <form method="dialog">…</form>
602
+ </dialog>
603
+ </my-app>
604
+ ```
605
+
606
+ For an existing light DOM dialog, use
607
+ `applyEnhancement("dialog", "dialog", scope)` from `actual-css/js/enhance`.
608
+ Document discovery does not enter shadow roots: a marked shadow dialog is wired
609
+ on its first routed command. Calling `openDialog()` from `actual-css/js/dialog`
610
+ also explicitly delegates to Actual, in either DOM tree; use Actual's exported
611
+ close helpers for subsequent programmatic actions. Shadow-root disposal remains
612
+ application-owned.
613
+
588
614
  Prefer native dialog behavior whenever possible. The framework runtime should
589
615
  not replace the platform modal system; it should only make dialogs declarative,
590
616
  animation-friendly, and consistent across supported browsers.
@@ -1,6 +1,6 @@
1
1
  # Rating
2
2
 
3
- > Integer star rating built from native radio inputs.
3
+ > Integer star rating built from native radio inputs, and a read-only display of a rating.
4
4
 
5
5
  Each star is a real `input[type="radio"]`, so submission, `required`, disabled
6
6
  state, form reset, and keyboard navigation remain native. Keep values and DOM
@@ -10,10 +10,11 @@ filled while the control remains fully functional.
10
10
 
11
11
  ## Class reference
12
12
 
13
- | Class | Kind | Description |
14
- | ------------- | --------- | -------------------------------- |
15
- | `.rating` | Component | Radio group presented as stars. |
16
- | `.sm` / `.lg` | Size | Smaller or larger star geometry. |
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. |
17
18
 
18
19
  ```html demo
19
20
  <fieldset class="field">
@@ -59,6 +60,27 @@ Intent classes change the active color without changing the interaction model.
59
60
  </div>
60
61
  ```
61
62
 
63
+ ## Read-only display
64
+
65
+ To show a rating rather than collect one (reviews, testimonials, average
66
+ score, star display), use one element with `role="img"` and the value in
67
+ `--rating-value`. Fractions draw a partial star. The `aria-label` carries the
68
+ value; without `role="img"` nothing is drawn, so a display cannot ship
69
+ without an accessible name. Do not present a value with disabled radios.
70
+
71
+ ```html demo
72
+ <p>
73
+ <span class="rating" role="img" aria-label="4.5 out of 5 stars" style="--rating-value: 4.5"></span>
74
+ 4.5 from 312 reviews
75
+ </p>
76
+
77
+ <span class="rating sm primary" role="img" aria-label="7 out of 10" style="--rating-value: 7; --rating-max: 10"></span>
78
+ ```
79
+
80
+ Stars line up with an input `.rating` of the same size, and `.sm`, `.lg` and
81
+ intent classes apply as above. The fill follows the writing direction. In
82
+ forced-colors mode the filled share is painted in system colors.
83
+
62
84
  ### Hooks
63
85
 
64
86
  - `--rating-size` — size of each star; `.sm` and `.lg` set this hook.
@@ -66,3 +88,5 @@ Intent classes change the active color without changing the interaction model.
66
88
  - `--rating-color` — star color. Prefer an intent class for semantic color.
67
89
  - `--rating-empty` — color of unselected stars; use a surface or border token.
68
90
  - `--rating-star` — mask image used to draw a star; override it when a strict CSP disallows data URLs.
91
+ - `--rating-value` — display only: the value shown, fractions allowed.
92
+ - `--rating-max` — display only: the number of stars.
@@ -152,9 +152,11 @@ inside their share. The first and last steps align with the row's edges, labels
152
152
  included, so the track lines up with the heading above it. Their labels get
153
153
  half a share, so a phone-width row reads best with short names at both ends.
154
154
 
155
- Automatic hyphenation depends on the browser, the language and its
156
- dictionaries. Mark break points with `&shy;` (`Ac&shy;count`) when a long name
157
- must wrap predictably.
155
+ A word wider than its share breaks inside the word rather than overflowing the
156
+ row, so the geometry holds at any width. Automatic hyphenation depends on the
157
+ browser, the language and its dictionaries. Mark break points with `&shy;`
158
+ (`Ac&shy;count`) when a long name must wrap predictably, or raise `--step-min`
159
+ (below) to keep whole words and let the row scroll.
158
160
 
159
161
  Set `--step-min` when names need a wider minimum share. If the markers or that
160
162
  minimum do not fit, the row scrolls; use `.steps-vertical` when every name must
@@ -15,6 +15,7 @@ runtime targets, empty by default.
15
15
  - Use it for transient status (`Saved.`, `Reconnected.`, `Copied.`). Critical, persistent, or actionable information belongs in `.alert`, inline messages, or dialogs.
16
16
  - Intents: `danger`, `success`, `warning`, `neutral`. The default (no intent) is a neutral dark pill.
17
17
  - On mobile, the runtime keeps the bar above the software keyboard by tracking `visualViewport` while a message is showing.
18
+ - A [sticky form-actions](../forms/sticky-actions.md) bar docked to the bottom edge lifts the bar above it, so an invalid-submit message never covers the submit button.
18
19
  - A message from an open modal dialog temporarily moves the bar inside that
19
20
  dialog so it remains visible and announced. The bar returns after its exit.
20
21
 
@@ -57,6 +57,8 @@ extension points.
57
57
  - [Adaptive filter surface](../../demo/templates/adaptive-surface.html) - app-level flyout/drawer composition with one synchronized filter state
58
58
  - [Select intents](../../demo/templates/select-intents.html) - extending the enhancer with a project's own `data-enhance` behavior, injected markup included, with no framework change
59
59
  - [Popover transport probe](../../demo/templates/popover-transport.html) - self-scoring bench for the native popover transport go/no-go
60
+ - [Card rail](../../demo/templates/card-rail.html) - one list as a 3-column grid in a wide container and a scroll-snap rail with a peek and CSS scroll markers in a narrow one
61
+ - [Playful FAQ](../../demo/templates/playful-faq.html) - the separated accordion with an application palette, a pill plus/close marker and an animated open/close through `::details-content`, no JavaScript
60
62
  - [Tooltips](../../demo/templates/tooltips.html) - generated text is a snapshot at show time: what updates, what stays, and the explicit-tip way for dynamic content
61
63
 
62
64
  ### Third-party components on Actual tokens
@@ -14,10 +14,11 @@
14
14
  - The control shows before any choice: a ring (radio) or a rounded box (checkbox) on the leading edge, level with the first line. Checked, it fills with a check, and the card takes a primary border and a subtle tint.
15
15
  - Each child element of the label sits on its own row beside the indicator — a title and a `.muted` detail need no wrapper. Wrap loose text in an element.
16
16
  - Stack cards for a list of options (a person, an address, a delivery method), or pair them with grid utilities for options compared side by side.
17
+ - The cards already frame each option, so group them in a `.field-group.flush`: the fieldset keeps its legend and semantics without drawing a second box around the cards.
17
18
  - Supports disabled, checked, focus-visible, and invalid states; the resting ring turns danger with the border.
18
19
 
19
20
  ```html demo
20
- <fieldset class="field-group stack">
21
+ <fieldset class="field-group flush stack">
21
22
  <legend class="field-label">Deliver to</legend>
22
23
  <label class="choice-card">
23
24
  <input type="radio" name="address" value="home" checked />
@@ -38,6 +38,12 @@ control, the masked field and
38
38
  [`@lekoala/date-picker`](https://github.com/lekoala/date-picker) side by side, the
39
39
  picker skinned entirely with Actual tokens.
40
40
 
41
+ The picker also masks typed entry in the locale: digits gain the `Intl`
42
+ separators (`29102026` becomes `29/10/2026` in `fr-BE`) while the submitted value
43
+ stays ISO. `format-on-type="false"` disables the automatic separators; parsing,
44
+ validation and the ISO value are unaffected. Do not combine the picker with
45
+ `data-mask` — two writers on the same value have no defined caret behaviour.
46
+
41
47
  ```html
42
48
  <label class="field">
43
49
  <span class="field-label">Booking date</span>
@@ -191,6 +191,7 @@ root; keyboard focus and an open custom select keep it.
191
191
  - `.field` is the canonical field wrapper. It works on `<label>` and `<div>`.
192
192
  - `.field-label` is element-agnostic. Use it on `<span>` inside a wrapped label, on `<label for="…">` in a detached layout, or on `<legend>` inside a fieldset.
193
193
  - `.field-group` styles a `<fieldset class="field-group">` as a grouped field container. Its legend gutter is tunable with `--fieldset-legend-padding-inline` (`var(--space-10)`). It carries no sibling margin: space consecutive groups with `.stack` on the form, so the rhythm follows the layout instead of the component.
194
+ - `.field-group.flush` drops the frame (unboxed, borderless fieldset) for a group that already sits in a card or a form section; the legend then reads as a plain label above the options, at `--control-font-size` like a `.field` label. It keeps the `<fieldset>` and `<legend>` semantics.
194
195
  - Use native `<optgroup>` and `disabled` options in `.select` controls when applicable; the customizable picker preserves both as a progressive enhancement.
195
196
  - `.choice` is the choice-label API. Use `.check` or `.radio` on the nested control. The control goes first, the label group second, so multi-line labels align the control with the first line.
196
197
  - For a switch, use `class="switch"` and `role="switch"`.
@@ -187,3 +187,5 @@ Scroll the page to see the detached footer stay reachable.
187
187
  ```
188
188
 
189
189
  A sticky footer can cover the last field on short pages. That is a page-layout concern, not a framework concern. Add bottom padding to the page or scroll container if needed.
190
+
191
+ While a docked sticky bar is on screen, the [status bar](../enhancements/status-bar.md) rises above it, so a message never covers the actions — including the validation message an invalid submit shows.
@@ -200,7 +200,7 @@ controls and scrollbars.
200
200
 
201
201
  → Foundations · Tokens (theme contract)
202
202
 
203
- ### Replace the palette with my own brand
203
+ ### Replace the palette with my own brand / bring your own palette
204
204
 
205
205
  Override the whole minimal recolor set (Tokens · Theme contract), not just
206
206
  `--primary`. Every neutral of the default theme — surfaces, text, border,
@@ -223,8 +223,24 @@ It reads the theme in headless Chrome, in every scheme it declares, and exits 1
223
223
  when a soft, focus, invalid-focus or inverse pair misses its threshold, so it
224
224
  can gate a CI job.
225
225
 
226
- Starting from a color scale (Tailwind `--color-zinc-*`, a brand ramp): map one
227
- step per role rather than importing the scale.
226
+ Starting from a color scale (Open Props, Radix Colors, Uchū, Tailwind
227
+ `--color-zinc-*`, a brand ramp): map one step per role rather than importing
228
+ the scale. Reference the library's variables in the theme or copy the few
229
+ values you use; components keep reading roles, never a scale step.
230
+
231
+ ```css
232
+ [data-theme="brand"] {
233
+ --primary: var(--indigo-9);
234
+ --primary-fg: white;
235
+ --danger: var(--red-9);
236
+ --danger-fg: white;
237
+ /* … the rest of the recolor set */
238
+ }
239
+ ```
240
+
241
+ Actual ships no color scales (`blue-100` … `blue-900`). Colors with no
242
+ component role — chart series, illustrations, logo colors — are application
243
+ tokens.
228
244
 
229
245
  → Foundations · Tokens (theme contract) · Guides · Tailwind (Map the palette to theme roles)
230
246
 
@@ -52,7 +52,7 @@ optimizing — the bare `actual-css` entrypoint and `actual-css/full` both resol
52
52
  to the complete compiled framework:
53
53
 
54
54
  ```html
55
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/actual-css@0.15/dist/actual.full.min.css">
55
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/actual-css@0.16/dist/actual.full.min.css">
56
56
  ```
57
57
 
58
58
  The package does not maintain separate partial bundles. Modular entrypoints map
@@ -63,6 +63,19 @@ handle, and cleanup happens per element when an element leaves the DOM.
63
63
 
64
64
  ## The full runtime
65
65
 
66
+ Pick one way to load the runtime per page:
67
+
68
+ | Context | Load |
69
+ | ------------------------ | -------------------------------------------------------- |
70
+ | Bundler, every behavior | `import "actual-css/js/full"` |
71
+ | Bundler, a few behaviors | `import "actual-css/js/tab"`, one line per enhancer |
72
+ | No build step | `dist/actual.full.js` in one `<script>`, e.g. from a CDN |
73
+
74
+ The bundle and the modules register the same behaviors, so loading both
75
+ registers them twice; the runtime warns when a second copy loads.
76
+ `dist/actual.full.js` is not a package export: in a bundler, import
77
+ `actual-css/js/full` instead.
78
+
66
79
  Import `actual-css/js/full` to enable the full runtime:
67
80
 
68
81
  ```js
@@ -360,6 +373,10 @@ command. Names must be a native keyword or start with `--`; anything else
360
373
  throws. `commandSelector(commands)` builds the matching button selector. The returned handle has an idempotent `disconnect()` method for
361
374
  applications that unload the module owning the command.
362
375
 
376
+ Dialog command resolution respects [Web Component ownership](../components/dialog.md#web-components):
377
+ dialogs inside custom elements or shadow roots require `data-enhance="dialog"`
378
+ or a direct dialog API call to delegate their commands to Actual.
379
+
363
380
  ### Dismiss command
364
381
 
365
382
  The runtime includes a generic `--dismiss` command for hiding any resolved
@@ -387,6 +404,11 @@ state or perform another action after the target is hidden.
387
404
  Use `enhance()` for project-specific behavior. It accepts a selector map where
388
405
  each function receives the matched element and may return a cleanup function.
389
406
 
407
+ For eligibility that selectors cannot express, pass `{ accept(element) }` as
408
+ the third argument, after the root. Rejected elements are skipped; moving an
409
+ active element into a rejected subtree runs its cleanup. Moving it back starts
410
+ it again. Attribute changes still require `refresh()`.
411
+
390
412
  ```js
391
413
  import enhance from "actual-css/js/enhance";
392
414
 
@@ -25,8 +25,8 @@ No class or hook is removed: markup and application CSS keep working.
25
25
  package, so this only affects a copy of it: keep the copy, or drop it since
26
26
  the core focus line and fields now match it.
27
27
  - The combobox, date picker and data grid recipes target
28
- `@lekoala/combobox` 0.7.1, `@lekoala/date-picker` 0.5.1 and
29
- `data-grid-component` 3.7.0. Compare a copied bridge with the current one in
28
+ `@lekoala/combobox` 0.8.0, `@lekoala/date-picker` 0.6.1 and
29
+ `data-grid-component` 3.8.0. Compare a copied bridge with the current one in
30
30
  [Combobox](../forms/combobox.md) and [Date picker](../forms/date-picker.md).
31
31
 
32
32
  ## 0.13 to 0.14
@@ -5,14 +5,24 @@ number of children visible in one mockup.
5
5
 
6
6
  ## Page and application shells
7
7
 
8
- | Situation | Recipe |
9
- | -------------------------------------- | ------------------------------------------- |
10
- | A normally scrolling page | Semantic landmarks, optionally `.app-shell` |
11
- | Topbar + scrolling main + adaptive nav | `.app-layout` |
8
+ | Situation | Recipe |
9
+ | ----------------------------------------------- | ------------------------------------------- |
10
+ | A normally scrolling page | Semantic landmarks, optionally `.app-shell` |
11
+ | Full-width bands over a centered content column | `.center` inside each landmark |
12
+ | Topbar + scrolling main + adaptive nav | `.app-layout` |
12
13
 
13
14
  For public, marketing, and editorial pages, use semantic landmarks and add
14
15
  `.navbar` for site navigation.
15
16
 
17
+ When a band must paint edge to edge, keep the landmark a plain page-level box
18
+ and put `.center` inside it: the content column keeps its measure while the
19
+ background reaches the viewport edge. A page wrapped in one `.center` cannot
20
+ paint such a band, and a `.center` inside `.stack` sizes to its content measure
21
+ rather than the row (see
22
+ [stack](stack.md#dont-wrap-full-width-regions-with-stack)).
23
+ [Marketing](../../demo/templates/marketing.html) and
24
+ [Blog](../../demo/templates/blog.html) compose bands this way.
25
+
16
26
  Use `.app-layout` for a viewport-sized shell where the main region scrolls
17
27
  independently and navigation moves from bottom to side. Follow its
18
28
  [required structure](app-layout.md). For other arrangements, compose the
@@ -47,6 +57,10 @@ layout contract: arbitrary structural counts such as seven calendar days,
47
57
  asymmetric fractional tracks, or mixed intrinsic/flexible tracks. Once set, the
48
58
  application owns narrow-container behavior.
49
59
 
60
+ `.measure` caps a single block at a readable width without centering it, for
61
+ content inside a wider region. When the reading column is the page column, use
62
+ `.center` instead. See [Measure](../utilities/list.md#measure).
63
+
50
64
  `.container-query` is a low-level opt-in for a component that changes its own
51
65
  representation according to allocated space. It does not enable responsive
52
66
  behavior for layout primitives and never changes their meaning.
@@ -6,7 +6,7 @@ Horizontal rails that stay useful without JavaScript and snap in modern browsers
6
6
 
7
7
  Use `.scroll-snap` for a niche row of items that should scroll horizontally, such as card rails, media strips, overflow tabs, or a simple touch-friendly carousel baseline. Scrolling only appears when the items are wider than the container; set `--scroll-snap-item-size` for card rails.
8
8
 
9
- **Related terms:** carousel, card carousel, horizontal scroller, media rail, scrolling rail.
9
+ **Related terms:** carousel, card carousel, horizontal scroller, media rail, scrolling rail, grid to slider, swipe on mobile, pagination dots.
10
10
 
11
11
  ```html demo
12
12
  <section class="stack" aria-labelledby="featured-title">
@@ -55,4 +55,71 @@ Keep scrollbars visible by default. If a product deliberately hides them, make t
55
55
  </div>
56
56
  ```
57
57
 
58
- `.scroll-snap` is not a full interactive carousel. For previous/next controls, pagination, active state, mouse drag, looping, autoplay, or robust accessibility behavior, use a dedicated carousel library such as Swiper and compose it with Actual components.
58
+ ## Grid on wide, rail on narrow
59
+
60
+ To show one list as a grid in a wide container and as a swipeable rail in a narrow one, keep a single `.scroll-snap` list and turn it into a grid from an `actual-container` query:
61
+
62
+ ```html
63
+ <div class="container-query">
64
+ <ul class="scroll-snap list-reset card-rail">
65
+ <li class="card">…</li>
66
+ </ul>
67
+ </div>
68
+ ```
69
+
70
+ ```css
71
+ .card-rail {
72
+ --scroll-snap-item-size: min(80%, 18rem);
73
+ }
74
+
75
+ @container actual-container (min-width: 48rem) {
76
+ .card-rail {
77
+ display: grid;
78
+ grid-template-columns: repeat(3, minmax(0, 1fr));
79
+ overflow: visible;
80
+ margin-block: 0;
81
+ padding: 0;
82
+ }
83
+ }
84
+ ```
85
+
86
+ Keep the item size under `100%` so the next card peeks in: iOS hides the scrollbar at rest, so the cut-off card is the scroll cue. In the grid, `overflow: visible` ends the scroll container, and resetting `margin-block` and `padding` removes the focus reserve that only a clipping rail needs.
87
+
88
+ ### Pagination dots
89
+
90
+ CSS scroll markers add one dot per item in Chromium. Other browsers drop these declarations and keep the peek.
91
+
92
+ ```css
93
+ .card-rail {
94
+ scroll-marker-group: after;
95
+ }
96
+
97
+ .card-rail > li::scroll-marker {
98
+ content: "" / attr(data-marker-label);
99
+ inline-size: 0.5rem;
100
+ block-size: 0.5rem;
101
+ border-radius: var(--radius-full);
102
+ background: var(--text-subtle);
103
+ }
104
+
105
+ .card-rail > li::scroll-marker:target-current {
106
+ inline-size: 1.5rem;
107
+ background: var(--primary);
108
+ }
109
+
110
+ @supports (scroll-marker-group: after) {
111
+ .card-rail {
112
+ scrollbar-width: none;
113
+ }
114
+ }
115
+ ```
116
+
117
+ - Each dot is a link: give every item a `data-marker-label`, because `content: ""` alone leaves the links nameless.
118
+ - The dots are controls and need 3:1 against the page: `--text-subtle` is the quietest text tone that holds it, `--border` does not. Mark the current dot by size, not color alone.
119
+ - The dots replace the scrollbar, so hide it only where they exist; `data-scrollbar="hidden"` would also hide it in browsers without markers.
120
+ - Each dot is a tab stop, placed before the items in Chromium's tab order.
121
+ - The grid needs no `scroll-marker-group` reset: markers exist only on a scroll container.
122
+
123
+ The [card rail template](../../demo/templates/card-rail.html) has the full recipe, focus ring and forced colors included.
124
+
125
+ `.scroll-snap` is not a full interactive carousel. For previous/next controls, pagination dots in every browser, mouse drag, looping, autoplay, or robust accessibility behavior, use a dedicated carousel library such as Swiper and compose it with Actual components.
package/llms.txt CHANGED
@@ -17,7 +17,8 @@ Actual CSS uses a small public grammar: `.component [intent] [variant] [size] [m
17
17
  - `actual-css/js` — the enhancement-loader entry only: it watches `data-enhance-modules` manifest blocks and imports the declared enhancers on demand.
18
18
  - `actual-css/js/full` — the complete runtime with all built-in enhancers pre-registered.
19
19
  - `actual-css/reserved-classes.json` — machine-readable list of the framework-owned class namespace. Use it to check whether a class belongs to Actual CSS and to validate claimed framework classes; application-specific classes are expected to exist outside this manifest.
20
- - `actual-css/components.json` — machine-readable component index, derived from the sources (CSS headers, selectors, package exports, `src/js`) by `scripts/build-catalog.js` and verified by `check:catalog`. Gives each component its import paths, owned classes, hooks, states, and registered enhancement tokens — enough to know what exists and where to read more, not a replacement for `docs/pages/components/*.md`.
20
+ - `actual-css/components.json` — machine-readable component index, derived from the sources (CSS headers, selectors, package exports, `src/js`) by `scripts/build-catalog.js` and verified by `check:catalog`. Gives each component its import paths, owned classes, hooks, states, registered enhancement tokens, and published `docs` URL — enough to know what exists and where to read more, not a replacement for the docs pages.
21
+ - `actual-css/tokens.json` — the public global tokens (`global`), derived by the same script from `src/css/core`. Use it to check that a `var(--…)` outside a component exists; component hooks are in `components.json`.
21
22
  - [Starter agent skill](skills/actual-css/SKILL.md) — a copyable skill for building with Actual CSS (vocabulary, hooks, layouts, enhancements); consuming projects extend it with a local `PROJECT.md`.
22
23
  - Individual families and modules are importable separately (`actual-css/css/components`, `actual-css/css/layout/grid`, `actual-css/js/dialog`, …); see [README](README.md) and [Modular imports](docs/pages/guides/modular-import.md).
23
24
 
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "actual-css",
3
- "version": "0.15.1",
3
+ "version": "0.16.1",
4
4
  "description": "Plain CSS component framework with semantic classes, universal variants, small tokens, theme hooks, and progressive enhancements.",
5
5
  "type": "module",
6
- "packageManager": "bun@1.4.3",
6
+ "packageManager": "bun@1.4.4",
7
7
  "license": "MIT",
8
8
  "author": "Thomas <thomas@lekoala.be>",
9
9
  "repository": {
10
10
  "type": "git",
11
11
  "url": "https://github.com/lekoala/actual-css.git"
12
12
  },
13
- "homepage": "https://lekoala.github.io/actual-css/",
13
+ "homepage": "https://lekoala.github.io/actual-css/site/",
14
14
  "bugs": {
15
15
  "url": "https://github.com/lekoala/actual-css/issues"
16
16
  },
@@ -76,6 +76,7 @@
76
76
  "./js/surface": "./src/js/surface.js",
77
77
  "./reserved-classes.json": "./reserved-classes.json",
78
78
  "./components.json": "./components.json",
79
+ "./tokens.json": "./tokens.json",
79
80
  "./package.json": "./package.json"
80
81
  },
81
82
  "bin": {
@@ -100,6 +101,7 @@
100
101
  "src/tooling",
101
102
  "reserved-classes.json",
102
103
  "components.json",
104
+ "tokens.json",
103
105
  "docs",
104
106
  "skills",
105
107
  "CHANGELOG.md",
@@ -15,11 +15,12 @@ The target is not zero application CSS. The target is:
15
15
 
16
16
  Actual CSS may evolve between releases. Resolve uncertain API from the version used by the current project, in this order:
17
17
 
18
- 1. `actual-css/components.json` — component index: classes, public hooks, states, CSS/JS imports, enhancement tokens.
18
+ 1. `actual-css/components.json` — component index: classes, public hooks, states, CSS/JS imports, enhancement tokens, docs URL.
19
19
  2. `actual-css/reserved-classes.json` — framework-owned class namespace.
20
- 3. `actual-css/package.json#exports` — canonical package entrypoints.
21
- 4. `actual-css/src/css/` and `actual-css/src/js/` — exact selectors, defaults, state ownership, and runtime behavior.
22
- 5. `actual-css/docs/` and `actual-css/llms.txt` — intended usage and concise architecture guidance.
20
+ 3. `actual-css/tokens.json` — public global tokens; a `var(--…)` outside a component should be one of them.
21
+ 4. `actual-css/package.json#exports` — canonical package entrypoints.
22
+ 5. `actual-css/src/css/` and `actual-css/src/js/` — exact selectors, defaults, state ownership, and runtime behavior.
23
+ 6. `actual-css/docs/` and `actual-css/llms.txt` — intended usage and concise architecture guidance.
23
24
 
24
25
  If this skill was copied into a consuming project, the installed package wins over examples or summaries in this skill.
25
26
 
@@ -4,8 +4,9 @@
4
4
 
5
5
  Use the installed version rather than guessing from names:
6
6
 
7
- - `components.json` — component classes, hooks, states, CSS/JS imports, enhancement tokens.
7
+ - `components.json` — component classes, hooks, states, CSS/JS imports, enhancement tokens, docs URL.
8
8
  - `reserved-classes.json` — whether Actual CSS owns a class name.
9
+ - `tokens.json` — public global tokens (`--space-40`, `--shadow`, `--primary`…).
9
10
  - `package.json#exports` — supported package entrypoints.
10
11
  - CSS/JS source — exact behavior and defaults.
11
12
  - docs / `llms.txt` — intended usage and framework map.
@@ -176,9 +176,11 @@ a.avatar[aria-disabled="true"] {
176
176
  }
177
177
 
178
178
  /* Avatar stack — explicit class for overlapping avatar groups.
179
- Does not rely on role="group" auto-detection. */
179
+ Does not rely on role="group" auto-detection.
180
+ why an eighth: two-letter initials span most of the disc, so a quarter
181
+ overlap (plus the ring) cut the second letter at every size. */
180
182
  .avatar-stack {
181
- --avatar-stack-overlap: calc(var(--avatar-stack-size, 2.25rem) / -4);
183
+ --avatar-stack-overlap: calc(var(--avatar-stack-size, 2.25rem) / -8);
182
184
  --avatar-stack-ring: 2px;
183
185
 
184
186
  display: inline-flex;