@reqvire-org/ads 0.3.50 → 0.3.52
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/axe-run.mjs +17 -0
- package/dist/browser-audit/first-render.mjs +18 -0
- package/dist/browser-audit/layout-overflow.mjs +88 -41
- package/dist/browser-audit/non-text-contrast.mjs +12 -7
- package/dist/browser-audit/render-states.mjs +182 -0
- package/dist/browser-audit/worker.mjs +23 -12
- package/dist/browser-audit.mjs +56 -13
- package/dist/bun-compiler.mjs +9 -1
- package/dist/capture/worker.mjs +2 -5
- package/dist/check.mjs +5 -3
- package/dist/cli.mjs +11 -5
- package/dist/config.mjs +2 -2
- package/dist/finding-rules.mjs +11 -0
- package/dist/layout-widths.mjs +132 -79
- package/dist/mcp/preview-watch.mjs +2 -2
- package/dist/mcp/server.mjs +2 -2
- package/dist/preview-resources.mjs +4 -1
- package/dist/scenarios-compiler.mjs +2 -2
- package/dist/skills/ads-break-ui/SKILL.md +2 -1
- package/dist/skills/ads-break-ui/references/design-data.md +34 -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 +34 -14
- package/dist/skills/ads-designer/references/validation.md +1 -1
- package/dist/skills/ads-import/references/design-data.md +34 -14
- package/dist/skills/ads-import/references/validation.md +1 -1
- package/dist/skills/ads-motion/references/design-data.md +34 -14
- package/dist/skills/ads-motion/references/validation.md +1 -1
- package/dist/skills/ads-port/references/design-data.md +34 -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 +81 -12
- package/docs/GUIDE.md +77 -23
- 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,43 @@ 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
|
+
| A resizable part | A `clamp()` of three such tokens; a runtime variable needs a declared fallback: `clamp(var(--pane-min), var(--ux-pane, var(--pane)), var(--pane-max))` |
|
|
171
|
+
| An overlay: dialog, menu, popover, tooltip | Its owner in `layout.fixedWidthUnits`, by unit id or file glob |
|
|
172
|
+
|
|
173
|
+
These do not fix it:
|
|
174
|
+
|
|
175
|
+
- Another unit. `32.5ch`, `20em` and `20rem` are as fixed as `280px`, and depend on the font too.
|
|
176
|
+
`ch` and `em` are measured at the rule's `font-size`, or 16 px.
|
|
177
|
+
- `max(100%, 280px)`, `clamp(200px, 50%, 400px)`, `calc(100% + 200px)`: they cannot shrink below
|
|
178
|
+
their fixed part.
|
|
179
|
+
- `min(100%, 64px)` around a small part. `layout-width-noop` asks for the plain size; in a flex or
|
|
180
|
+
grid parent the percentage can affect wrapping, so compare the scenario after changing it.
|
|
181
|
+
- A token name. `--control-*`, `--side-pane-*` and every other name are read for their value.
|
|
182
|
+
|
|
183
|
+
`ads check` lists every declared fixed width for review (`layout-declared-width`). There is no
|
|
184
|
+
per-declaration exception.
|
|
185
|
+
|
|
186
|
+
`ads audit` opens each control with `aria-haspopup` and measures what opens, hovers and focuses
|
|
187
|
+
controls for contrast, and checks a control with `aria-busy="true"`. So give overlay triggers
|
|
188
|
+
`aria-haspopup`, or render the overlay open in its scenario, and render a busy example.
|
|
171
189
|
|
|
172
190
|
`layout-overflow` (`ads audit`) renders every UI scenario at 390, 768 and 1280 px and fails on
|
|
173
191
|
horizontal page overflow, elements past the viewport and clipped content. `overflow-x: auto`
|
|
174
|
-
scrollers and `text-overflow: ellipsis` are exempt.
|
|
192
|
+
scrollers and `text-overflow: ellipsis` are exempt. It also renders components and patterns in a
|
|
193
|
+
240 px container, and fails when a set width above 96 px overflows it. Make that width fluid, or
|
|
194
|
+
scroll it. Only an overlay's owner, listed in `layout.fixedWidthUnits`, stays out of this render.
|
|
175
195
|
|
|
176
196
|
## Color roles and states
|
|
177
197
|
|
|
@@ -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,43 @@ 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
|
+
| A resizable part | A `clamp()` of three such tokens; a runtime variable needs a declared fallback: `clamp(var(--pane-min), var(--ux-pane, var(--pane)), var(--pane-max))` |
|
|
171
|
+
| An overlay: dialog, menu, popover, tooltip | Its owner in `layout.fixedWidthUnits`, by unit id or file glob |
|
|
172
|
+
|
|
173
|
+
These do not fix it:
|
|
174
|
+
|
|
175
|
+
- Another unit. `32.5ch`, `20em` and `20rem` are as fixed as `280px`, and depend on the font too.
|
|
176
|
+
`ch` and `em` are measured at the rule's `font-size`, or 16 px.
|
|
177
|
+
- `max(100%, 280px)`, `clamp(200px, 50%, 400px)`, `calc(100% + 200px)`: they cannot shrink below
|
|
178
|
+
their fixed part.
|
|
179
|
+
- `min(100%, 64px)` around a small part. `layout-width-noop` asks for the plain size; in a flex or
|
|
180
|
+
grid parent the percentage can affect wrapping, so compare the scenario after changing it.
|
|
181
|
+
- A token name. `--control-*`, `--side-pane-*` and every other name are read for their value.
|
|
182
|
+
|
|
183
|
+
`ads check` lists every declared fixed width for review (`layout-declared-width`). There is no
|
|
184
|
+
per-declaration exception.
|
|
185
|
+
|
|
186
|
+
`ads audit` opens each control with `aria-haspopup` and measures what opens, hovers and focuses
|
|
187
|
+
controls for contrast, and checks a control with `aria-busy="true"`. So give overlay triggers
|
|
188
|
+
`aria-haspopup`, or render the overlay open in its scenario, and render a busy example.
|
|
171
189
|
|
|
172
190
|
`layout-overflow` (`ads audit`) renders every UI scenario at 390, 768 and 1280 px and fails on
|
|
173
191
|
horizontal page overflow, elements past the viewport and clipped content. `overflow-x: auto`
|
|
174
|
-
scrollers and `text-overflow: ellipsis` are exempt.
|
|
192
|
+
scrollers and `text-overflow: ellipsis` are exempt. It also renders components and patterns in a
|
|
193
|
+
240 px container, and fails when a set width above 96 px overflows it. Make that width fluid, or
|
|
194
|
+
scroll it. Only an overlay's owner, listed in `layout.fixedWidthUnits`, stays out of this render.
|
|
175
195
|
|
|
176
196
|
## Color roles and states
|
|
177
197
|
|
|
@@ -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,43 @@ 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
|
+
| A resizable part | A `clamp()` of three such tokens; a runtime variable needs a declared fallback: `clamp(var(--pane-min), var(--ux-pane, var(--pane)), var(--pane-max))` |
|
|
171
|
+
| An overlay: dialog, menu, popover, tooltip | Its owner in `layout.fixedWidthUnits`, by unit id or file glob |
|
|
172
|
+
|
|
173
|
+
These do not fix it:
|
|
174
|
+
|
|
175
|
+
- Another unit. `32.5ch`, `20em` and `20rem` are as fixed as `280px`, and depend on the font too.
|
|
176
|
+
`ch` and `em` are measured at the rule's `font-size`, or 16 px.
|
|
177
|
+
- `max(100%, 280px)`, `clamp(200px, 50%, 400px)`, `calc(100% + 200px)`: they cannot shrink below
|
|
178
|
+
their fixed part.
|
|
179
|
+
- `min(100%, 64px)` around a small part. `layout-width-noop` asks for the plain size; in a flex or
|
|
180
|
+
grid parent the percentage can affect wrapping, so compare the scenario after changing it.
|
|
181
|
+
- A token name. `--control-*`, `--side-pane-*` and every other name are read for their value.
|
|
182
|
+
|
|
183
|
+
`ads check` lists every declared fixed width for review (`layout-declared-width`). There is no
|
|
184
|
+
per-declaration exception.
|
|
185
|
+
|
|
186
|
+
`ads audit` opens each control with `aria-haspopup` and measures what opens, hovers and focuses
|
|
187
|
+
controls for contrast, and checks a control with `aria-busy="true"`. So give overlay triggers
|
|
188
|
+
`aria-haspopup`, or render the overlay open in its scenario, and render a busy example.
|
|
171
189
|
|
|
172
190
|
`layout-overflow` (`ads audit`) renders every UI scenario at 390, 768 and 1280 px and fails on
|
|
173
191
|
horizontal page overflow, elements past the viewport and clipped content. `overflow-x: auto`
|
|
174
|
-
scrollers and `text-overflow: ellipsis` are exempt.
|
|
192
|
+
scrollers and `text-overflow: ellipsis` are exempt. It also renders components and patterns in a
|
|
193
|
+
240 px container, and fails when a set width above 96 px overflows it. Make that width fluid, or
|
|
194
|
+
scroll it. Only an overlay's owner, listed in `layout.fixedWidthUnits`, stays out of this render.
|
|
175
195
|
|
|
176
196
|
## Color roles and states
|
|
177
197
|
|
|
@@ -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,103 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## 0.3.
|
|
3
|
+
## 0.3.52
|
|
4
4
|
|
|
5
5
|
<!-- ads-local-tests:start -->
|
|
6
|
-
Local verification: **
|
|
7
|
-
Tested commit: `
|
|
8
|
-
Completed 2026-11-
|
|
6
|
+
Local verification: **770/770 passed** with `ADS_TEST_BUN=1 npm test`.
|
|
7
|
+
Tested commit: `adeddf07a52742b7c59489af892386db40d2cffa`; Node v24.13.0, Bun 1.4.1.
|
|
8
|
+
Completed 2026-11-02T14:52:08.397Z (1076 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.52",
|
|
14
|
+
"commit": "adeddf07a52742b7c59489af892386db40d2cffa",
|
|
15
|
+
"sourceSha256": "50d65df97db4e4f86ab1f1973d7ec5fa0d5fb80facece575484116781df60e6c",
|
|
16
16
|
"command": "ADS_TEST_BUN=1 npm test",
|
|
17
17
|
"result": "pass",
|
|
18
|
-
"tests":
|
|
19
|
-
"pass":
|
|
18
|
+
"tests": 770,
|
|
19
|
+
"pass": 770,
|
|
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-02T14:52:08.397Z",
|
|
26
|
+
"durationMs": 1075944,
|
|
27
|
+
"logSha256": "b4c0f94cc4bfca21785e7f71b1042daa23d922a0ab5e0056b575e06054e83ba7"
|
|
28
28
|
}
|
|
29
29
|
-->
|
|
30
30
|
<!-- ads-local-tests:end -->
|
|
31
31
|
|
|
32
|
+
- **The audit opens overlays.** It clicks each distinct `aria-haspopup` control, up to 3 per render,
|
|
33
|
+
and runs axe, non-text contrast and a phone-width check on what opens, in every theme. An overlay a
|
|
34
|
+
scenario renders open is measured the same way. Results name the state, such as
|
|
35
|
+
`open overlay "Edit": button`. New `overlaysOpened` in the audit result.
|
|
36
|
+
- **The audit measures hover, keyboard focus and busy.** Up to 6 distinct controls per render are
|
|
37
|
+
hovered and focused: axe `color-contrast` and non-text contrast under hover, and a focus outline at
|
|
38
|
+
3:1 against what is around it (`a11y-non-text-contrast`, kind `focus`). What already fails at rest
|
|
39
|
+
is not repeated. A control with `aria-busy="true"` is checked even when disabled, and its spinner
|
|
40
|
+
even when it has text, if the scenario renders it busy. New `controlsMeasured` in the result.
|
|
41
|
+
- **Nothing is hovered at rest.** The audit parks the mouse first: an element at the page's corner
|
|
42
|
+
was measured in its hover state.
|
|
43
|
+
- **A font preloaded in a preview is one download.** The Bun preview compiler named one file twice
|
|
44
|
+
when a stylesheet and a `?url` import both reached it. Files with nothing rewritten in them are now
|
|
45
|
+
named by their bytes.
|
|
46
|
+
- **`layout-overflow-narrow` leaves out what folds on a viewport query.** A finding that clears at the
|
|
47
|
+
phone viewport, still in the 240 px container, is site chrome that responds to the window.
|
|
48
|
+
- **The viewport overflow check sees inside a preview frame.** The outermost box as tall as the window no
|
|
49
|
+
longer counts as an intended scroller or clip, so `overflow-y: auto` on a project's frame stops
|
|
50
|
+
exempting everything in it. This can surface new `layout-overflow` errors on upgrade.
|
|
51
|
+
- **`ch` and `em` follow the rule's font size.** `layout-fixed-width` measures them at a `font-size`
|
|
52
|
+
set in the same rule, through its token. Otherwise it stays at 16 px.
|
|
53
|
+
- **A resizable part has a route.** `layout-fixed-width` accepts a `clamp()` whose three values are
|
|
54
|
+
all `layout.widthTokens` tokens, also through a local variable, and each stays listed for review. A
|
|
55
|
+
runtime variable there needs a declared fallback. With no fallback, the clamp's floor is measured.
|
|
56
|
+
- **`layout-width-noop` is more careful.** It says the value does not protect against overflow and a
|
|
57
|
+
plain size is clearer, and to compare the scenario after changing it, since the percentage can
|
|
58
|
+
affect wrapping in a flex or grid parent.
|
|
59
|
+
- **Policy errors no longer stop `ads audit`.** It renders every scenario and reports them with its
|
|
60
|
+
own findings, and exits 1. Only errors that stop rendering block it: `source-syntax`, `css-syntax`,
|
|
61
|
+
`project-structure`, `styles-entry`, `scenario-contract`. `ads check`, `ads compile` and
|
|
62
|
+
`ads validate` are unchanged, and the audit's result gains `staticErrors`.
|
|
63
|
+
|
|
64
|
+
## 0.3.51
|
|
65
|
+
|
|
66
|
+
- **The audit lists what axe could not decide.** New `a11y-incomplete` info item, one per scenario,
|
|
67
|
+
axe rule and element set, with the elements and axe's reason, such as `bgGradient`: check it by
|
|
68
|
+
hand. It fails nothing. `incomplete` in the audit result now counts these items, and the text
|
|
69
|
+
summary shows the count.
|
|
70
|
+
- **The audit and captures no longer hang on a lazy image.** Waiting for `decode()` on a
|
|
71
|
+
`loading="lazy"` image outside the viewport or not rendered never settled, so `ads audit`,
|
|
72
|
+
`ads validate` and captures could stop until their time limit. Only images that are loading are
|
|
73
|
+
waited on, within one overall limit of 5 s.
|
|
74
|
+
- **The audit renders components and patterns in a narrow container.** Each scenario's container
|
|
75
|
+
is narrowed to 240 px, and a set width, `min-width` or unshrinking `flex-basis` above 96 px that
|
|
76
|
+
overflows it is a `layout-overflow-narrow` review item. Compositions, scenarios with a `main`
|
|
77
|
+
landmark and `layout.fixedWidthUnits` owners stay out.
|
|
78
|
+
- **`--json` output is complete when piped.** Under Bun it stopped at 64 KB.
|
|
79
|
+
- **The audit measures overflow after a resize settles.** It waits until layout has stopped moving
|
|
80
|
+
for a few frames, and gives a page that looks wrong more frames, so a component refitting through
|
|
81
|
+
`ResizeObserver`, `requestAnimationFrame` or a timer is not reported. A real overflow still is.
|
|
82
|
+
- **`layout-fixed-width` asks whether a width can shrink.** A width, `flex-basis` or grid track is
|
|
83
|
+
an error when it cannot shrink below 96 px, up from 48 px, so small parts use plain sizes.
|
|
84
|
+
- `ch`, `em`, `ex` and `lh` now count as fixed, like `px` and `rem`.
|
|
85
|
+
- `max(100%, 280px)`, `clamp(200px, 50%, 400px)`, `calc(100% + 200px)` and a `minmax(200px, 1fr)`
|
|
86
|
+
track are errors. A `minmax(0, 280px)` track passes.
|
|
87
|
+
- `max-width` and `max-inline-size` are no longer read: a maximum cannot force overflow.
|
|
88
|
+
- No token name is exempt. `--control-*`, `--side-pane-*`, `--icon-*` and the others are read for
|
|
89
|
+
their value.
|
|
90
|
+
- `layout.widthTokens` now names widths that stay fixed, with no fluid definition required. Remove
|
|
91
|
+
`--grid-span-*`, `--container-*` and `--content-max` entries: they no longer need declaring.
|
|
92
|
+
- New review items: `layout-declared-width` lists every fixed declared token and each
|
|
93
|
+
`layout.fixedWidthUnits` file that sets a fixed width; `layout-width-noop` flags a `min()` that
|
|
94
|
+
stays under 96 px.
|
|
95
|
+
- The finding says which fix applies to which part, and which fixes do not work.
|
|
96
|
+
- **`srcset` needs `sizes` in the starter `Image`'s types.** Passing either one without the other is
|
|
97
|
+
a type error, in both frameworks.
|
|
98
|
+
|
|
99
|
+
## 0.3.50
|
|
100
|
+
|
|
32
101
|
- **Images reserve space and choose how they load.** New `img-attributes` error for a raw `<img>`
|
|
33
102
|
without `loading`, or without dimensions, in components, patterns and compositions. A spread or
|
|
34
103
|
a class from elsewhere is an `img-attributes-unresolved` info item. A `srcset` with width
|