@reqvire-org/ads 0.5.10 → 0.5.12

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.
@@ -133,10 +133,13 @@ profile's `borderStyle`, never a recipe field.
133
133
  A `when` entry selects a `surface`, and may select a `text` profile that
134
134
  differs from the element's own in weight and tracking only (the chosen option
135
135
  is heavier).
136
- A state of a direct part of the recipe is written `:has(> .part:state)` with
137
- `:checked`, `:indeterminate`, `:focus-visible`, `:hover` or `:disabled`: a
138
- checkbox's box under its native input's `:checked`, a field control's own
139
- hover. Never mirror those states into attributes by script.
136
+ `&` is always the owner's root, in a part's `when` too. A state of one of the
137
+ recipe's own parts is written `:has(> .part:state)` with `:checked`,
138
+ `:indeterminate`, `:focus-visible`, `:hover` or `:disabled`: a checkbox's box
139
+ under its native input's `:checked`, a field control's own hover. A nested part
140
+ is named by its path from the root: `&:has(> .box > .control:focus-visible)`.
141
+ Never mirror those states into attributes by script, and never split a box
142
+ into its own recipe only to reach its child's state.
140
143
  Lowering appends the part's path to the condition, so a pseudo-element, a
141
144
  combinator or class, a type, a nested `&`, another attribute operator or a
142
145
  functional pseudo-class (`:has`, `:is`, `:dir`) would select a different
@@ -238,7 +241,9 @@ a recipe never creates a state machine.
238
241
  cast one shadow. `mask` (a `gradient` token whose alpha fades the element)
239
242
  goes on a visual part or on an element that scrolls, never on a container of
240
243
  standing text. The two shadows need a one-layer shadow token (no spread,
241
- inset, `none` or second layer) in every theme.
244
+ inset, `none` or second layer) in every theme. A scrolling element's scrollbar
245
+ takes `scrollbarThumb` and `scrollbarTrack` (together, the thumb at 3:1) and
246
+ `scrollbarWidth` from its surface; never style scrollbars in owner CSS.
242
247
  - Pressing: a glyph part, or a region or control root, declares
243
248
  `transition: ["scale"]` and one `when` entry with
244
249
  `scale: { slot: "motion", field: "scale" }`. The element rests at `scale: 1`
@@ -462,6 +467,38 @@ are declared under `assets/`: see `ads://guides/branding` and
462
467
  visual profile caps its width (logo strips) instead of its height.
463
468
  - **A drawing picked by state.** `const glyph = open ? closeGlyph : arrowGlyph`, drawn with `glyph.source`, is fine.
464
469
 
470
+ <a id="matching"></a>
471
+ ## Matching a reference without nudges
472
+
473
+ A reference implementation (an upstream library, an earlier version of the site)
474
+ often places things by layout mechanics rather than by design: a glyph that sits
475
+ 0.8 px low because `vertical-align: middle` aligns it to the parent font's
476
+ x-height on a 24 px line, a gap that comes from half-leading, a negative margin
477
+ that cancels a border. Port the **intent**, not the mechanics. A number that only
478
+ reproduces a measurement (`1.594px`, `-1px`, `translate: 0 0.8px`) is a nudge:
479
+ it has no design meaning, it is wrong at the next font, size or theme, and ADS
480
+ rejects owner nudges. Find the construct that states the intent:
481
+
482
+ | What the measurement shows | Construct that states it |
483
+ | --- | --- |
484
+ | A glyph or logo looks off-centre in its box (a magnifier's handle, a play triangle, a mark heavier on one side) | The asset's `opticalCenter`, once for every size and use ([branding.md](branding.md)) |
485
+ | A glyph looks too heavy or thin at one size | Optical drawings per size token (`sizing: "optical"`), not a scale |
486
+ | An icon or control sits a fraction of a pixel off the reference because the reference aligned it on a text line (`vertical-align`, baseline, x-height) | Keep ADS's box alignment (`align: "center"`) and record the difference. If the design means "on the text's centre", report it as a missing concept |
487
+ | Space above or below text differs by its half-leading | The text profile's line height and the spacing tokens; `flow: { edges: "trim" }` for a flow's outer edges |
488
+ | Neighbours overlap (a pile of avatars, cards over each other) | The spacing profile's `overlap` |
489
+ | A backdrop or glow extends past its parent | `outset` on a layer of a `layered` parent |
490
+ | A panel sits a fixed distance from its trigger | The layer profile's `anchorGap`/`anchorOverlap` and `anchorOutdent`/`anchorIndent` |
491
+ | Labels sit at points of a drawing | A text part's `anchor: { artwork, x, y }` |
492
+ | Step labels sit under a slider's handle positions | A row `along` the slider with measured `slider-step` shares |
493
+ | A scale grows from an edge, not the centre | `origin` |
494
+ | A position or size is known only at runtime | Measured values (`measured.props`/`set`), never an inline style |
495
+ | A difference of under a pixel from font rasterization, rounding or a fallback font | Nothing: wait for fonts, compare again and record it |
496
+
497
+ When no construct states the intent, keep ADS's geometry, record the difference
498
+ from the reference with its cause, and report the missing concept as an ADS
499
+ request. Do not reproduce the reference with an inset, margin, translation or
500
+ custom property chosen to match it.
501
+
465
502
  <a id="rejected"></a>
466
503
  ## What is rejected, and why
467
504
 
@@ -133,10 +133,13 @@ profile's `borderStyle`, never a recipe field.
133
133
  A `when` entry selects a `surface`, and may select a `text` profile that
134
134
  differs from the element's own in weight and tracking only (the chosen option
135
135
  is heavier).
136
- A state of a direct part of the recipe is written `:has(> .part:state)` with
137
- `:checked`, `:indeterminate`, `:focus-visible`, `:hover` or `:disabled`: a
138
- checkbox's box under its native input's `:checked`, a field control's own
139
- hover. Never mirror those states into attributes by script.
136
+ `&` is always the owner's root, in a part's `when` too. A state of one of the
137
+ recipe's own parts is written `:has(> .part:state)` with `:checked`,
138
+ `:indeterminate`, `:focus-visible`, `:hover` or `:disabled`: a checkbox's box
139
+ under its native input's `:checked`, a field control's own hover. A nested part
140
+ is named by its path from the root: `&:has(> .box > .control:focus-visible)`.
141
+ Never mirror those states into attributes by script, and never split a box
142
+ into its own recipe only to reach its child's state.
140
143
  Lowering appends the part's path to the condition, so a pseudo-element, a
141
144
  combinator or class, a type, a nested `&`, another attribute operator or a
142
145
  functional pseudo-class (`:has`, `:is`, `:dir`) would select a different
@@ -238,7 +241,9 @@ a recipe never creates a state machine.
238
241
  cast one shadow. `mask` (a `gradient` token whose alpha fades the element)
239
242
  goes on a visual part or on an element that scrolls, never on a container of
240
243
  standing text. The two shadows need a one-layer shadow token (no spread,
241
- inset, `none` or second layer) in every theme.
244
+ inset, `none` or second layer) in every theme. A scrolling element's scrollbar
245
+ takes `scrollbarThumb` and `scrollbarTrack` (together, the thumb at 3:1) and
246
+ `scrollbarWidth` from its surface; never style scrollbars in owner CSS.
242
247
  - Pressing: a glyph part, or a region or control root, declares
243
248
  `transition: ["scale"]` and one `when` entry with
244
249
  `scale: { slot: "motion", field: "scale" }`. The element rests at `scale: 1`
@@ -462,6 +467,38 @@ are declared under `assets/`: see `ads://guides/branding` and
462
467
  visual profile caps its width (logo strips) instead of its height.
463
468
  - **A drawing picked by state.** `const glyph = open ? closeGlyph : arrowGlyph`, drawn with `glyph.source`, is fine.
464
469
 
470
+ <a id="matching"></a>
471
+ ## Matching a reference without nudges
472
+
473
+ A reference implementation (an upstream library, an earlier version of the site)
474
+ often places things by layout mechanics rather than by design: a glyph that sits
475
+ 0.8 px low because `vertical-align: middle` aligns it to the parent font's
476
+ x-height on a 24 px line, a gap that comes from half-leading, a negative margin
477
+ that cancels a border. Port the **intent**, not the mechanics. A number that only
478
+ reproduces a measurement (`1.594px`, `-1px`, `translate: 0 0.8px`) is a nudge:
479
+ it has no design meaning, it is wrong at the next font, size or theme, and ADS
480
+ rejects owner nudges. Find the construct that states the intent:
481
+
482
+ | What the measurement shows | Construct that states it |
483
+ | --- | --- |
484
+ | A glyph or logo looks off-centre in its box (a magnifier's handle, a play triangle, a mark heavier on one side) | The asset's `opticalCenter`, once for every size and use ([branding.md](branding.md)) |
485
+ | A glyph looks too heavy or thin at one size | Optical drawings per size token (`sizing: "optical"`), not a scale |
486
+ | An icon or control sits a fraction of a pixel off the reference because the reference aligned it on a text line (`vertical-align`, baseline, x-height) | Keep ADS's box alignment (`align: "center"`) and record the difference. If the design means "on the text's centre", report it as a missing concept |
487
+ | Space above or below text differs by its half-leading | The text profile's line height and the spacing tokens; `flow: { edges: "trim" }` for a flow's outer edges |
488
+ | Neighbours overlap (a pile of avatars, cards over each other) | The spacing profile's `overlap` |
489
+ | A backdrop or glow extends past its parent | `outset` on a layer of a `layered` parent |
490
+ | A panel sits a fixed distance from its trigger | The layer profile's `anchorGap`/`anchorOverlap` and `anchorOutdent`/`anchorIndent` |
491
+ | Labels sit at points of a drawing | A text part's `anchor: { artwork, x, y }` |
492
+ | Step labels sit under a slider's handle positions | A row `along` the slider with measured `slider-step` shares |
493
+ | A scale grows from an edge, not the centre | `origin` |
494
+ | A position or size is known only at runtime | Measured values (`measured.props`/`set`), never an inline style |
495
+ | A difference of under a pixel from font rasterization, rounding or a fallback font | Nothing: wait for fonts, compare again and record it |
496
+
497
+ When no construct states the intent, keep ADS's geometry, record the difference
498
+ from the reference with its cause, and report the missing concept as an ADS
499
+ request. Do not reproduce the reference with an inset, margin, translation or
500
+ custom property chosen to match it.
501
+
465
502
  <a id="rejected"></a>
466
503
  ## What is rejected, and why
467
504
 
@@ -157,6 +157,11 @@ inspect screenshots. Verify project token mappings and consistency with existing
157
157
  controls as well as required upstream behavior. Intentional project styling is
158
158
  not a failed parity check; retain the unmodified reference and record the
159
159
  difference. A screenshot alone does not establish behavior or motion parity.
160
+ When a measured difference comes from the reference's layout mechanics (a
161
+ glyph aligned on a text line, half-leading, a cancelling margin), port the
162
+ intent with the construct [recipes.md](references/recipes.md#matching) names
163
+ for it (`opticalCenter`, `overlap`, `outset`, anchor offsets) and never with a
164
+ pixel value chosen to match the measurement.
160
165
 
161
166
  Keep browser automation in isolated pages/contexts. Rebuild static playgrounds
162
167
  after source changes. Test the public consumer path as well as component internals;
@@ -133,10 +133,13 @@ profile's `borderStyle`, never a recipe field.
133
133
  A `when` entry selects a `surface`, and may select a `text` profile that
134
134
  differs from the element's own in weight and tracking only (the chosen option
135
135
  is heavier).
136
- A state of a direct part of the recipe is written `:has(> .part:state)` with
137
- `:checked`, `:indeterminate`, `:focus-visible`, `:hover` or `:disabled`: a
138
- checkbox's box under its native input's `:checked`, a field control's own
139
- hover. Never mirror those states into attributes by script.
136
+ `&` is always the owner's root, in a part's `when` too. A state of one of the
137
+ recipe's own parts is written `:has(> .part:state)` with `:checked`,
138
+ `:indeterminate`, `:focus-visible`, `:hover` or `:disabled`: a checkbox's box
139
+ under its native input's `:checked`, a field control's own hover. A nested part
140
+ is named by its path from the root: `&:has(> .box > .control:focus-visible)`.
141
+ Never mirror those states into attributes by script, and never split a box
142
+ into its own recipe only to reach its child's state.
140
143
  Lowering appends the part's path to the condition, so a pseudo-element, a
141
144
  combinator or class, a type, a nested `&`, another attribute operator or a
142
145
  functional pseudo-class (`:has`, `:is`, `:dir`) would select a different
@@ -238,7 +241,9 @@ a recipe never creates a state machine.
238
241
  cast one shadow. `mask` (a `gradient` token whose alpha fades the element)
239
242
  goes on a visual part or on an element that scrolls, never on a container of
240
243
  standing text. The two shadows need a one-layer shadow token (no spread,
241
- inset, `none` or second layer) in every theme.
244
+ inset, `none` or second layer) in every theme. A scrolling element's scrollbar
245
+ takes `scrollbarThumb` and `scrollbarTrack` (together, the thumb at 3:1) and
246
+ `scrollbarWidth` from its surface; never style scrollbars in owner CSS.
242
247
  - Pressing: a glyph part, or a region or control root, declares
243
248
  `transition: ["scale"]` and one `when` entry with
244
249
  `scale: { slot: "motion", field: "scale" }`. The element rests at `scale: 1`
@@ -462,6 +467,38 @@ are declared under `assets/`: see `ads://guides/branding` and
462
467
  visual profile caps its width (logo strips) instead of its height.
463
468
  - **A drawing picked by state.** `const glyph = open ? closeGlyph : arrowGlyph`, drawn with `glyph.source`, is fine.
464
469
 
470
+ <a id="matching"></a>
471
+ ## Matching a reference without nudges
472
+
473
+ A reference implementation (an upstream library, an earlier version of the site)
474
+ often places things by layout mechanics rather than by design: a glyph that sits
475
+ 0.8 px low because `vertical-align: middle` aligns it to the parent font's
476
+ x-height on a 24 px line, a gap that comes from half-leading, a negative margin
477
+ that cancels a border. Port the **intent**, not the mechanics. A number that only
478
+ reproduces a measurement (`1.594px`, `-1px`, `translate: 0 0.8px`) is a nudge:
479
+ it has no design meaning, it is wrong at the next font, size or theme, and ADS
480
+ rejects owner nudges. Find the construct that states the intent:
481
+
482
+ | What the measurement shows | Construct that states it |
483
+ | --- | --- |
484
+ | A glyph or logo looks off-centre in its box (a magnifier's handle, a play triangle, a mark heavier on one side) | The asset's `opticalCenter`, once for every size and use ([branding.md](branding.md)) |
485
+ | A glyph looks too heavy or thin at one size | Optical drawings per size token (`sizing: "optical"`), not a scale |
486
+ | An icon or control sits a fraction of a pixel off the reference because the reference aligned it on a text line (`vertical-align`, baseline, x-height) | Keep ADS's box alignment (`align: "center"`) and record the difference. If the design means "on the text's centre", report it as a missing concept |
487
+ | Space above or below text differs by its half-leading | The text profile's line height and the spacing tokens; `flow: { edges: "trim" }` for a flow's outer edges |
488
+ | Neighbours overlap (a pile of avatars, cards over each other) | The spacing profile's `overlap` |
489
+ | A backdrop or glow extends past its parent | `outset` on a layer of a `layered` parent |
490
+ | A panel sits a fixed distance from its trigger | The layer profile's `anchorGap`/`anchorOverlap` and `anchorOutdent`/`anchorIndent` |
491
+ | Labels sit at points of a drawing | A text part's `anchor: { artwork, x, y }` |
492
+ | Step labels sit under a slider's handle positions | A row `along` the slider with measured `slider-step` shares |
493
+ | A scale grows from an edge, not the centre | `origin` |
494
+ | A position or size is known only at runtime | Measured values (`measured.props`/`set`), never an inline style |
495
+ | A difference of under a pixel from font rasterization, rounding or a fallback font | Nothing: wait for fonts, compare again and record it |
496
+
497
+ When no construct states the intent, keep ADS's geometry, record the difference
498
+ from the reference with its cause, and report the missing concept as an ADS
499
+ request. Do not reproduce the reference with an inset, margin, translation or
500
+ custom property chosen to match it.
501
+
465
502
  <a id="rejected"></a>
466
503
  ## What is rejected, and why
467
504
 
@@ -94,7 +94,11 @@ measure exit-state and removal timestamps. Timing assertions should allow normal
94
94
  browser scheduling tolerance.
95
95
 
96
96
  Inspect screenshots of settled states and intermediate/problem states. Pixel
97
- equality is not expected when the native skin intentionally differs. A computed
97
+ equality is not expected when the native skin intentionally differs. A
98
+ difference that the reference's layout mechanics produce (an inline glyph's
99
+ `vertical-align`, half-leading, font metrics) is explained, not copied: see
100
+ [recipes.md](recipes.md#matching) for the construct that states the intent, or
101
+ record the difference and its cause. A computed
98
102
  duration of 400 ms does not prove a 400 ms visible exit if the DOM disappears at
99
103
  200 ms. Reduced motion can set animation names to `none` while a reset still
100
104
  reports a tiny nonzero duration; assert effective motion behavior.
@@ -10,7 +10,7 @@ export type StateToken = {
10
10
  readonly name: StatePseudoClass;
11
11
  readonly negated: boolean;
12
12
  }
13
- /** A direct part (by its class selector) is in a state: `:has(> .part:state)`. */
13
+ /** A part (by its class path from the root) is in a state: `:has(> .part:state)`, `:has(> .box > .part:state)`. */
14
14
  | {
15
15
  readonly kind: "part";
16
16
  readonly part: string;
@@ -57,12 +57,12 @@ export type ConditionProblem =
57
57
  readonly kind: "state-repeated";
58
58
  readonly state: string;
59
59
  }
60
- /** `:has(…)` in another shape than a direct part's class and one part state. */
60
+ /** `:has(…)` in another shape than a part's class path and one part state. */
61
61
  | {
62
62
  readonly kind: "part-state-unsupported";
63
63
  readonly text: string;
64
64
  }
65
- /** `:has(> .class:state)` whose class is no direct part of the recipe. */
65
+ /** `:has(> .class:state)` whose class path is no declared part's path from the root. */
66
66
  | {
67
67
  readonly kind: "part-unknown";
68
68
  readonly part: string;
@@ -16,7 +16,7 @@ function simple(source, at) {
16
16
  if (rest.startsWith("::"))
17
17
  return err({ kind: "pseudo-element", name: IDENTIFIER.exec(rest.slice(2))?.[0] ?? rest.slice(2) });
18
18
  if (rest.startsWith(":has(")) {
19
- const match = /^:has\(> (\.-?[a-z_][\w-]*):([a-z-]+)\)/i.exec(rest), state = match?.[2]?.toLowerCase();
19
+ const match = /^:has\(> (\.-?[a-z_][\w-]*(?: > \.-?[a-z_][\w-]*)*):([a-z-]+)\)/i.exec(rest), state = match?.[2]?.toLowerCase();
20
20
  if (match?.[1] === void 0 || state === void 0 || !PART_STATES.includes(state))
21
21
  return err({ kind: "part-state-unsupported", text: rest.slice(0, rest.indexOf(")") + 1 || rest.length) });
22
22
  return ok({ token: { kind: "part", part: match[1], state }, end: at + match[0].length });
@@ -1,7 +1,9 @@
1
1
  import { resolveTokenValue } from "./token-resolution.mjs";
2
2
  export const SHAPE_SHADOW = "shape-shadow", GROUP_SHADOW = "group-shadow", BRIGHTNESS = "brightness", GRAYSCALE = "grayscale", INVERT = "invert";
3
3
  const TONE_FIELDS = [GRAYSCALE, INVERT, BRIGHTNESS], FILTER_FIELDS = [...TONE_FIELDS, "blur", SHAPE_SHADOW, GROUP_SHADOW], BACKDROP_FIELDS = ["backdrop-blur", "backdrop-saturate"];
4
- export const MASK = "mask", BACKGROUND_TILE = "background-tile", EFFECT_FIELDS = [...FILTER_FIELDS, ...BACKDROP_FIELDS], EFFECT_PROPERTY_FIELDS = { filter: FILTER_FIELDS, "backdrop-filter": BACKDROP_FIELDS };
4
+ export const MASK = "mask", SCROLLBAR_THUMB = "scrollbar-thumb", SCROLLBAR_TRACK = "scrollbar-track", SCROLLBAR_WIDTH = "scrollbar-width";
5
+ const SCROLLBAR_FIELDS = [SCROLLBAR_THUMB, SCROLLBAR_TRACK, SCROLLBAR_WIDTH];
6
+ export const BACKGROUND_TILE = "background-tile", EFFECT_FIELDS = [...FILTER_FIELDS, ...BACKDROP_FIELDS], EFFECT_PROPERTY_FIELDS = { filter: FILTER_FIELDS, "backdrop-filter": BACKDROP_FIELDS };
5
7
  export function filterValue(fields) {
6
8
  const shadow = fields[SHAPE_SHADOW] ?? fields[GROUP_SHADOW], parts = [...TONE_FIELDS.flatMap((field) => fields[field] === void 0 ? [] : [`${field}(${fields[field]})`]), ...fields.blur === void 0 ? [] : [`blur(${fields.blur})`], ...shadow === void 0 ? [] : [`drop-shadow(${shadow})`]];
7
9
  return parts.length === 0 ? null : parts.join(" ");
@@ -21,6 +23,13 @@ export function effectDeclarations(values) {
21
23
  declarations.push(["background-size", `${value} ${value}`], ["background-repeat", "repeat"]);
22
24
  continue;
23
25
  }
26
+ if (property === SCROLLBAR_THUMB || property === SCROLLBAR_TRACK) {
27
+ if (property === SCROLLBAR_THUMB || values[SCROLLBAR_THUMB] === void 0) {
28
+ if (values[SCROLLBAR_THUMB] !== void 0 && values[SCROLLBAR_TRACK] !== void 0)
29
+ declarations.push(["scrollbar-color", `${values[SCROLLBAR_THUMB]} ${values[SCROLLBAR_TRACK]}`]);
30
+ }
31
+ continue;
32
+ }
24
33
  if (property === MASK) {
25
34
  declarations.push(["-webkit-mask-image", value], ["mask-image", value]);
26
35
  continue;
@@ -46,6 +55,11 @@ export function effectMisplaced(fields, place) {
46
55
  return { reason: "both", field: GROUP_SHADOW };
47
56
  if (fields[MASK] !== void 0 && place === "container")
48
57
  return { reason: "mask-on-container", field: MASK };
58
+ const scrollbar = SCROLLBAR_FIELDS.find((field) => fields[field] !== void 0);
59
+ if (scrollbar !== void 0 && place !== "scroller")
60
+ return { reason: "scrollbar-off-scroller", field: scrollbar };
61
+ if (fields[SCROLLBAR_THUMB] === void 0 !== (fields[SCROLLBAR_TRACK] === void 0))
62
+ return { reason: "scrollbar-pair", field: fields[SCROLLBAR_THUMB] === void 0 ? SCROLLBAR_THUMB : SCROLLBAR_TRACK };
49
63
  const tone = TONE_FIELDS.find((field) => fields[field] !== void 0);
50
64
  if (tone !== void 0 && place !== "visual")
51
65
  return { reason: "brightness-off-visual", field: tone };
@@ -23,7 +23,8 @@ export const DTCG_EXTENSION = "org.reqvire.ads", DTCG_TYPES = {
23
23
  "font-family-list": "fontFamily",
24
24
  "opentype-features-or-normal": null,
25
25
  "opentype-axes-or-normal": null,
26
- "timing-function": "cubicBezier"
26
+ "timing-function": "cubicBezier",
27
+ "scrollbar-width-keyword": null
27
28
  };
28
29
  export function modeName({ theme, brand, condition }) {
29
30
  return [[brand, theme].filter((part) => part !== null).join("/"), condition].filter((part) => part !== null && part !== "").join(" ") || "default";
package/docs/CHANGELOG.md CHANGED
@@ -1,53 +1,79 @@
1
1
  # Changelog
2
2
 
3
- ## 0.5.10
3
+ ## 0.5.12
4
4
 
5
5
  <!-- ads-local-tests:start -->
6
6
  Hot patch: the unit and integration groups; the browser group was not run.
7
- Local verification: **1889/1889 passed** with `bun run test:hotpatch`.
8
- Tested commit: `5e8607a7a836bd22e9c90192b57afba99761f0f0`; Bun 1.4.4.
9
- Completed 2026-11-25T19:01:28.346Z (1550 seconds).
7
+ Local verification: **1893/1893 passed** with `bun run test:hotpatch`.
8
+ Tested commit: `0ab4f9dcec3214d9352aaf70a30f5ea5269e05e4`; Bun 1.4.4.
9
+ Completed 2026-11-25T22:02:01.497Z (1314 seconds).
10
10
 
11
11
  <!-- ads-local-test-proof
12
12
  {
13
13
  "schema": 3,
14
- "version": "0.5.10",
15
- "commit": "5e8607a7a836bd22e9c90192b57afba99761f0f0",
16
- "sourceSha256": "01ea140189ee874134a6e221695045e07bea540794ba99b2f69a79f715977e1e",
14
+ "version": "0.5.12",
15
+ "commit": "0ab4f9dcec3214d9352aaf70a30f5ea5269e05e4",
16
+ "sourceSha256": "366f1915be514a6a816ada1a0d4846d63222aef8be3feebff96c0dc5a84c2c5e",
17
17
  "command": "bun run test:hotpatch",
18
18
  "scope": "hotpatch",
19
19
  "result": "pass",
20
- "tests": 1889,
21
- "pass": 1889,
20
+ "tests": 1893,
21
+ "pass": 1893,
22
22
  "fail": 0,
23
23
  "skipped": 0,
24
24
  "groups": [
25
25
  {
26
26
  "name": "unit",
27
- "tests": 846,
28
- "pass": 846,
27
+ "tests": 847,
28
+ "pass": 847,
29
29
  "fail": 0,
30
30
  "skipped": 0,
31
- "reportSha256": "09ee5055c17233a42fb6d4338a6a0450a63e6ec47ab9ef8fd89abca1aa039ec5"
31
+ "reportSha256": "731ee6c987324ee1e034149bb8d767e5bd17ea733ef90c145befd873bed584cd"
32
32
  },
33
33
  {
34
34
  "name": "integration",
35
- "tests": 1043,
36
- "pass": 1043,
35
+ "tests": 1046,
36
+ "pass": 1046,
37
37
  "fail": 0,
38
38
  "skipped": 0,
39
- "reportSha256": "06279ab2f36dc240a06149cb1204a06e76e322ccd9bbd53384013e6d8cc9e253"
39
+ "reportSha256": "8874bdc00aa9f00f2baf6b5c1ab841aa33e40ac5150d799476e2037b7b787384"
40
40
  }
41
41
  ],
42
42
  "testOverrides": {},
43
43
  "bun": "1.4.4",
44
- "completedAt": "2026-11-25T19:01:28.346Z",
45
- "durationMs": 1549866,
46
- "logSha256": "154782a5ad2a3298b1199543ac692d8c1c3a62baca7c76ab1633c018b0788b40"
44
+ "completedAt": "2026-11-25T22:02:01.497Z",
45
+ "durationMs": 1313954,
46
+ "logSha256": "811ba9d2b9bbb17a8117fd7a5f555e106cf304e6420968659f2d3dabf3830869"
47
47
  }
48
48
  -->
49
49
  <!-- ads-local-tests:end -->
50
50
 
51
+ - *Fixed: a row in block flow could not span its column* (#47). `extent: "fill"`
52
+ on a part with its own `recipe` in block flow makes it a block as wide as its
53
+ container; a heading row's `space-between` puts its switch at the column's end.
54
+ - *Fixed: a control frame left a native field its inset border* (#48). A
55
+ `frame: "control"` writes the frame's border style (solid unless it states
56
+ one) beside its widths, so an `<input>` no longer shows the browser's bevelled
57
+ edge. `element: "text-input"` takes every one-line text entry: `text`,
58
+ `email`, `tel`, `url`, `password`, `number` or no type.
59
+ - *A nested part's own state* (#49). A `when` condition names any declared part
60
+ by its path from the root, `&:has(> .box > .control:focus-visible)`, checked
61
+ step by step, so a text field's input inside its box reacts to its own focus
62
+ and hover. `&` stays the owner's root in every `when`; existing conditions
63
+ keep their meaning.
64
+
65
+ ## 0.5.11
66
+
67
+ - *A scrolling element's scrollbar colours and width.* A surface's
68
+ `scrollbarThumb` and `scrollbarTrack` (paints, set together) are written as
69
+ `scrollbar-color`, and `scrollbarWidth`, a token of the new
70
+ `scrollbar-width` role (`auto`, `thin` or `none`), as `scrollbar-width`. They
71
+ belong to an element whose `overflow` scrolls, and the thumb needs 3:1
72
+ against the track in every theme and brand. Baseline since December 2025; an
73
+ older browser keeps its own scrollbar.
74
+
75
+ ## 0.5.10
76
+
51
77
  Changes an existing design may notice: an `inline` row directly in block flow
52
78
  that states its own space (`spaceBefore`, `spaceAfter`, `spacing`) now starts its
53
79
  own line and collapses its space with its neighbours' (#46); a row beside inline
package/docs/LANGUAGE.md CHANGED
@@ -270,7 +270,7 @@ them all.
270
270
  | `align` / `justify` on an element that scrolls | root, part | `safe center` / `safe end` on the axis the element itself scrolls: content stays aligned while it fits and starts at the scroll origin when it overflows, so its start is never unreachable | n/a (automatic) |
271
271
  | a rounded frame (`radius`) with visible overflow | region root | n/a | a first or last part of a stack, or a layer, that paints a background over a corner with no inset there (`construction/corner-overpaint`): clip the root, inset it, or round the part |
272
272
  | `sticky: { edge: "block-start" \| "block-end", clear?: "block-start" }` | root (not a top-layer root), part | `position: sticky` at that edge of the nearest scrolling container (`inset-block-start: 0`); with `clear`, below the region the layer profile's `clearBlockStart` names; `z-index` from the layer profile's `stickyLayer` when it has one | `clear` with the end edge; `clear` without a layer profile that states `clearBlockStart` |
273
- | `extent: "fill" \| "fill-both"` | part | `flex: 1 1 0`, the main-axis minimum released, so the part's content is confined to it; in a `stack` whose frame states only a minimum height (`minBlockSize`, with no `blockSize`, `maxBlockSize`, ratio or `overflow`) the part keeps its content's height and the stack grows with it; `align-self: stretch` with `fill-both` | the parent is not `stack`/`inline` (`extent-parent-unsupported`); a frame or reserved lines set that minimum |
273
+ | `extent: "fill" \| "fill-both"` | part | `flex: 1 1 0`, the main-axis minimum released, so the part's content is confined to it; in a `stack` whose frame states only a minimum height (`minBlockSize`, with no `blockSize`, `maxBlockSize`, ratio or `overflow`) the part keeps its content's height and the stack grows with it; `align-self: stretch` with `fill-both`. In block flow (a parent without an arrangement), `fill` on a part with its own `recipe` makes it a block as wide as its container: a heading row whose switch sits at the column's end (a row is `display: flex` there, without `fit-content`) | the parent is not `stack`/`inline` (`extent-parent-unsupported`); a frame or reserved lines set that minimum |
274
274
  | `extent: "content" \| "container"` | root of an `inline` row, or of a control | `"content"` (the default): as wide as its content, never wider than its container (`display: inline-flex; max-inline-size: 100%`, or `min(100%, <cap>)` under its frame's own cap); `"container"`: the width available in any parent, a block one, a column that aligns its children, or a row beside siblings (`display: flex; inline-size: 100%`), so a filling part has the rest of the row | on a `stack`, `flow`, `layered` or top-layer root, which never hug (`spec/field-unsupported`); `"container"` with a frame that fixes the row's width (`construction/extent-conflict`); a part with `extent: "fill"` in a `"content"` row whose frame does not fix its width (`construction/extent-row-hugs`) |
275
275
  | `layout: "layered"` | root, part recipe | one `minmax(0,1fr)` grid area; every declared child part at `1 / 1`; paint order is DOM order, no `z-index` | fewer than two parts (`layered-parts-missing`); `gap` or `wrap` |
276
276
  | `outset: { block?, inline? }` (spacing fields) | a childless, non-text part of a `layered` parent | `margin-block` / `margin-inline: calc(-1 * <spacing>)`: the backdrop is drawn past its parent's box (a glow behind a card); the grid area and the layout around it are unchanged. A field bound to a `box-share` token (the spacing profile's `outsetBlock` / `outsetInline`) is a share of the box on that axis and grows with it: the same margin on the inline axis, and on the block axis `block-size: calc(100% + 2 * <share>)` centred over the area (`align-self: center`) | any other part (`construction/outset-unsupported`) |
@@ -281,7 +281,7 @@ them all.
281
281
  | `frame: { profile, rules?, corners? }`; `at: { "<condition>": { frame: { rules?, corners? } } }` | part with its own box | the box's one-sided rules and rounded corners as a root frame's, and under the condition only what the condition changes: a tinted side with a hairline on top and rounded bottom corners while stacked, on its start side and end corners beside | a frame change on a part without its own box; condition `rules` on a box without `rules` (`spec/value-invalid`) |
282
282
  | `at: { "<condition>": { align?, justify?, textAlign? } }` | region root, part | the element's arrangement alignment (`align-items`, `justify-content`) and `text-align` inside the condition's range, its own outside it: a banner centred on phones and start-aligned from a width; a root's alignment needs no `frame` | unknown condition (`condition-unknown`); an entry that changes nothing (`spec/value-invalid`) |
283
283
  | `recipe.conditionQuery["<condition>"]` | owner code | the literal media range the CSS writes (`(width < 47.5rem)`), for `matchMedia` | the recipe's spatial profile lacks it (`choice/recipe-access-unsupported`) |
284
- | `element: "iframe" \| "select" \| "search-input" \| "text-input" \| "table" \| "header-cell" \| "cell" \| "list" \| "summary" \| "document"`, `marker: "none"` | root, part (`document`: a pattern's root only) | the element's closed UA normalization (no iframe border, list markers or summary marker; collapsed table; start-aligned, middle cells) | another tag (`source/part-element-mismatch`); a summary outside `<details>` (`source/summary-outside-details`) |
284
+ | `element: "iframe" \| "select" \| "search-input" \| "text-input" \| "table" \| "header-cell" \| "cell" \| "list" \| "summary" \| "document"`, `marker: "none"` | root, part (`document`: a pattern's root only) | the element's closed UA normalization (`text-input`: an `<input>` of type `text`, `email`, `tel`, `url`, `password` or `number`, or without a type; `search-input`: `type="search"`) (no iframe border, list markers or summary marker; collapsed table; start-aligned, middle cells) | another tag (`source/part-element-mismatch`); a summary outside `<details>` (`source/summary-outside-details`) |
285
285
  | `align: "start" \| "center" \| "end"` on a cell (`element: "cell" \| "header-cell"`); `extent: "container"` on a table root | cell; table root | `vertical-align: top \| middle \| bottom` (rows whose cells wrap to different line counts start together at the top); `inline-size: 100%` (a table as wide as its container instead of its content) | `align` on any other part (`field-unsupported`); a table frame that fixes its width as well (`extent-conflict`) |
286
286
  | `normalize: { textDecoration: "none", pointerEvents: "none", borderStyle: "none" }` | root, `normalize.when`; `textDecoration` and `pointerEvents` also on a part (a link card's link, a decorative layer at any depth) | `text-decoration-line`, `pointer-events`, `border-style` | pointer transparency on focusable or interactive, non-`aria-hidden` markup (`source/pointer-transparent-interactive`) |
287
287
  | `normalize: { cursor, touchAction, userSelect }`, `snap` | root, part, `normalize.when`; scrolling arrangement | see [interaction properties](#interaction-properties) | a value outside its set (`spec/value-invalid`); snap without scrolling (`snap-without-scroll`) |
@@ -353,9 +353,15 @@ element's own text profile; an underline change does not. An underline colour
353
353
  that also fades is a paint: `textDecorationColor` on the surfaces, with the
354
354
  `text-decoration-color` channel of `paintTransition`.
355
355
 
356
- A state of one of the recipe's own direct parts is also a state of the root,
357
- written `:has(> .part:state)` with `:checked`, `:indeterminate`,
358
- `:focus-visible`, `:hover` or `:disabled`:
356
+ `&` is always the owner's root, in a part's `when` too: a glyph that shrinks
357
+ under `&:active` shrinks while the button is pressed. A state of one of the
358
+ recipe's own parts is also a state of the root, written `:has(> .part:state)`
359
+ with `:checked`, `:indeterminate`, `:focus-visible`, `:hover` or `:disabled`.
360
+ A nested part is named by its path from the root, each step a declared part at
361
+ its depth: a text field's input inside its box is
362
+ `&:has(> .field-box > .field-control:focus-visible)`, and the rule it writes
363
+ selects exactly that path (`construction/condition-unsupported` names a path no
364
+ declared part has):
359
365
 
360
366
  ```ts
361
367
  parts: {
@@ -815,7 +821,11 @@ recipe({
815
821
  to an owned child with its own frame. Every modal sheet also emits the
816
822
  document scroll lock `html:has(:modal) { overflow: hidden }` once in its
817
823
  owner's sheet. It keeps no room for the hidden scrollbar: a sheet at the
818
- inline end would stop short of the viewport's edge.
824
+ inline end would stop short of the viewport's edge, and keeping it only while
825
+ a modal is open shifts a page that had no scrollbar. A design system whose
826
+ page must not move behind a modal keeps the room at all times with the
827
+ foundation's `scrollbarGutter: "stable"`; where scrollbars overlay the page it
828
+ reserves nothing.
819
829
  - **Modal card** (`element: "dialog"`; `edge: "center" | "block-start"`): the
820
830
  same `<dialog>`, a card centred in the viewport, or centred inline below the
821
831
  top. A centred card keeps the layer profile's `viewport-margin` from every
@@ -109,7 +109,8 @@ underline's paint, which a state and a paint transition change like any paint)
109
109
  `opacity` (`opacity`), the effects
110
110
  `blur` and `backdropBlur` (`blur`), `backdropSaturate` (`saturation`),
111
111
  `shapeShadow` and `groupShadow` (`shadow`), `mask` (`gradient`), a paint per
112
- border side, and the policy field `state`.
112
+ border side, a scrollbar's `scrollbarThumb` and `scrollbarTrack` (`paint`) and
113
+ `scrollbarWidth` (`scrollbar-width`), and the policy field `state`.
113
114
 
114
115
  A shadow is a composite effect, not component-local raw offsets and colors.
115
116
  Light, dark and brand variants may resolve to different paints and shadows. In
@@ -285,6 +286,21 @@ graph that fades toward the text beside it) or to an element whose `overflow`
285
286
  container its text would fade where it stands, which cannot be proven
286
287
  readable: `construction/surface-effect-misplaced`.
287
288
 
289
+ A scrolling element's scrollbar takes its colours and width from its surface:
290
+ `scrollbarThumb` and `scrollbarTrack` (paints, set together) are written as
291
+ `scrollbar-color`, and `scrollbarWidth` (a `scrollbar-width` token: `auto`,
292
+ `thin` or `none`) as `scrollbar-width`. They belong to an element whose
293
+ `overflow` scrolls (`construction/surface-effect-misplaced` elsewhere, or for a
294
+ thumb without its track). The thumb shows where the view is: 3:1 against the
295
+ track in every theme and brand (`construction/progress-contrast-insufficient`).
296
+ A browser without the properties keeps its own scrollbar. The page's own
297
+ scrollbar follows the theme through `color-scheme`.
298
+
299
+ ```ts
300
+ // tokens/Surfaces/scrollbar-width.ads.css: --list-scrollbar-width: thin;
301
+ profile({ name: "scrolling-list", kind: "surface", fields: { scrollbarThumb: "--outline-control", scrollbarTrack: "--surface-panel", scrollbarWidth: "--list-scrollbar-width" } });
302
+ ```
303
+
288
304
  ```ts
289
305
  // tokens/Surfaces/gradient.ads.css: --fade-inline-end: linear-gradient(to right, black 80%, transparent);
290
306
  profile({ name: "graph-fade", kind: "surface", fields: { mask: "--fade-inline-end" } });
package/docs/RULES.md CHANGED
@@ -248,7 +248,7 @@ Owned markup or motion lacks required accessible semantics: a text alternative,
248
248
  | `construction/non-text-contrast-insufficient` | error | A control part inside a known surface keeps its boundary and focus visible (WCAG 2.2 1.4.11): where its own background does not reach 3:1 against the enclosing background, its border colour (base and each owner state) does; its focus outline colour reaches 3:1 against what it sits on (the enclosing background outside the box, its own inside), in every theme, brand and condition. | Choose a border or focus colour token that reaches 3:1 against the surrounding background in that context, or give the control a background that does. | `ads://guides/recipes`, `ads://guides/accessibility`, `ads://guides/tokens` |
249
249
  | `construction/paint-contrast-insufficient` | error | Every declared value of a runtime paint keeps its contrast against the background the construction knows, in every theme, brand and owner state: a `color` paint 4.5:1 (3:1 for provably large text, WCAG 2.2 1.4.3); a `fill`, `stroke` or `border-color` paint, and a `background-color` paint against its enclosing background, 3:1 (1.4.11); text on a painted background its text minimum. The set is finite, so one failing value fails whichever value data selects. | Adjust that token's value in the failing context, remove it from the paint's values, or place the element on a background it contrasts with. | `ads://guides/recipes`, `ads://guides/accessibility`, `ads://guides/tokens` |
250
250
  | `construction/placeholder-contrast-insufficient` | error | Placeholder text has at least 4.5:1 contrast against its part's background in every theme, brand and state (WCAG 1.4.3). | Choose a placeholder surface whose colour token contrasts enough with the part's background in that context, or adjust the token's value there. | `ads://guides/recipes`, `ads://guides/accessibility`, `ads://guides/tokens` |
251
- | `construction/progress-contrast-insufficient` | error | A progress bar's fill, and a range slider's thumb, has at least 3:1 contrast against its track in every theme, brand and state (WCAG 1.4.11): the progress part's own background, the slider track's surface. | Choose a fill surface whose background token contrasts enough with the part's own background in that context, or adjust the token's value there. | `ads://guides/recipes`, `ads://guides/accessibility`, `ads://guides/tokens` |
251
+ | `construction/progress-contrast-insufficient` | error | A progress bar's fill, a range slider's thumb and a scrollbar's thumb have at least 3:1 contrast against their track in every theme, brand and state (WCAG 1.4.11): the progress part's own background, the slider track's surface. | Choose a fill surface whose background token contrasts enough with the part's own background in that context, or adjust the token's value there. | `ads://guides/recipes`, `ads://guides/accessibility`, `ads://guides/tokens` |
252
252
  | `construction/state-contrast-insufficient` | error | An element's owner states keep it readable (text 4.5:1 or 3:1 when large; a visual part's or a text-less control's artwork 3:1; artwork hidden from assistive technology has no minimum, nor has a fully transparent colour, which draws nothing): where a state's colour meets a background from another surface profile (a colour-only state over the base fill, a state fill under the base colour), the pair has at least 4.5:1 contrast in every theme, brand and condition, or 3:1 where the element's text profile makes its text large there (at least 24px, or 18.66px at weight 700); a state that holds only while the element is inactive (:disabled, [aria-disabled="true"]) has no minimum (WCAG 2.2 1.4.3). Two states that cannot hold on one root together (two values of one attribute, a state and its :not(), :disabled and :enabled) are not paired. | Treat the state with a surface that sets both its colour and background, or choose colour and background tokens that contrast in that context. | `ads://guides/recipes`, `ads://guides/accessibility`, `ads://guides/tokens` |
253
253
  | `construction/target-area-overlap` | error | The enlarged hit areas of neighbouring targets in a stack or inline arrangement do not overlap across their gap in any context: a press there would reach two targets (WCAG 2.2 2.5.8). | Widen the arrangement's gap to at least the hit areas' reach beyond the two boxes, or reduce the min-target sizes. | `ads://guides/recipes`, `ads://guides/accessibility` |
254
254
  | `construction/target-size-below-minimum` | error | Every control construction and `frame: "control"` part is a pointer target of at least 24 × 24 CSS px in every theme, brand and condition (WCAG 2.2 2.5.8), computed from its lowered box: min block = max(min-block-size, content + 2 (inset + border)), inline = 2 (padding-inline + border) + content; an enlarged hit area (min-target-inline-size, min-target-block-size) counts. Relative lengths are evaluated at the 16px reference root. The spacing exception holds for a smaller part of a stack or inline arrangement: a 24px circle centred on it reaches neither a neighbouring target's box nor, for a smaller neighbour, that neighbour's circle, at every gap the arrangement takes; a root or a part with no neighbouring target keeps the minimum. | Raise the frame profile's min-block-size, padding-inline or the visual size in that context, give the frame a min-target-inline-size / min-target-block-size hit area of at least 24px, or (for a part between targets) widen the arrangement's gap until 24px circles centred on the targets keep clear of each other. | `ads://guides/recipes`, `ads://guides/accessibility`, `ads://guides/tokens` |
@@ -341,7 +341,7 @@ A value has the wrong kind, role or range for where it is used. Choose one of th
341
341
  | `construction/spatial-bound-unit` | error | A breakpoint or named condition bound is a media or container query bound and is authored in rem or em, which follow the reader's text size; ADS writes it as authored and never converts px. | Write the token in rem (divide the px value by 16). | `ads://guides/layout`, `ads://guides/tokens` |
342
342
  | `construction/state-geometry-unsupported` | error | An owner state may select an element's geometry: another frame profile, another spacing profile, and whether a part is collapsed. The state's frame states every field the element's own frame writes; a listed geometry channel changes under some state; a `:hover` state has a focus or attribute state of the same geometry, so it is not for pointer users only; a collapsed part has no frame or arrangement of its own and sits in a stack or a row; a state's frame keeps the element's hit area; neighbouring targets do not overlap. | Give the element a frame before a state changes it; state every field in the state's frame profile; list only channels that change; repeat a hover state's geometry under `:focus-visible`, `:focus-within` or an attribute state; put a collapsible part's box on the one element it holds. | `ads://guides/recipes`, `ads://guides/layout` |
343
343
  | `construction/state-text-field` | error | A text profile selected under an owner state (`when: { state: { text } }`) changes the weight and the tracking only (`font-weight`, `letter-spacing`): the family, the size, the line height and every other text property stay the element's own, so the state moves neither the line nor the box's height. | Derive the state's text profile from the element's own (`extends`) and change only `weight` or `letterSpacing`; a different size or family is a different element or a recipe choice, not a state. | `ads://guides/recipes` |
344
- | `construction/surface-effect-misplaced` | error | A shadow that follows an element's shape is declared where it belongs. `shapeShadow` is a visual part's (an image, artwork, a glyph), which has nothing inside it. `groupShadow` is a container's choice: everything inside it casts one shadow. A surface declares at most one of them. `boxShadow` remains the shadow of an element's box and suits any rectangular or rounded element. A `mask` fades a drawing (a visual part) or the edge of an element that scrolls; on any other container its text would fade where it stands, and that cannot be proven readable. | On a visual part use `shapeShadow`; on a container use `boxShadow` for the shadow of its box, or `groupShadow` when one shadow for everything inside it is what you want. Put a `mask` on a visual part, or on an element whose `overflow` scrolls. Put `brightness` on a visual part (the picture itself). Give each element its own surface profile where they differ. | `ads://guides/recipes`, `ads://guides/tokens` |
344
+ | `construction/surface-effect-misplaced` | error | A shadow that follows an element's shape is declared where it belongs. `shapeShadow` is a visual part's (an image, artwork, a glyph), which has nothing inside it. `groupShadow` is a container's choice: everything inside it casts one shadow. A surface declares at most one of them. `boxShadow` remains the shadow of an element's box and suits any rectangular or rounded element. A `mask` fades a drawing (a visual part) or the edge of an element that scrolls; on any other container its text would fade where it stands, and that cannot be proven readable. | On a visual part use `shapeShadow`; on a container use `boxShadow` for the shadow of its box, or `groupShadow` when one shadow for everything inside it is what you want. Put a `mask` on a visual part, or on an element whose `overflow` scrolls. Put scrollbar colours and width on an element whose `overflow` scrolls, with the thumb and track together. Put `brightness` on a visual part (the picture itself). Give each element its own surface profile where they differ. | `ads://guides/recipes`, `ads://guides/tokens` |
345
345
  | `construction/surface-shadow-layer` | error | A `shapeShadow` or `groupShadow` token is one shadow layer in every theme and brand: two offsets, an optional blur and a colour. `filter: drop-shadow()` takes no second layer, no spread and no `inset`, and `none` is not a shadow to cast; a shadow token with those is for `boxShadow`. | Give the field its own shadow token with one layer and no spread, in every theme and brand, or use `boxShadow` for this shadow. | `ads://guides/tokens`, `ads://guides/recipes` |
346
346
  | `construction/vector-surface-unsupported` | error | A vector part's surface sets exactly one field, its stroke `color`. | Give the vector part a colour-only surface profile. | `ads://guides/recipes`, `ads://guides/pictograms` |
347
347
  | `contexts/declaration-rejected` | error | foundation.ads.ts is one literal foundation() declaration the design language accepts. | Correct the foundation declaration as the message describes. | `ads://guides/tokens`, `ads://guides/recipes` |
@@ -370,7 +370,7 @@ A value has the wrong kind, role or range for where it is used. Choose one of th
370
370
  | `source/glyph-set-key` | error | A set binding's drawing is looked up by a key typed as a finite union of the set's names (`typeof set.names[number]`). | Type the key as `typeof set.names[number]` (import the set's declaration with `import type`), or add the names to the set. | `ads://guides/pictograms` |
371
371
  | `source/keyline-missed` | error | In a grid, text starts on one keyline: the start inset of the spatial profile's `wide` gutter, which a grid takes when it names no gutter. A grid on another gutter mode (`narrow`, `condensed`) starts its cells nearer the column line, so a padded frame in such a cell (a card) puts its content back on the keyline: that gutter's start inset and the frame's inline padding add up to the wide gutter's start, within the profile's fine unit, in every theme and brand. Borders are not counted: a border is the frame's edge, its width may change with the theme, and no inset token may be derived from a border width, so text sits a border's width past the keyline. The rule applies to the cell's own container frame, or to the first padded container frame inside it. A control's inset is its own (a button, a tile), a frame without inline padding is flush by choice, and `gutter: "none"` grids (structural layouts such as an application shell) have no text keyline. A public component placed in such a cell is checked across owners (`component-keyline`). | Give the frame an inline padding that, with the gutter's start, comes within the fine unit of the wide gutter's start (a frame profile whose `paddingInline` token is the wide gutter's start), or place the frame in a wide-gutter grid, or remove its inline padding so its content is flush. | `ads://guides/recipes`, `ads://guides/layout` |
372
372
  | `spec/accessibility-declaration-invalid` | error | A text-entry control's `accessibility` declaration names how it is identified other than by a 3:1 boundary (WCAG 1.4.11) with a closed `boundary` kind, `"visible-label"` or `"boundary-on-interaction"`, and a concrete `reason` of 20–300 characters. Placeholder text, a soft fill below 3:1 and a free-form design choice are not identification. | First make the control pass (a 3:1 fill, or one 3:1 border side such as a soft field's underline). Only with the user's explicit approval, declare a supported boundary kind and a concrete reason. | `ads://guides/recipes`, `ads://guides/accessibility` |
373
- | `spec/condition-unsupported` | error | A `when` condition selects a state of the owner's root: `&` followed by interaction or form pseudo-classes (:hover, :active, :focus, :focus-visible, :focus-within, :disabled, :enabled, :checked, :indeterminate), `[aria-*]`, `[data-*]` or `[open]` attributes with an optional quoted value, each optionally inside :not(). A state of one of the recipe's own direct parts is written `:has(> .part:state)` with :checked, :indeterminate, :focus-visible, :hover or :disabled (a checkbox's native input, a textarea's own hover). Pseudo-elements, combinators, classes and other selectors are not states. | Write the condition as owner states only. Style a pseudo-element with the part's `pseudo` treatment (for example `pseudo: { placeholder: { surface } }`), and a child through its own part. | `ads://guides/recipes` |
373
+ | `spec/condition-unsupported` | error | A `when` condition selects a state of the owner's root: `&` followed by interaction or form pseudo-classes (:hover, :active, :focus, :focus-visible, :focus-within, :disabled, :enabled, :checked, :indeterminate), `[aria-*]`, `[data-*]` or `[open]` attributes with an optional quoted value, each optionally inside :not(). `&` is always the owner's root, also in a part's `when`. A state of one of the recipe's own parts is written `:has(> .part:state)`, a nested part by its path from the root (`:has(> .box > .control:focus-visible)`), with :checked, :indeterminate, :focus-visible, :hover or :disabled (a checkbox's native input, a text field's own focus). Pseudo-elements, combinators, classes and other selectors are not states. | Write the condition as owner states only. Style a pseudo-element with the part's `pseudo` treatment (for example `pseudo: { placeholder: { surface } }`), and a child through its own part. | `ads://guides/recipes` |
374
374
  | `spec/field-unsupported` | error | A spec uses only the fields its construction kind defines; unknown fields are rejected, never ignored. | Remove the field or move it to the construction kind that supports it. | `ads://guides/recipes` |
375
375
  | `spec/value-invalid` | error | Each spec field has a defined value form. | Change the value to the expected form. | `ads://guides/recipes` |
376
376
 
@@ -491,7 +491,7 @@ The construct is valid design that ADS does not support yet. Use a supported alt
491
491
  | `construction/condition-visual-unsupported` | error | A part's condition (`at`) may select another visual profile, so the drawing is another size in that range. The part is a visual part that draws registered artwork or contained application media, and both sizes select the same drawing: a condition is a media query and cannot swap the file. | Put `at.<condition>.visual` on a `kind: "visual"` part that draws registered artwork or contained media, and choose sizes within one drawing's range (or declare one drawing for both sizes). | `ads://guides/recipes`, `ads://guides/layout` |
492
492
  | `construction/cover-asset-unsupported` | error | Only application images and intrinsic artwork crop (`fit: "cover"`), around the image's own focal point (an asset's `opticalCenter`). A glyph or paint-slot asset (a logo) is never cropped. | Bind it to a visual profile with `fit: "contain"`. | `ads://guides/recipes` |
493
493
  | `construction/enter-surface-unsupported` | error | An entrance's starting surface (`enter.from.surface`) states only `opacity` and `blur`, and at least one of them: each has an obvious resting value, opaque and sharp. A starting background, colour, border or shadow would be a second design for the element, which belongs to a state (`when`), not an entrance. | Give the entrance its own surface profile with `opacity`, `blur` or both, and nothing else. | `ads://guides/recipes` |
494
- | `construction/extent-parent-unsupported` | error | A part fills its parent's main axis only in a `stack` or `inline` arrangement; a layered part already fills its area, and grids place cells. | Arrange the parent as a stack or inline, or remove `extent` (use grid rows `fill` for a grid cell). | `ads://guides/recipes`, `ads://guides/layout` |
494
+ | `construction/extent-parent-unsupported` | error | A part fills its parent's main axis only in a `stack` or `inline` arrangement, or, in block flow, the width of its container when it arranges its children (a row becomes a block); a layered part already fills its area, and grids place cells. | Arrange the parent as a stack or inline, give the part in block flow a `recipe` of its own, or remove `extent` (use grid rows `fill` for a grid cell). | `ads://guides/recipes`, `ads://guides/layout` |
495
495
  | `construction/measured-property-unsupported` | error | A measured value sets one geometry property of its type's closed list: a `length` a logical inset or box size (inline/block size and their min/max) on a region root or top-level part, a `transform` `translate`, a `size-track` one track of a grid's own `grid-template-columns`/`-rows`. An `intrinsic-size` sets `inline-size` on a contained application image (`fit: "contain"`). A `position` sets `object-position` on a cropped application image (a visual part whose visual profile declares `fit: "cover"`). Padding, margin, gap, typography, borders, radius and paint are design values; a top-layer root is positioned by measured values only with `placement: "measured"`. | Measure a property of the closed list (`inset-*`, `inline-size`, `block-size` and their min/max, `translate`, a grid track that exists in every tier); declare `placement: "measured"` for an element-anchored popover; move design values to profiles. | `ads://guides/recipes`, `ads://guides/layout` |
496
496
  | `construction/paint-property-unsupported` | error | A runtime paint sets one property of the closed paint list (`fill`, `stroke`, `color`, `background-color`, `border-color`), once per element: backgrounds as images, gradients, outlines and shadows are design values. | Paint `fill`, `stroke`, `color`, `background-color` or `border-color`, one paint per property and element; keep other paint values in surface profiles. | `ads://guides/recipes`, `ads://guides/tokens` |
497
497
  | `construction/paint-transition-effect-unsupported` | error | What changes between a transitioned element's surfaces interpolates. A gradient image never does, so such an element has none. A surface effect does through its own channel: `filter` for `blur`, `shapeShadow` and `groupShadow`, `backdrop-filter` for `backdropBlur` and `backdropSaturate`. An effect that changes between the surfaces without its channel listed would snap while the paints transition. | Add `filter` or `backdrop-filter` to the transition's `channels` for an effect that changes, use surfaces without a gradient image on a transitioned element, or remove its paint transition. | `ads://guides/recipes` |
@@ -27,7 +27,7 @@ construction and owner code supplies behavior: these are different contracts.
27
27
  - Primitive and semantic describe a token's purpose, not role kinds. A folder
28
28
  name does not prove primitive status. The example design system uses
29
29
  `Foundation/spacing.ads.css` for primitive scale steps and functional groups
30
- (`Surfaces/` for paints, gradients, shadows, opacity, blur, saturation, brightness, grayscale and invert) for semantic
30
+ (`Surfaces/` for paints, gradients, shadows, opacity, blur, saturation, brightness, grayscale, invert and scrollbar widths) for semantic
31
31
  decisions.
32
32
  - A primitive must not depend on a semantic consumer. Semantic tokens compose
33
33
  primitives and other semantic tokens through the
@@ -88,6 +88,7 @@ construction and owner code supplies behavior: these are different contracts.
88
88
  | `saturation.ads.css` | Nonnegative percentage; `100%` leaves colours unchanged, `0%` is greyscale | A surface's `backdropSaturate`: how vivid what is behind it appears | `--surface-backdrop-saturation` |
89
89
  | `brightness.ads.css` | Nonnegative percentage; `100%` leaves the drawing unchanged, lower dims it, `0%` is black | A surface's `brightness` on a visual part: a picture with no dark version, dimmed in the dark theme | `--image-brightness` |
90
90
  | `grayscale.ads.css` | Nonnegative percentage; `0%` leaves the drawing's colours, `100%` is fully grey | A surface's `grayscale` on a visual part: colour artwork made quiet, or a logo prepared for inverting on a dark page | `--logo-grey` |
91
+ | `scrollbar-width.ads.css` | `auto`, `thin` or `none` | A surface's `scrollbarWidth` on an element that scrolls: how wide its scrollbar is drawn (`none` hides it; the element still scrolls) |
91
92
  | `invert.ads.css` | Nonnegative percentage; `0%` leaves the drawing, `100%` inverts its tones | A surface's `invert` on a visual part: dark marks made for a light page shown light on a dark one | `--logo-invert` |
92
93
  | `overlap.ads.css` | Nonnegative length | A spacing profile's `overlap`: how far the neighbours of an `inline` or `stack` arrangement overlap, in place of a gap | `--facepile-overlap` |
93
94
  | `box-share.ads.css` | Nonnegative percentage of an element's own box on one axis | A spacing profile's `outsetBlock` / `outsetInline`: how far a layered backdrop is drawn past its box, growing with it | `--glow-outset-block` |