actual-css 0.15.1 → 0.16.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.
@@ -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
@@ -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">
@@ -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
@@ -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 />
@@ -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. 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"`.
@@ -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.0 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.
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.0",
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;
@@ -26,7 +26,7 @@
26
26
  * Internal:
27
27
  * --card-bg
28
28
  * --card-fg
29
- * --heading
29
+ * --heading (local value: the card's own ink for the global token)
30
30
  * --busy-overlay-bg
31
31
  * --surface-link
32
32
  */
@@ -1,6 +1,8 @@
1
1
  /*
2
2
  * Menu — action list primitive consumed by flyout and context-menu.
3
3
  *
4
+ * Docs: docs/pages/enhancements/flyout.md
5
+ *
4
6
  * Strict anatomy: .menu > li > .menu-item. Separators and section labels
5
7
  * sit directly under .menu as siblings of <li>.
6
8
  *
@@ -7,12 +7,22 @@
7
7
  * fills preceding stars without reversing DOM or keyboard order. Forced
8
8
  * colors restores the platform radio presentation.
9
9
  *
10
+ * Read-only display: .rating[role="img"] is one element with no inputs, named
11
+ * by its aria-label. role="img" is the switch on purpose: an unnamed display
12
+ * draws nothing rather than stars no assistive technology can read.
13
+ *
10
14
  * Public hooks:
11
15
  * --rating-size
12
16
  * --rating-gap
13
17
  * --rating-color
14
18
  * --rating-empty
15
19
  * --rating-star
20
+ * --rating-value (display: the shown value, fractions allowed)
21
+ * --rating-max (display: the number of stars)
22
+ *
23
+ * Internal:
24
+ * --rating-fill
25
+ * --rating-direction
16
26
  */
17
27
  :where(.rating) {
18
28
  --intent: initial;
@@ -82,6 +92,49 @@
82
92
  }
83
93
  }
84
94
 
95
+ /* Each star takes the same size + gap cell as a radio, so a display and an
96
+ input of the same size line up. The fill is a share of the whole row, which
97
+ makes a fractional value a partial star. */
98
+ .rating[role="img"] {
99
+ --rating-value: 0;
100
+ --rating-max: 5;
101
+ --rating-fill: calc(var(--rating-value) / var(--rating-max) * 100%);
102
+ --rating-direction: to right;
103
+
104
+ inline-size: calc(var(--rating-max) * (var(--rating-size) + var(--rating-gap)));
105
+ block-size: var(--rating-size);
106
+ vertical-align: middle;
107
+ background: linear-gradient(
108
+ var(--rating-direction),
109
+ var(--rating-color) var(--rating-fill),
110
+ var(--rating-empty) var(--rating-fill)
111
+ );
112
+ -webkit-mask:
113
+ var(--rating-star) left center / calc(var(--rating-size) + var(--rating-gap)) var(--rating-size)
114
+ repeat-x;
115
+ mask:
116
+ var(--rating-star) left center / calc(var(--rating-size) + var(--rating-gap)) var(--rating-size)
117
+ repeat-x;
118
+ }
119
+
120
+ /* The fill starts at the inline start; only the direction changes, so the
121
+ forced-colors gradient below follows it too. Safari before 16.4 has no
122
+ :dir(); the attribute path is its fallback, as in avatar.css. Each selector
123
+ is its own rule: a browser that rejects :dir() drops the whole rule, and the
124
+ :dir() rules come after the fallback so a nested LTR island beats an outer
125
+ [dir="rtl"] at equal specificity. */
126
+ [dir="rtl"] .rating[role="img"] {
127
+ --rating-direction: to left;
128
+ }
129
+
130
+ .rating[role="img"]:dir(ltr) {
131
+ --rating-direction: to right;
132
+ }
133
+
134
+ .rating[role="img"]:dir(rtl) {
135
+ --rating-direction: to left;
136
+ }
137
+
85
138
  .rating.sm {
86
139
  --rating-size: 1rem;
87
140
  }
@@ -100,4 +153,17 @@
100
153
  mask: none;
101
154
  opacity: 1;
102
155
  }
156
+
157
+ /* why: forced colors drops the gradient, and the filled share is the value
158
+ itself, so the display would vanish. It keeps the gradient, painted in the
159
+ user's own system colors only: Highlight for the value, as progress and
160
+ range do, GrayText for the empty stars. */
161
+ .rating[role="img"] {
162
+ forced-color-adjust: none;
163
+ background: linear-gradient(
164
+ var(--rating-direction),
165
+ Highlight var(--rating-fill),
166
+ GrayText var(--rating-fill)
167
+ );
168
+ }
103
169
  }
@@ -11,7 +11,10 @@
11
11
  * translucent surfaces overrides them with opaque values. --border-control is
12
12
  * public too: the resting edge of a neutral control, apart from structural
13
13
  * separators. --control-default-bg is the inherited resting field fill.
14
- * Internal: --hgroup-gap.
14
+ *
15
+ * Internal:
16
+ * --hgroup-gap
17
+ * --surface-link (link ink relay a painted surface sets; reset at boundaries)
15
18
  */
16
19
  :root {
17
20
  color-scheme: light dark;
@@ -8,8 +8,14 @@
8
8
  *
9
9
  * Derived: "Theme-derived aliases" and "State tokens" reference intent and
10
10
  * surface tokens and follow the theme; do not hard-code values into them.
11
- * Internal: indicator offsets, --disabled-opacity and the like are
12
- * consumed by components, not authored.
11
+ *
12
+ * Every token declared here is listed in tokens.json except these, which
13
+ * components consume but authors do not set:
14
+ *
15
+ * Internal:
16
+ * --indicator-offset
17
+ * --indicator-ring
18
+ * --disabled-opacity
13
19
  *
14
20
  * Component-local hooks and internal state relays live with their
15
21
  * components. See docs/pages/foundations/tokens.md for the public/internal
@@ -11,7 +11,7 @@
11
11
  * component cannot know whether its siblings are stacked or gridded.
12
12
  *
13
13
  * Public API: .field, .field-label, .field-help, .field-error, .field-group,
14
- * .required-mark.
14
+ * .field-group.flush, .required-mark.
15
15
  *
16
16
  * Public hooks:
17
17
  * --fieldset-legend-padding-inline
@@ -49,6 +49,20 @@
49
49
  font-size: var(--font-size-xs);
50
50
  }
51
51
 
52
+ /* Flush — the frame removed, for a group that already sits in a card or a
53
+ form section. With no border to notch, the legend is a plain label above
54
+ the options: no gutter, and the .field label-to-control gap below it. */
55
+ .field-group.flush {
56
+ padding: 0;
57
+ border: 0;
58
+ border-radius: 0;
59
+ }
60
+
61
+ .field-group.flush > legend {
62
+ margin-block-end: var(--space-10);
63
+ padding-inline: 0;
64
+ }
65
+
52
66
  .field-help {
53
67
  color: var(--text-muted);
54
68
  font-size: 0.875em;
@@ -46,7 +46,17 @@
46
46
  cursor: pointer;
47
47
  }
48
48
 
49
- :where([dir="rtl"]) .range,
49
+ /* Separate rules: a browser without :dir() drops a whole rule that names it,
50
+ which took the [dir="rtl"] fallback with it. The :dir() pair outranks the
51
+ fallback, so an LTR island inside an RTL region keeps filling from the left. */
52
+ :where([dir="rtl"]) .range {
53
+ --range-fill-from: to left;
54
+ }
55
+
56
+ .range:dir(ltr) {
57
+ --range-fill-from: to right;
58
+ }
59
+
50
60
  .range:dir(rtl) {
51
61
  --range-fill-from: to left;
52
62
  }
@@ -1,6 +1,8 @@
1
1
  /* Readable content measure. Composes with .center for centering or with
2
2
  margin-inline: auto for a one-off centered block.
3
3
  *
4
+ * Docs: docs/pages/utilities/list.md
5
+ *
4
6
  * Public hooks:
5
7
  * --measure
6
8
  */