@reqvire-org/ads 0.3.50 → 0.3.51
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.
- package/README.md +1 -1
- package/dist/browser-audit/first-render.mjs +18 -0
- package/dist/browser-audit/layout-overflow.mjs +80 -39
- package/dist/browser-audit/worker.mjs +16 -8
- package/dist/browser-audit.mjs +52 -11
- package/dist/capture/worker.mjs +2 -5
- package/dist/check.mjs +5 -3
- package/dist/cli.mjs +3 -2
- package/dist/config.mjs +2 -2
- package/dist/finding-rules.mjs +5 -0
- package/dist/layout-widths.mjs +123 -79
- package/dist/skills/ads-break-ui/SKILL.md +2 -1
- package/dist/skills/ads-break-ui/references/design-data.md +27 -14
- package/dist/skills/ads-break-ui/references/validation.md +1 -1
- package/dist/skills/ads-designer/SKILL.md +6 -4
- package/dist/skills/ads-designer/references/design-data.md +27 -14
- package/dist/skills/ads-designer/references/validation.md +1 -1
- package/dist/skills/ads-import/references/design-data.md +27 -14
- package/dist/skills/ads-import/references/validation.md +1 -1
- package/dist/skills/ads-motion/references/design-data.md +27 -14
- package/dist/skills/ads-motion/references/validation.md +1 -1
- package/dist/skills/ads-port/references/design-data.md +27 -14
- package/dist/skills/ads-port/references/validation.md +1 -1
- package/dist/starters/preact/ds.config.json +0 -1
- package/dist/starters/react/README.md +6 -4
- package/dist/starters/react/design-system/components/Content/Image/Image.tsx +7 -4
- package/dist/starters/react/design-system/components/Content/Image/README.md +2 -2
- package/dist/starters/react/design-system/tokens/spacing.css +1 -1
- package/dist/starters/react/ds.config.json +0 -1
- package/docs/ADS.md +2 -2
- package/docs/ARCHITECTURE.md +9 -6
- package/docs/CHANGELOG.md +47 -12
- package/docs/GUIDE.md +50 -20
- package/package.json +1 -1
|
@@ -134,7 +134,7 @@ container width (768 and 1024 px) with container queries, since CSS variables ca
|
|
|
134
134
|
breakpoints. The showcase's grid overlay draws these tokens over every preview at the same
|
|
135
135
|
widths; a project without them shows no overlay. Align text to a cell's edge, not its gutter.
|
|
136
136
|
|
|
137
|
-
### Widths are fluid on the grid
|
|
137
|
+
### Widths are fluid on the grid
|
|
138
138
|
|
|
139
139
|
`--grid-span-1` to `--grid-span-16` are widths of N of 16 columns, fluid in their container.
|
|
140
140
|
Set one inside a container query, under a `Grid` or another `container-type: inline-size`
|
|
@@ -155,23 +155,36 @@ Atomic CSS does not keep rule order, so two queries on one property need exclusi
|
|
|
155
155
|
Use `%` or `fr` for a share of the parent and a `ch` measure for running text
|
|
156
156
|
(`max-inline-size: 65ch`).
|
|
157
157
|
|
|
158
|
-
`layout-fixed-width` is an error for `width`, `min-width`,
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
158
|
+
`layout-fixed-width` is an error for `width`, `min-width`, the logical inline sizes, `flex-basis`,
|
|
159
|
+
`flex`'s basis and `grid-template-columns` tracks that cannot shrink below 96 px, in any unit, raw,
|
|
160
|
+
through a token or by arithmetic. `max-width` and `max-inline-size` are not read: a maximum cannot
|
|
161
|
+
force overflow, so cap with them freely.
|
|
162
162
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
A
|
|
169
|
-
|
|
170
|
-
|
|
163
|
+
When it fires, pick the fix by what the element is:
|
|
164
|
+
|
|
165
|
+
| The element | Do |
|
|
166
|
+
|---|---|
|
|
167
|
+
| A small part: an icon, control, handle or thumbnail | Size it at 96 px or less, plainly: `width: 64px`, `width: var(--control-height-lg)` |
|
|
168
|
+
| A panel, column or anything that can give way | `width: min(100%, 280px)`, `flex: 1 1 280px` or a `minmax(0, 280px)` track |
|
|
169
|
+
| A part that truly stays that wide | A token listed in `layout.widthTokens` in `ds.config.json`, used plainly: `width: var(--side-pane-width)` |
|
|
170
|
+
| An overlay: dialog, menu, popover, tooltip | Its owner in `layout.fixedWidthUnits`, by unit id or file glob |
|
|
171
|
+
|
|
172
|
+
These do not fix it:
|
|
173
|
+
|
|
174
|
+
- Another unit. `32.5ch`, `20em` and `20rem` are as fixed as `280px`, and depend on the font too.
|
|
175
|
+
- `max(100%, 280px)`, `clamp(200px, 50%, 400px)`, `calc(100% + 200px)`: they cannot shrink below
|
|
176
|
+
their fixed part.
|
|
177
|
+
- `min(100%, 64px)` around a small part: `layout-width-noop` asks for the plain size.
|
|
178
|
+
- A token name. `--control-*`, `--side-pane-*` and every other name are read for their value.
|
|
179
|
+
|
|
180
|
+
`ads check` lists every declared fixed width for review (`layout-declared-width`). There is no
|
|
181
|
+
per-declaration exception.
|
|
171
182
|
|
|
172
183
|
`layout-overflow` (`ads audit`) renders every UI scenario at 390, 768 and 1280 px and fails on
|
|
173
184
|
horizontal page overflow, elements past the viewport and clipped content. `overflow-x: auto`
|
|
174
|
-
scrollers and `text-overflow: ellipsis` are exempt.
|
|
185
|
+
scrollers and `text-overflow: ellipsis` are exempt. It also renders components and patterns in a
|
|
186
|
+
240 px container, and fails when a set width above 96 px overflows it. Make that width fluid, or
|
|
187
|
+
scroll it. Only an overlay's owner, listed in `layout.fixedWidthUnits`, stays out of this render.
|
|
175
188
|
|
|
176
189
|
## Color roles and states
|
|
177
190
|
|
|
@@ -43,7 +43,7 @@ implicitly requiring them at acceptance.
|
|
|
43
43
|
owners while project scripts and core gates retain full scope.
|
|
44
44
|
- Both policies run the axe-core audit of every rendered UI scenario in every brand
|
|
45
45
|
and theme (`browser-accessibility-audit`); `browserAudit: false` turns it off for
|
|
46
|
-
that policy. Its `a11y-axe`, `a11y-non-text-contrast` and `layout-overflow` findings are errors that fail the policy, and an audit
|
|
46
|
+
that policy. An `a11y-incomplete` info item means axe could not decide that rule on those elements: check it by hand, using the reason it names (`bgGradient` is text over a gradient). Its `a11y-axe`, `a11y-non-text-contrast` and `layout-overflow` findings are errors that fail the policy, and an audit
|
|
47
47
|
that cannot run (no project Playwright or browser) fails it with a `browser-audit`
|
|
48
48
|
error naming what to install. Under the acceptance policy, draft
|
|
49
49
|
acceptance and guarded patches/transactions audit the candidate's affected UI
|
|
@@ -134,7 +134,7 @@ container width (768 and 1024 px) with container queries, since CSS variables ca
|
|
|
134
134
|
breakpoints. The showcase's grid overlay draws these tokens over every preview at the same
|
|
135
135
|
widths; a project without them shows no overlay. Align text to a cell's edge, not its gutter.
|
|
136
136
|
|
|
137
|
-
### Widths are fluid on the grid
|
|
137
|
+
### Widths are fluid on the grid
|
|
138
138
|
|
|
139
139
|
`--grid-span-1` to `--grid-span-16` are widths of N of 16 columns, fluid in their container.
|
|
140
140
|
Set one inside a container query, under a `Grid` or another `container-type: inline-size`
|
|
@@ -155,23 +155,36 @@ Atomic CSS does not keep rule order, so two queries on one property need exclusi
|
|
|
155
155
|
Use `%` or `fr` for a share of the parent and a `ch` measure for running text
|
|
156
156
|
(`max-inline-size: 65ch`).
|
|
157
157
|
|
|
158
|
-
`layout-fixed-width` is an error for `width`, `min-width`,
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
158
|
+
`layout-fixed-width` is an error for `width`, `min-width`, the logical inline sizes, `flex-basis`,
|
|
159
|
+
`flex`'s basis and `grid-template-columns` tracks that cannot shrink below 96 px, in any unit, raw,
|
|
160
|
+
through a token or by arithmetic. `max-width` and `max-inline-size` are not read: a maximum cannot
|
|
161
|
+
force overflow, so cap with them freely.
|
|
162
162
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
A
|
|
169
|
-
|
|
170
|
-
|
|
163
|
+
When it fires, pick the fix by what the element is:
|
|
164
|
+
|
|
165
|
+
| The element | Do |
|
|
166
|
+
|---|---|
|
|
167
|
+
| A small part: an icon, control, handle or thumbnail | Size it at 96 px or less, plainly: `width: 64px`, `width: var(--control-height-lg)` |
|
|
168
|
+
| A panel, column or anything that can give way | `width: min(100%, 280px)`, `flex: 1 1 280px` or a `minmax(0, 280px)` track |
|
|
169
|
+
| A part that truly stays that wide | A token listed in `layout.widthTokens` in `ds.config.json`, used plainly: `width: var(--side-pane-width)` |
|
|
170
|
+
| An overlay: dialog, menu, popover, tooltip | Its owner in `layout.fixedWidthUnits`, by unit id or file glob |
|
|
171
|
+
|
|
172
|
+
These do not fix it:
|
|
173
|
+
|
|
174
|
+
- Another unit. `32.5ch`, `20em` and `20rem` are as fixed as `280px`, and depend on the font too.
|
|
175
|
+
- `max(100%, 280px)`, `clamp(200px, 50%, 400px)`, `calc(100% + 200px)`: they cannot shrink below
|
|
176
|
+
their fixed part.
|
|
177
|
+
- `min(100%, 64px)` around a small part: `layout-width-noop` asks for the plain size.
|
|
178
|
+
- A token name. `--control-*`, `--side-pane-*` and every other name are read for their value.
|
|
179
|
+
|
|
180
|
+
`ads check` lists every declared fixed width for review (`layout-declared-width`). There is no
|
|
181
|
+
per-declaration exception.
|
|
171
182
|
|
|
172
183
|
`layout-overflow` (`ads audit`) renders every UI scenario at 390, 768 and 1280 px and fails on
|
|
173
184
|
horizontal page overflow, elements past the viewport and clipped content. `overflow-x: auto`
|
|
174
|
-
scrollers and `text-overflow: ellipsis` are exempt.
|
|
185
|
+
scrollers and `text-overflow: ellipsis` are exempt. It also renders components and patterns in a
|
|
186
|
+
240 px container, and fails when a set width above 96 px overflows it. Make that width fluid, or
|
|
187
|
+
scroll it. Only an overlay's owner, listed in `layout.fixedWidthUnits`, stays out of this render.
|
|
175
188
|
|
|
176
189
|
## Color roles and states
|
|
177
190
|
|
|
@@ -43,7 +43,7 @@ implicitly requiring them at acceptance.
|
|
|
43
43
|
owners while project scripts and core gates retain full scope.
|
|
44
44
|
- Both policies run the axe-core audit of every rendered UI scenario in every brand
|
|
45
45
|
and theme (`browser-accessibility-audit`); `browserAudit: false` turns it off for
|
|
46
|
-
that policy. Its `a11y-axe`, `a11y-non-text-contrast` and `layout-overflow` findings are errors that fail the policy, and an audit
|
|
46
|
+
that policy. An `a11y-incomplete` info item means axe could not decide that rule on those elements: check it by hand, using the reason it names (`bgGradient` is text over a gradient). Its `a11y-axe`, `a11y-non-text-contrast` and `layout-overflow` findings are errors that fail the policy, and an audit
|
|
47
47
|
that cannot run (no project Playwright or browser) fails it with a `browser-audit`
|
|
48
48
|
error naming what to install. Under the acceptance policy, draft
|
|
49
49
|
acceptance and guarded patches/transactions audit the candidate's affected UI
|
|
@@ -115,14 +115,16 @@ visible image only. If you add fonts in `tokens/fonts.css`, `ads assets` writes
|
|
|
115
115
|
`tokens/fonts.preload.generated.ts`: call its `preloadFonts()` in the app entry.
|
|
116
116
|
|
|
117
117
|
Widths are fluid on the grid: set a `--grid-span-N` token (N of 16 columns) in a container
|
|
118
|
-
query, or use
|
|
119
|
-
|
|
120
|
-
as overlays.
|
|
118
|
+
query, or use `%` or `fr`. Small parts use plain sizes up to 96 px, and a panel takes
|
|
119
|
+
`min(100%, 280px)`. `layout.widthTokens` in `ds.config.json` names widths that stay fixed, and
|
|
120
|
+
`layout.fixedWidthUnits` the owners whose widths are not checked, such as overlays. `ads check`
|
|
121
|
+
lists both for review.
|
|
121
122
|
|
|
122
123
|
`ads check` fails when a text or control pair falls below WCAG AA in any theme or brand
|
|
123
124
|
(`token-contrast`, `component-contrast`), when a spacing step leaves the 2 px rhythm
|
|
124
125
|
(`token-rhythm`) and on fixed widths (`layout-fixed-width`). `ads audit` fails horizontal
|
|
125
|
-
overflow at 390, 768 and 1280 px
|
|
126
|
+
overflow at 390, 768 and 1280 px, and a set width that overflows a 240 px container
|
|
127
|
+
(`layout-overflow`).
|
|
126
128
|
`ads tokens --format dtcg` exports the tokens as W3C Design Tokens JSON for design tools.
|
|
127
129
|
|
|
128
130
|
The six token scenarios (`tokens/Color`, `Type`, `Space`, `Shape`, `Motion`, `Layout`)
|
|
@@ -2,10 +2,6 @@ import { css, cx } from "@linaria/atomic";
|
|
|
2
2
|
|
|
3
3
|
export type ImageProps = {
|
|
4
4
|
src: string;
|
|
5
|
-
/** Candidate files with width descriptors; list `sizes` with them. For large content images. */
|
|
6
|
-
srcset?: string;
|
|
7
|
-
/** How wide the image displays: `"(min-width: 1024px) 50vw, 100vw"`. */
|
|
8
|
-
sizes?: string;
|
|
9
5
|
/** What the image shows; `""` when it is decorative. */
|
|
10
6
|
alt: string;
|
|
11
7
|
/** The page's main visible image: loads first, never lazily. Use it once per view. */
|
|
@@ -15,6 +11,13 @@ export type ImageProps = {
|
|
|
15
11
|
| { width: number; height: number; aspectRatio?: undefined }
|
|
16
12
|
/** A fluid image: `"16 / 9"`, filling its container's width. */
|
|
17
13
|
| { aspectRatio: "1 / 1" | "4 / 3" | "16 / 9"; width?: undefined; height?: undefined }
|
|
14
|
+
) & (
|
|
15
|
+
/**
|
|
16
|
+
* For large content images. `srcset` lists candidate files with width descriptors; `sizes` says
|
|
17
|
+
* how wide the image displays: `"(min-width: 1024px) 50vw, 100vw"`.
|
|
18
|
+
*/
|
|
19
|
+
| { srcset: string; sizes: string }
|
|
20
|
+
| { srcset?: undefined; sizes?: undefined }
|
|
18
21
|
);
|
|
19
22
|
|
|
20
23
|
const base = css`
|
|
@@ -8,12 +8,12 @@ Use `priority` for the view's main visible image, usually a hero: it loads eager
|
|
|
8
8
|
image per view takes `priority`. Everything below the fold stays lazy.
|
|
9
9
|
|
|
10
10
|
Use `srcset` with width descriptors and `sizes` for large content images, not icons or logos.
|
|
11
|
-
Generate the widths in the project's build or CDN.
|
|
11
|
+
Generate the widths in the project's build or CDN. The types require `sizes` with `srcset`.
|
|
12
12
|
|
|
13
13
|
| Prop | Type | Default |
|
|
14
14
|
|---|---|---|
|
|
15
15
|
| `src` | `string` | — |
|
|
16
|
-
| `srcset`, `sizes` | `string
|
|
16
|
+
| `srcset`, `sizes` | `string`, both or neither | — |
|
|
17
17
|
| `alt` | `string` | — |
|
|
18
18
|
| `width`, `height` | `number` | — |
|
|
19
19
|
| `aspectRatio` | `"1 / 1" \| "4 / 3" \| "16 / 9"` | — |
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
--grid-margin-md: var(--space-8);
|
|
69
69
|
--grid-margin-lg: var(--space-12);
|
|
70
70
|
/* A width of N of 16 columns, fluid in its container: set it inside a container query.
|
|
71
|
-
--container-* are
|
|
71
|
+
--container-* are caps, for max-inline-size. */
|
|
72
72
|
--grid-span-1: calc((100% + var(--grid-gutter)) * 1 / 16 - var(--grid-gutter));
|
|
73
73
|
--grid-span-2: calc((100% + var(--grid-gutter)) * 2 / 16 - var(--grid-gutter));
|
|
74
74
|
--grid-span-3: calc((100% + var(--grid-gutter)) * 3 / 16 - var(--grid-gutter));
|
package/docs/ADS.md
CHANGED
|
@@ -281,9 +281,9 @@ screen, in every theme and brand, through aliases) and `token-rhythm` (`--space-
|
|
|
281
281
|
px) are errors; `token-overlap-review` (equal values within one token family) is a review
|
|
282
282
|
item. The accessibility guards (`a11y-*`) read tokens and runtime component source;
|
|
283
283
|
`component-contrast` checks the color pairs components set themselves, and
|
|
284
|
-
`layout-fixed-width` fails
|
|
284
|
+
`layout-fixed-width` fails widths that cannot shrink below 96 px. `ads audit` adds axe-core
|
|
285
285
|
in the rendered scenarios (`a11y-axe`), non-text contrast (`a11y-non-text-contrast`) and
|
|
286
|
-
overflow at 390, 768 and 1280 px (`layout-overflow`). `ads tokens
|
|
286
|
+
overflow at 390, 768 and 1280 px and in a 240 px container (`layout-overflow`). `ads tokens
|
|
287
287
|
--format dtcg` exports the tokens as W3C Design Tokens JSON. See the
|
|
288
288
|
[token guide](../skills/ads-designer/references/design-data.md) and the
|
|
289
289
|
[accessibility guide](../skills/ads-designer/references/accessibility.md).
|
package/docs/ARCHITECTURE.md
CHANGED
|
@@ -794,13 +794,16 @@ equal token values with possibly different roles, keyboard reach, unused artwork
|
|
|
794
794
|
in a render path); it is shown with guidance and never blocks. An info item notes an analysis
|
|
795
795
|
limit. Stale or hand-edited generated outputs are errors, since they ship.
|
|
796
796
|
|
|
797
|
-
Widths are fluid on the grid. A
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
797
|
+
Widths are fluid on the grid. A width that cannot shrink below 96 px, in any unit, raw, through a
|
|
798
|
+
token or by arithmetic, is an error wherever a component, pattern or composition sets one. Values
|
|
799
|
+
are read for what they resolve to, never by token name, and a maximum is not read because it cannot
|
|
800
|
+
force overflow. A project names the widths that stay fixed (`layout.widthTokens`) and the owners
|
|
801
|
+
that float above the layout (`layout.fixedWidthUnits`) in `ds.config.json`, and `ads check` lists
|
|
802
|
+
both for review; ADS knows a unit's layer, not whether it is an overlay, and there is no
|
|
803
|
+
per-declaration exception. The browser
|
|
802
804
|
audit adds what source cannot show: axe-core, non-text contrast of control borders and icons,
|
|
803
|
-
and horizontal overflow at 390, 768 and 1280 px, by resizing each rendered scenario
|
|
805
|
+
and horizontal overflow at 390, 768 and 1280 px, by resizing each rendered scenario, and in a
|
|
806
|
+
240 px container for components and patterns, where a set width above the small-part limit must fit.
|
|
804
807
|
|
|
805
808
|
Static checks establish the policies and source formats they cover. Behavior
|
|
806
809
|
tests and browser review verify the resulting accessibility, layout, themes,
|
package/docs/CHANGELOG.md
CHANGED
|
@@ -1,34 +1,69 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## 0.3.
|
|
3
|
+
## 0.3.51
|
|
4
4
|
|
|
5
5
|
<!-- ads-local-tests:start -->
|
|
6
|
-
Local verification: **
|
|
7
|
-
Tested commit: `
|
|
8
|
-
Completed 2026-11-
|
|
6
|
+
Local verification: **761/761 passed** with `ADS_TEST_BUN=1 npm test`.
|
|
7
|
+
Tested commit: `cae074c849f112f2fdc8990f8c031ad8f78f9067`; Node v24.13.0, Bun 1.4.1.
|
|
8
|
+
Completed 2026-11-02T11:24:28.751Z (1176 seconds).
|
|
9
9
|
|
|
10
10
|
<!-- ads-local-test-proof
|
|
11
11
|
{
|
|
12
12
|
"schema": 1,
|
|
13
|
-
"version": "0.3.
|
|
14
|
-
"commit": "
|
|
15
|
-
"sourceSha256": "
|
|
13
|
+
"version": "0.3.51",
|
|
14
|
+
"commit": "cae074c849f112f2fdc8990f8c031ad8f78f9067",
|
|
15
|
+
"sourceSha256": "c849cba78c92ca5eb0383308ff7f15f012a5f8dad6ddd49e2e9ce644041e85b6",
|
|
16
16
|
"command": "ADS_TEST_BUN=1 npm test",
|
|
17
17
|
"result": "pass",
|
|
18
|
-
"tests":
|
|
19
|
-
"pass":
|
|
18
|
+
"tests": 761,
|
|
19
|
+
"pass": 761,
|
|
20
20
|
"fail": 0,
|
|
21
21
|
"cancelled": 0,
|
|
22
22
|
"skipped": 0,
|
|
23
23
|
"node": "v24.13.0",
|
|
24
24
|
"bun": "1.4.1",
|
|
25
|
-
"completedAt": "2026-11-
|
|
26
|
-
"durationMs":
|
|
27
|
-
"logSha256": "
|
|
25
|
+
"completedAt": "2026-11-02T11:24:28.751Z",
|
|
26
|
+
"durationMs": 1175664,
|
|
27
|
+
"logSha256": "5042dab0442851693b09d13d7068acaaa84d62ddff3f169ecbda29af3df988f2"
|
|
28
28
|
}
|
|
29
29
|
-->
|
|
30
30
|
<!-- ads-local-tests:end -->
|
|
31
31
|
|
|
32
|
+
- **The audit lists what axe could not decide.** New `a11y-incomplete` info item, one per scenario,
|
|
33
|
+
axe rule and element set, with the elements and axe's reason, such as `bgGradient`: check it by
|
|
34
|
+
hand. It fails nothing. `incomplete` in the audit result now counts these items, and the text
|
|
35
|
+
summary shows the count.
|
|
36
|
+
- **The audit and captures no longer hang on a lazy image.** Waiting for `decode()` on a
|
|
37
|
+
`loading="lazy"` image outside the viewport or not rendered never settled, so `ads audit`,
|
|
38
|
+
`ads validate` and captures could stop until their time limit. Only images that are loading are
|
|
39
|
+
waited on, within one overall limit of 5 s.
|
|
40
|
+
- **The audit renders components and patterns in a narrow container.** Each scenario's container
|
|
41
|
+
is narrowed to 240 px, and a set width, `min-width` or unshrinking `flex-basis` above 96 px that
|
|
42
|
+
overflows it is a `layout-overflow-narrow` review item. Compositions, scenarios with a `main`
|
|
43
|
+
landmark and `layout.fixedWidthUnits` owners stay out.
|
|
44
|
+
- **`--json` output is complete when piped.** Under Bun it stopped at 64 KB.
|
|
45
|
+
- **The audit measures overflow after a resize settles.** It waits until layout has stopped moving
|
|
46
|
+
for a few frames, and gives a page that looks wrong more frames, so a component refitting through
|
|
47
|
+
`ResizeObserver`, `requestAnimationFrame` or a timer is not reported. A real overflow still is.
|
|
48
|
+
- **`layout-fixed-width` asks whether a width can shrink.** A width, `flex-basis` or grid track is
|
|
49
|
+
an error when it cannot shrink below 96 px, up from 48 px, so small parts use plain sizes.
|
|
50
|
+
- `ch`, `em`, `ex` and `lh` now count as fixed, like `px` and `rem`.
|
|
51
|
+
- `max(100%, 280px)`, `clamp(200px, 50%, 400px)`, `calc(100% + 200px)` and a `minmax(200px, 1fr)`
|
|
52
|
+
track are errors. A `minmax(0, 280px)` track passes.
|
|
53
|
+
- `max-width` and `max-inline-size` are no longer read: a maximum cannot force overflow.
|
|
54
|
+
- No token name is exempt. `--control-*`, `--side-pane-*`, `--icon-*` and the others are read for
|
|
55
|
+
their value.
|
|
56
|
+
- `layout.widthTokens` now names widths that stay fixed, with no fluid definition required. Remove
|
|
57
|
+
`--grid-span-*`, `--container-*` and `--content-max` entries: they no longer need declaring.
|
|
58
|
+
- New review items: `layout-declared-width` lists every fixed declared token and each
|
|
59
|
+
`layout.fixedWidthUnits` file that sets a fixed width; `layout-width-noop` flags a `min()` that
|
|
60
|
+
stays under 96 px.
|
|
61
|
+
- The finding says which fix applies to which part, and which fixes do not work.
|
|
62
|
+
- **`srcset` needs `sizes` in the starter `Image`'s types.** Passing either one without the other is
|
|
63
|
+
a type error, in both frameworks.
|
|
64
|
+
|
|
65
|
+
## 0.3.50
|
|
66
|
+
|
|
32
67
|
- **Images reserve space and choose how they load.** New `img-attributes` error for a raw `<img>`
|
|
33
68
|
without `loading`, or without dimensions, in components, patterns and compositions. A spread or
|
|
34
69
|
a class from elsewhere is an `img-attributes-unresolved` info item. A `srcset` with width
|
package/docs/GUIDE.md
CHANGED
|
@@ -499,14 +499,17 @@ There is no warning level.
|
|
|
499
499
|
| Gate | What runs |
|
|
500
500
|
|---|---|
|
|
501
501
|
| `ads check` | Static token, theme, brand, accessibility, ownership, import and coverage rules; no browser |
|
|
502
|
-
| `ads audit` | axe-core (WCAG A/AA rules), ADS's non-text contrast check, `layout-shift` and `layout-overflow` at 390, 768 and 1280 px in every component, pattern and composition scenario, once per brand and theme |
|
|
502
|
+
| `ads audit` | axe-core (WCAG A/AA rules), ADS's non-text contrast check, `layout-shift` and `layout-overflow` at 390, 768 and 1280 px in every component, pattern and composition scenario, once per brand and theme, and in a 240 px container for components and patterns |
|
|
503
503
|
| `ads validate` | The validation policy: `ads check` rules, `validation.checks` scripts, current previews, registered behavior checks (`validation.behaviorChecks`, default `true`) and the browser audit |
|
|
504
504
|
| `ads validate --policy acceptance` | The acceptance policy against current source, applying nothing: `ads check` rules, `acceptance.checks` scripts, affected behavior checks when `acceptance.behaviorChecks` is `true` (default `false`) and the browser audit |
|
|
505
505
|
| MCP acceptance | `ads_accept`, `ads_apply_patch` and `ads_apply_transaction` run the acceptance policy on an isolated candidate and write no source unless it passes; the audit covers the candidate's affected UI scenarios (all of them after configuration, foundation, token or asset changes) |
|
|
506
506
|
|
|
507
507
|
**Browser audit.** Both policies run it by default. Each `a11y-axe`,
|
|
508
508
|
`a11y-non-text-contrast`, `layout-overflow` and `layout-shift` finding is an error that fails the policy, and an audit that cannot run fails it with a `browser-audit` error
|
|
509
|
-
naming what to install.
|
|
509
|
+
naming what to install. Each `a11y-incomplete` finding is an info item that fails nothing: axe could
|
|
510
|
+
not decide that rule on those elements, so check it by hand. It names the axe rule, scenario, themes,
|
|
511
|
+
elements, and axe's reason, such as `bgGradient` for text over a gradient. The audit needs the
|
|
512
|
+
project's Playwright and a browser:
|
|
510
513
|
|
|
511
514
|
```sh
|
|
512
515
|
npm install -D @playwright/test # ads create and ads init declare it
|
|
@@ -585,39 +588,52 @@ set to 0 under `prefers-reduced-motion`), `a11y-text-spacing` (`--leading-normal
|
|
|
585
588
|
**Layout.** Widths are fluid on the grid.
|
|
586
589
|
|
|
587
590
|
`layout-fixed-width` (`ads check`) reads component, pattern and composition styles: `width`,
|
|
588
|
-
`min-width`, `
|
|
589
|
-
|
|
590
|
-
|
|
591
|
+
`min-width`, `inline-size`, `min-inline-size`, `flex-basis`, the basis of `flex`, and
|
|
592
|
+
`grid-template-columns` tracks. Component variables declared in the same template and `var()`
|
|
593
|
+
fallbacks are read through. Each value is read at the smallest and largest container it can have,
|
|
594
|
+
so what counts is whether it can shrink.
|
|
591
595
|
|
|
592
596
|
| Value | Result |
|
|
593
597
|
|---|---|
|
|
594
|
-
|
|
|
595
|
-
|
|
|
596
|
-
|
|
|
597
|
-
| `min()`, `
|
|
598
|
-
| A
|
|
599
|
-
|
|
|
600
|
-
|
|
|
598
|
+
| 96 px or less, in any unit, raw, through a token or by arithmetic: `64px`, `12ch`, `var(--control-height-lg)` | Pass: a small part may use a plain size |
|
|
599
|
+
| Fixed above 96 px, in any unit: `280px`, `32.5ch`, `20rem`, `var(--space-80)`, `calc(var(--space-32) * 10)` | Error. `ch`, `em`, `ex`, `lh` and `rem` are fixed lengths, estimated at a 16 px font |
|
|
600
|
+
| Unable to shrink below 96 px: `max(100%, 280px)`, `clamp(200px, 50%, 400px)`, `calc(100% + 200px)`, a `minmax(200px, 1fr)` track | Error |
|
|
601
|
+
| Able to shrink: `min(100%, 280px)`, `calc(100% - 200px)`, `50cqi`, a `minmax(0, 280px)` track, `width: 280px` with `max-width: 100%` in the same rule | Pass |
|
|
602
|
+
| A flex item that grows and shrinks: `flex: 1 1 280px` | Pass |
|
|
603
|
+
| A track repeated with `auto-fill` or `auto-fit`: `repeat(auto-fit, minmax(200px, 1fr))` | Pass: it wraps |
|
|
604
|
+
| `%`, `fr`, viewport and container units, `auto`, `min-content`, `max-content`, `fit-content` | Pass |
|
|
605
|
+
| `max-width`, `max-inline-size`, in any unit: `max-width: 1400px` | Not read: a maximum cannot force overflow |
|
|
606
|
+
| A token named by `layout.widthTokens`, used plainly | Pass, and listed for review when it is fixed |
|
|
607
|
+
| A variable with no definition ADS can read: `var(--set-at-runtime)` | Pass: `layout-overflow` renders it |
|
|
608
|
+
|
|
609
|
+
No token name is exempt: `var(--side-pane-width)` is 280 px whatever it is called.
|
|
610
|
+
|
|
611
|
+
The fix depends on the part:
|
|
612
|
+
|
|
613
|
+
- A small part stays at 96 px or less, as a plain size.
|
|
614
|
+
- A panel, column or anything else that can give way: `width: min(100%, 280px)`,
|
|
615
|
+
`flex: 1 1 280px` or a `minmax(0, 280px)` track.
|
|
616
|
+
- A part that truly stays that wide: a token listed in `layout.widthTokens`, used plainly.
|
|
601
617
|
|
|
602
618
|
`layout` in `ds.config.json` has two fields:
|
|
603
619
|
|
|
604
620
|
```json
|
|
605
621
|
{ "layout": {
|
|
606
|
-
"widthTokens": ["--
|
|
622
|
+
"widthTokens": ["--side-pane-width", "--ux-panel-*"],
|
|
607
623
|
"fixedWidthUnits": ["components/Overlays/*", "design-system/patterns/Menu/**"]
|
|
608
624
|
} }
|
|
609
625
|
```
|
|
610
626
|
|
|
611
|
-
- `widthTokens`: token names or globs
|
|
612
|
-
fixed definition is an error at the token. A fixed `--container-*` or `--content-max` token
|
|
613
|
-
is the exception, a cap valid only as `max-width` or `max-inline-size`.
|
|
627
|
+
- `widthTokens`: token names or globs of widths that stay fixed.
|
|
614
628
|
- `fixedWidthUnits`: unit ids or project-relative file globs (`*` within a path segment, `**`
|
|
615
|
-
across them)
|
|
629
|
+
across them) whose widths are not checked. List overlays here: dialogs, menus, popovers and
|
|
616
630
|
tooltips. There is no per-declaration exception.
|
|
617
631
|
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
(`
|
|
632
|
+
`layout-declared-width` is a review item for each fixed `widthTokens` token, with how many widths
|
|
633
|
+
use it, and for each `fixedWidthUnits` file that sets a fixed width. `layout-width-noop` is a
|
|
634
|
+
review item for a `min()` or `clamp()` that never exceeds 96 px, such as `min(100%, 64px)`: write
|
|
635
|
+
the plain size. An entry that matches no token, unit or file is a `layout-config` error, and an
|
|
636
|
+
entry cannot name every token or unit.
|
|
621
637
|
|
|
622
638
|
`layout-overflow` (browser audit) resizes each rendered scenario, in every theme and brand, to
|
|
623
639
|
390, 768 and 1280 px. Each finding names the scenario, widths, themes, brands and elements:
|
|
@@ -629,6 +645,20 @@ width: a `--grid-span-N` token in a container query, `%` or `fr`, or a `ch` meas
|
|
|
629
645
|
Exempt: `overflow-x: auto` or `scroll` scrollers and their content, `text-overflow: ellipsis`,
|
|
630
646
|
carousels (`aria-roledescription="carousel"`), native text fields, fixed-position layers and visually hidden content.
|
|
631
647
|
|
|
648
|
+
Each measurement waits for layout to stop moving, so a component that refits after a resize is
|
|
649
|
+
measured after it refits.
|
|
650
|
+
|
|
651
|
+
It also renders each component and pattern scenario with its container narrowed to 240 px, inside
|
|
652
|
+
the 1280 px viewport, once per brand, to show what would not fit a side pane. These are
|
|
653
|
+
`layout-overflow-narrow` review items: fix the part if it can sit in a pane, or change a scenario's
|
|
654
|
+
demo frame to a maximum.
|
|
655
|
+
|
|
656
|
+
- An element past the container's edge, or cut off inside it, is reported when it or something in it
|
|
657
|
+
has a set width, `min-width` or unshrinking `flex-basis` above 96 px. A row or table held open only
|
|
658
|
+
by its content, or by parts of 96 px or less, is not reported.
|
|
659
|
+
- Not rendered this way: compositions, scenarios with a `main` landmark, which are pages, and owners
|
|
660
|
+
in `layout.fixedWidthUnits`, which float above the layout.
|
|
661
|
+
|
|
632
662
|
**Web performance.** MCP serves this as `ads://guides/performance`.
|
|
633
663
|
|
|
634
664
|
| Rule | Gate | Fails |
|