@reqvire-org/ads 0.5.3 → 0.5.5
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/dist/ads-errors.mjs +105 -8
- package/dist/analysis/client-directive.mjs +26 -0
- package/dist/analysis/externals.mjs +47 -0
- package/dist/analysis/module-graph.mjs +6 -0
- package/dist/analysis/owner-analysis-key.mjs +1 -1
- package/dist/analysis/owner-choices.mjs +14 -2
- package/dist/analysis/owner-composition.mjs +32 -4
- package/dist/analysis/owner-source.mjs +121 -17
- package/dist/border-paint.mjs +34 -0
- package/dist/check.mjs +2 -0
- package/dist/composed-contrast.mjs +34 -12
- package/dist/construction-output.mjs +58 -31
- package/dist/construction-spec.d.mts +111 -15
- package/dist/construction-spec.mjs +129 -20
- package/dist/corner-overpaint.mjs +3 -1
- package/dist/design-foundation.mjs +18 -4
- package/dist/emit/owner-emission-cache.mjs +1 -1
- package/dist/end-alignment.mjs +69 -0
- package/dist/external-macro.d.mts +20 -0
- package/dist/external-macro.mjs +12 -0
- package/dist/finding-rules.mjs +3 -0
- package/dist/forced-colors.mjs +81 -0
- package/dist/frame-regions.mjs +2 -2
- package/dist/guard/externals.mjs +64 -0
- package/dist/guard/run.mjs +9 -5
- package/dist/inventories.mjs +1 -1
- package/dist/lowering-layer.mjs +38 -4
- package/dist/lowering-overlaps.mjs +13 -1
- package/dist/lowering-properties.mjs +4 -0
- package/dist/lowering-region-layout.mjs +22 -3
- package/dist/lowering-session.mjs +1 -1
- package/dist/lowering-transitions.mjs +1 -0
- package/dist/mcp/preview-http.bundle.js +2 -2
- package/dist/mcp/preview-widget.bundle.js +12 -12
- package/dist/measured-geometry.mjs +8 -2
- package/dist/owner-analysis-check.mjs +190 -11
- package/dist/owner-errors.mjs +3 -0
- package/dist/owner-lowering.mjs +3 -2
- package/dist/ownership-model.mjs +14 -5
- package/dist/platform-features.mjs +7 -0
- package/dist/preview-bun.mjs +15 -2
- package/dist/profile-macro.d.mts +18 -0
- package/dist/recipe-macro.d.mts +107 -9
- package/dist/recipe-model.mjs +22 -8
- package/dist/region-lowering.mjs +204 -49
- package/dist/render-audit/axe-run.page.mjs +40 -1
- package/dist/render-audit/forced-states.page.mjs +37 -0
- package/dist/render-audit/layout-overflow.page.mjs +52 -2
- package/dist/render-audit/non-text-contrast.page.mjs +14 -10
- package/dist/render-audit/worker.mjs +38 -0
- package/dist/render-audit.mjs +42 -5
- package/dist/role-vocabulary.d.mts +5 -2
- package/dist/role-vocabulary.mjs +6 -3
- package/dist/scenario-kit.d.mts +2 -2
- package/dist/showcase/assets-view.mjs +12 -47
- package/dist/showcase/client.bundle.js +50 -50
- package/dist/showcase/http-client.bundle.js +18 -18
- package/dist/showcase/token-sample.mjs +2 -2
- package/dist/showcase/ui/ui.css +1 -1
- package/dist/showcase/ui/ui.js +13 -13
- package/dist/skills/ads-designer/references/accessibility.md +21 -1
- package/dist/skills/ads-designer/references/branding.md +4 -0
- package/dist/skills/ads-designer/references/design-data.md +6 -0
- package/dist/skills/ads-designer/references/layers.md +5 -0
- package/dist/skills/ads-designer/references/layout.md +8 -1
- package/dist/skills/ads-designer/references/recipes.md +52 -2
- package/dist/skills/ads-designer/references/runtimes.md +4 -0
- package/dist/skills/ads-designer/references/scenarios.md +2 -0
- package/dist/skills/ads-import/references/design-data.md +6 -0
- package/dist/skills/ads-import/references/layers.md +5 -0
- package/dist/skills/ads-import/references/layout.md +8 -1
- package/dist/skills/ads-import/references/recipes.md +52 -2
- package/dist/skills/ads-import/references/runtimes.md +4 -0
- package/dist/skills/ads-import/references/scenarios.md +2 -0
- package/dist/skills/ads-migrate/SKILL.md +2 -0
- package/dist/skills/ads-migrate/references/0.5.3-to-0.5.4.md +42 -0
- package/dist/skills/ads-migrate/references/0.5.4-to-0.5.5.md +61 -0
- package/dist/skills/ads-port/references/design-data.md +6 -0
- package/dist/skills/ads-port/references/layers.md +5 -0
- package/dist/skills/ads-port/references/layout.md +8 -1
- package/dist/skills/ads-port/references/recipes.md +52 -2
- package/dist/skills/ads-port/references/runtimes.md +4 -0
- package/dist/skills/ads-port/references/scenarios.md +2 -0
- package/dist/spatial-model.mjs +37 -10
- package/dist/system-colors.d.mts +9 -0
- package/dist/system-colors.mjs +1 -0
- package/dist/target-size.mjs +14 -1
- package/dist/tsconfig.declarations.json +1 -0
- package/docs/ADS.md +23 -1
- package/docs/ASSETS.md +21 -0
- package/docs/CACHING.md +1 -1
- package/docs/CHANGELOG.md +220 -21
- package/docs/GUIDE.md +31 -20
- package/docs/LANGUAGE.md +146 -11
- package/docs/MOTION.md +11 -1
- package/docs/PROFILE-KINDS.md +60 -9
- package/docs/RULES.md +21 -8
- package/package.json +5 -1
|
@@ -32,7 +32,8 @@ The `a11y-*` rules check tokens, profiles and constructions (WCAG 2.2 AA):
|
|
|
32
32
|
|
|
33
33
|
| Rule | What it requires | WCAG |
|
|
34
34
|
|---|---|---|
|
|
35
|
-
| `a11y-target-size` | Every control and `frame: "control"` part is at least 24 × 24px, computed from its lowered box in every theme, brand and condition, a frame's `min-target-inline-size`/`min-target-block-size` hit area included; a smaller part of a stack or inline arrangement passes by the spacing exception when 24px circles centred on it and its neighbouring targets keep clear; neighbouring hit areas never overlap | 2.5.8 |
|
|
35
|
+
| `a11y-target-size` | Every control and `frame: "control"` part is at least 24 × 24px, computed from its lowered box in every theme, brand and condition, a frame's `min-target-inline-size`/`min-target-block-size` hit area included; a smaller part of a stack or inline arrangement passes by the spacing exception when 24px circles centred on it and its neighbouring targets keep clear, as does a private control component the design system places only as a component part of such arrangements; neighbouring hit areas never overlap | 2.5.8 |
|
|
36
|
+
| `a11y-forced-colors` | A control keeps an edge in forced colours (Windows contrast themes): its frame draws a border in every context (`borderStyle: "forced-only"` keeps it transparent otherwise); a surface's `forcedColors` names CSS system colours. `a11y-forced-colors-review` lists a selected, pressed, checked or current state shown only by fill without `forcedColors` | 1.4.11 |
|
|
36
37
|
| `a11y-focus` | Every focus profile's width is at least 2px; the default indicator `foundation({ focus })` has 3:1 on the document surface | 2.4.7, 1.4.11 |
|
|
37
38
|
| `surface-contrast` | A surface profile setting `color` and `background` reaches 4.5:1 in every context, or 3:1 where every use of it is large text or artwork (a visual part, a text-less control), and has no minimum where every use is an `aria-hidden` visual part, or where its `color` is fully transparent (a glyph shown only on hover: it draws nothing at rest, and the states that show it keep their minimum); a surface for disabled controls declares `state: "inactive"` (no minimum) and is selected only under `:disabled` or `[aria-disabled="true"]` (`construction/inactive-surface-active`) | 1.4.3 |
|
|
38
39
|
| `a11y-text-resize` | `font-size` and length `line-height` tokens in `rem` or `em` | 1.4.4 |
|
|
@@ -119,6 +120,16 @@ the candidates with their ratios and let them choose.
|
|
|
119
120
|
color carries normal-size text, so the system has one passing variant, not several.
|
|
120
121
|
|
|
121
122
|
<a id="declared-boundary"></a>
|
|
123
|
+
|
|
124
|
+
- **Decorative text.** Text inside `aria-hidden="true"` (a breadcrumb's "/") has no contrast minimum, as decorative
|
|
125
|
+
artwork has none. Never hide information that way.
|
|
126
|
+
- **Forced colours.** A surface's `forcedColors` (`background`, `color`, `border`, from CSS system colours) is
|
|
127
|
+
written under `@media (forced-colors: active)`; a control's frame draws a border, or `borderStyle: "forced-only"`
|
|
128
|
+
(`a11y-forced-colors`); a selected, pressed, checked or current state shown only by fill is reviewed.
|
|
129
|
+
- **Icons in provided colours** are proven at 3:1 through every placement, as text is.
|
|
130
|
+
- **Small controls placed by another owner** pass 2.5.8's spacing exception when private and placed only between
|
|
131
|
+
spaced neighbours in the design system's arrangements.
|
|
132
|
+
|
|
122
133
|
## A declared boundary: rare, and only with a person's approval
|
|
123
134
|
|
|
124
135
|
`a11y-non-text-contrast` stays an error at WCAG 2.2 AA. When a text field's design
|
|
@@ -200,6 +211,15 @@ tests, Lighthouse) and report what ran.
|
|
|
200
211
|
A clean audit is not a pass: automated rules find only part of the WCAG failures. Keep the
|
|
201
212
|
manual checks below.
|
|
202
213
|
|
|
214
|
+
- **Environment passes.** Each scenario is also audited in forced colours and with a coarse pointer; axe findings new
|
|
215
|
+
there name the environment, and in forced colours a selected, pressed, checked or current element that renders
|
|
216
|
+
like its sibling without that state fails (`a11y-forced-colors-render`).
|
|
217
|
+
- **What the layout pass reports.** Words broken across lines by a squeezed box (`broken-word`); a scroll area
|
|
218
|
+
collapsed to nothing while it holds content (`collapsed-scroller`); a box whose painted edge a clip cuts (a card's
|
|
219
|
+
border and corners); text, controls and overflow as before. An inert pane of no size is skipped.
|
|
220
|
+
- **What it no longer reports.** A target whose owned hit area is 24 × 24px; `aria-hidden` text (avatar initials)
|
|
221
|
+
as a control's visible label; a multi-colour mark judged by its first outline instead of its strongest paint.
|
|
222
|
+
|
|
203
223
|
## What only design and testing establish
|
|
204
224
|
|
|
205
225
|
- **Color is never the only signal.** Pair status color with text or an icon; underline links
|
|
@@ -164,3 +164,7 @@ own (`assets/logos/`), with a drawing per colour scheme, a `minDrawnHeight` belo
|
|
|
164
164
|
which it is not legible, and its owner's license terms in `license`. An owner
|
|
165
165
|
binds it by name with one visual profile and takes the theme it sits in; the
|
|
166
166
|
example design system's `PartnerLogo` shows the form.
|
|
167
|
+
|
|
168
|
+
A logo with a light and a dark file follows the page's scheme without a `theme` prop: two visual parts with
|
|
169
|
+
`scheme: "light"` and `scheme: "dark"`, each bound for a theme of that scheme (docs/ASSETS.md, "Declared artwork
|
|
170
|
+
that follows the page's scheme").
|
|
@@ -109,6 +109,12 @@ value to disguise it. Shared literals in the proper role sheet remain valid.
|
|
|
109
109
|
Nowhere-declared references keep one `token-css/token-missing` error per authored
|
|
110
110
|
site, including with a fallback and when unused; provenance does not duplicate it.
|
|
111
111
|
|
|
112
|
+
- A token a script reads by name (`getPropertyValue("--toast-duration")`) is emitted with the owner's token CSS.
|
|
113
|
+
- The foundation's document text profile states `fontFamily`, `fontSize` and `lineHeight`: it is every text's
|
|
114
|
+
fallback (`foundation/document-text-incomplete`).
|
|
115
|
+
- A frame that draws a border needs a border paint on its element's surface; without one the border takes the text
|
|
116
|
+
colour (`review/border-paint-missing`).
|
|
117
|
+
|
|
112
118
|
## Units
|
|
113
119
|
|
|
114
120
|
`ads check` restricts the unit in three places: `font-size`, and `line-height`
|
|
@@ -94,6 +94,11 @@ demonstration. See [review.md](review.md).
|
|
|
94
94
|
effects through props and callbacks. Re-exporting an application store, router
|
|
95
95
|
or service from a helper does not make it part of the design system.
|
|
96
96
|
|
|
97
|
+
A component another library supplies (a framework's link) is declared as an external, `external({ from, renders })`
|
|
98
|
+
in `externals/*.ads.ts`, and used as one of an owner's elements: ADS checks it as the element it renders, emits a
|
|
99
|
+
re-export of the real component, previews a stand-in, and `ads-guard` verifies the library renders that element with
|
|
100
|
+
the class and no style of its own.
|
|
101
|
+
|
|
97
102
|
## Styling rules (blocking)
|
|
98
103
|
|
|
99
104
|
Components own their control states and appearance. Patterns own arrangement,
|
|
@@ -55,6 +55,10 @@ context). Breakpoint widths, column counts and condition bounds are compiled int
|
|
|
55
55
|
media queries and track lists, so a context cannot change them
|
|
56
56
|
(`spatial-context-unsupported`): declare another spatial profile instead.
|
|
57
57
|
|
|
58
|
+
- **Gap gutters.** A gutter may be a gap (`gutters: { cards: { gap: "--card-gap" } }`): the grid writes
|
|
59
|
+
`column-gap`, the outer cells sit flush with the region's edges, and tracks share the width left after the gaps.
|
|
60
|
+
Use it for card grids; an edge gutter (`start`, `end`) insets each cell.
|
|
61
|
+
|
|
58
62
|
## Choose the behaviour first
|
|
59
63
|
|
|
60
64
|
| The user wants… | Choose |
|
|
@@ -105,7 +109,10 @@ corners, then the other set under a named condition of the spatial profile:
|
|
|
105
109
|
"end-end"] } } }`. A named condition holds below its bound.
|
|
106
110
|
|
|
107
111
|
Columns of unequal width: `columns: 2, weights: [0.85, 1.15]` on a fluid grid
|
|
108
|
-
(one positive number per local column).
|
|
112
|
+
(one positive number per local column). Columns as wide as their content, a
|
|
113
|
+
space apart (link columns of a footer): `columns: 6, contentFrom: "lg"`; below
|
|
114
|
+
that tier the columns share the width, so place the cells for the narrower
|
|
115
|
+
tiers. Never write `grid-template-columns`.
|
|
109
116
|
|
|
110
117
|
The field exposes its label, control and help rows; `alignRows` binds them through
|
|
111
118
|
subgrid. The cell must span exactly those rows, in the order the component exposes
|
|
@@ -145,7 +145,7 @@ code: an attribute it sets (`data-dragging`, `aria-busy`) or a native state;
|
|
|
145
145
|
a recipe never creates a state machine.
|
|
146
146
|
|
|
147
147
|
- `paintTransition` interpolates `background-color`, `border-color`, `color`,
|
|
148
|
-
`box-shadow`, `filter` (the surface's `blur`, `shapeShadow`, `groupShadow`)
|
|
148
|
+
`text-decoration-color` (a link's underline, the surface's `textDecorationColor`), `box-shadow`, `filter` (the surface's `blur`, `shapeShadow`, `groupShadow`)
|
|
149
149
|
or `backdrop-filter` (`backdropBlur`, `backdropSaturate`) between the base
|
|
150
150
|
surface and its state surfaces, timed by a motion profile with a `static`
|
|
151
151
|
reduced-motion policy. A channel that does not change, an effect that changes
|
|
@@ -164,7 +164,24 @@ a recipe never creates a state machine.
|
|
|
164
164
|
never inject an HTML string. A colour that follows the container (a link in a
|
|
165
165
|
heading) is the container surface's `provides`, not a prop on the link. A list
|
|
166
166
|
item keeps its marker: give it no arrangement, and space a nested list with a
|
|
167
|
-
part's `spaceBefore` in its block flow.
|
|
167
|
+
part's `spaceBefore` in its block flow. A flow that needs many distances gives
|
|
168
|
+
each part its own spacing profile (`spacing: "h2-spacing"` with
|
|
169
|
+
`spaceBefore`/`spaceAfter`). A paragraph or heading part has its browser margin
|
|
170
|
+
reset automatically.
|
|
171
|
+
- Markers: `pseudo: { marker: { surface, text } }` on the list item (a colour-only
|
|
172
|
+
surface, a text profile of weight and numerals) and `markers: [...]` on the
|
|
173
|
+
list (number system per depth). Numbering that the browser's list counter
|
|
174
|
+
cannot give (1.1.2 clauses, numbered headings) is a CSS counter: `counter: {
|
|
175
|
+
reset }` on the container, `counter: { increment }` on each item, and
|
|
176
|
+
`content: { counters | counter, separator, suffix }` on its `marker` or
|
|
177
|
+
`before`. Check marks are a visual part in the item, not a marker.
|
|
178
|
+
- A code block either keeps each line whole and scrolls (`overflow: "scroll-inline"`, focusable) or keeps the text's
|
|
179
|
+
spaces and line breaks and wraps long lines so all of it is visible (`wrap: "preserve"` on its code text). Choose
|
|
180
|
+
by what matters more: lines that read exactly as written, or nothing hidden.
|
|
181
|
+
- A rule between children (table rows, settings rows) is `between: { surface,
|
|
182
|
+
frame }` on their parent, never borders on each child with a last-child
|
|
183
|
+
exception. Text only assistive technology reads (a table caption) is a part
|
|
184
|
+
with `presence: "assistive"`.
|
|
168
185
|
- A colour that depends on where an element sits (links and icons in a tinted
|
|
169
186
|
banner, the cells of a selected row, actions on a dark card) is a contextual
|
|
170
187
|
role: the container's surface profile `provides: { "--link-ink": "--on-warning" }`.
|
|
@@ -262,6 +279,21 @@ fragment or a native frame-only element.
|
|
|
262
279
|
`mandatory` or `proximity`), aligning the children it places. Snap without
|
|
263
280
|
scrolling, or a child's own snap, is rejected.
|
|
264
281
|
|
|
282
|
+
- **Distribution and gaps.** `justify: "space-between"` (or `"space-around"`, `"space-evenly"`) puts a row's or
|
|
283
|
+
stack's free space between its items: a logo at the start of a header and its actions at the end. On a wrapping
|
|
284
|
+
`inline` row, `gap` spaces the items and `rowGap` the lines.
|
|
285
|
+
- **Loose flow.** `carry: true` on a list and on its item: an item that ends in a paragraph, code block or figure is
|
|
286
|
+
followed at the larger of the list's gap and that block's space after; after the last item the list's own space
|
|
287
|
+
after applies.
|
|
288
|
+
- **Filling parts.** `extent: "fill"` in a stack starts at the part's content and grows into free space, so a
|
|
289
|
+
scrolling body never collapses in a stack sized by its content.
|
|
290
|
+
- **End alignment.** Blocks a stack holds end on one line (`source/end-misaligned`): a painted block by its outer
|
|
291
|
+
edge, an unpainted one where its content ends. Put a header on the same grid and gutter as the sections below it.
|
|
292
|
+
- **Tables.** `align: "start"` on a cell (`vertical-align: top` for rows whose cells wrap to different heights);
|
|
293
|
+
`extent: "container"` on a table root makes it as wide as its container.
|
|
294
|
+
- **The document.** One pattern may render the page's `<html>`: `recipe({ element: "document" })`, with `lang`
|
|
295
|
+
from a required prop, `<body>` inside, and the framework's `head` and `end` slots.
|
|
296
|
+
|
|
265
297
|
<a id="layers"></a>
|
|
266
298
|
## Layers
|
|
267
299
|
|
|
@@ -286,6 +318,10 @@ A region recipe's root can live in the browser's top layer through a closed
|
|
|
286
318
|
no authored `open` on a sheet, an accessible name, and no layer root as a grid
|
|
287
319
|
cell. Focus, Escape and dismissal are behaviour guarantees for browser tests.
|
|
288
320
|
|
|
321
|
+
- **Modal cards.** A dialog with `edge: "center"` or `"block-start"` is a card in the viewport, kept the layer
|
|
322
|
+
profile's `viewportMargin` from its edges, fading in with `motion: "fade"`. The backdrop surface may set
|
|
323
|
+
`backdropBlur`. A zoom view grows an image from its place with a measured `translate` and a measured `scale`.
|
|
324
|
+
|
|
289
325
|
<a id="measured"></a>
|
|
290
326
|
## Measured values and runtime paints
|
|
291
327
|
|
|
@@ -361,6 +397,14 @@ text part breaks one way, set by one `wrap` field:
|
|
|
361
397
|
its alignment, on a control's label too. Balanced, pretty and trimmed text degrade to plain wrapping and
|
|
362
398
|
spacing in a browser without them.
|
|
363
399
|
|
|
400
|
+
- **Code that wraps.** `wrap: "preserve"` keeps spaces and line breaks and wraps long lines, so the whole block is
|
|
401
|
+
visible; `overflow: "scroll-inline"` keeps lines whole instead.
|
|
402
|
+
- **Truncation.** One-line `wrap: "truncate"` clips only sideways, so descenders stay whole with a trimmed line box.
|
|
403
|
+
- **Native controls.** A `<button>`, `<input>`, `<textarea>` or `<select>` that a construction draws loses the
|
|
404
|
+
browser's font, centred text, border, fill and margin wherever the construction states none.
|
|
405
|
+
- **Range sliders.** `pseudo: { sliderTrack, sliderThumb }` on an `<input type="range">` part, each a surface and a
|
|
406
|
+
frame profile; the thumb needs 3:1 against the track. Tick labels are a `space-between` row.
|
|
407
|
+
|
|
364
408
|
<a id="assets"></a>
|
|
365
409
|
## Assets in recipes
|
|
366
410
|
|
|
@@ -374,6 +418,12 @@ glyph reference, never a name string. Brand artwork and multicolour drawings
|
|
|
374
418
|
are declared under `assets/`: see `ads://guides/branding` and
|
|
375
419
|
`ads://guides/pictograms`.
|
|
376
420
|
|
|
421
|
+
- **A logo per colour scheme.** Two visual parts, `scheme: "light"` and `scheme: "dark"`, each bound for a theme of
|
|
422
|
+
that scheme, follow the page's scheme with no `theme` prop.
|
|
423
|
+
- **Content media.** An `<img>` or a `<video>` without a binding is application media; `sizeAxis: "inline"` on its
|
|
424
|
+
visual profile caps its width (logo strips) instead of its height.
|
|
425
|
+
- **A drawing picked by state.** `const glyph = open ? closeGlyph : arrowGlyph`, drawn with `glyph.source`, is fine.
|
|
426
|
+
|
|
377
427
|
<a id="rejected"></a>
|
|
378
428
|
## What is rejected, and why
|
|
379
429
|
|
|
@@ -43,6 +43,10 @@ ADS's `lint:ds` script runs `ads check .` and `emit:ds` runs `ads emit`. ADS gat
|
|
|
43
43
|
do not require Oxlint. Projects can run their chosen linter through their own
|
|
44
44
|
explicitly configured check scripts. Init preserves application scripts.
|
|
45
45
|
|
|
46
|
+
**`"use client"`** is ADS's to write: an emitted owner that calls a hook or handles an event starts with it, a
|
|
47
|
+
presentational one does not and renders in a React Server Component. Don't write it by hand; one written where
|
|
48
|
+
nothing needs it is a review item.
|
|
49
|
+
|
|
46
50
|
## MCP connection
|
|
47
51
|
|
|
48
52
|
Choose [direct code editing or MCP-only editing](workflows.md) independently of
|
|
@@ -112,6 +112,8 @@ import { Container, EventLog, Placeholder, useEvents, type Scenario } from "@req
|
|
|
112
112
|
Token, icon and brand preview pages are not scenarios: the generated Tokens,
|
|
113
113
|
Profiles and Artwork views show them.
|
|
114
114
|
|
|
115
|
+
`Container inline: "phone"` is 390px, the phone-viewport tool's width: use it, not the 360px column, for a phone.
|
|
116
|
+
|
|
115
117
|
## Files and identities
|
|
116
118
|
|
|
117
119
|
A scenario's id is the design-system-relative path without `.ads.scenario.*`; a canonical
|
|
@@ -109,6 +109,12 @@ value to disguise it. Shared literals in the proper role sheet remain valid.
|
|
|
109
109
|
Nowhere-declared references keep one `token-css/token-missing` error per authored
|
|
110
110
|
site, including with a fallback and when unused; provenance does not duplicate it.
|
|
111
111
|
|
|
112
|
+
- A token a script reads by name (`getPropertyValue("--toast-duration")`) is emitted with the owner's token CSS.
|
|
113
|
+
- The foundation's document text profile states `fontFamily`, `fontSize` and `lineHeight`: it is every text's
|
|
114
|
+
fallback (`foundation/document-text-incomplete`).
|
|
115
|
+
- A frame that draws a border needs a border paint on its element's surface; without one the border takes the text
|
|
116
|
+
colour (`review/border-paint-missing`).
|
|
117
|
+
|
|
112
118
|
## Units
|
|
113
119
|
|
|
114
120
|
`ads check` restricts the unit in three places: `font-size`, and `line-height`
|
|
@@ -94,6 +94,11 @@ demonstration. See [review.md](review.md).
|
|
|
94
94
|
effects through props and callbacks. Re-exporting an application store, router
|
|
95
95
|
or service from a helper does not make it part of the design system.
|
|
96
96
|
|
|
97
|
+
A component another library supplies (a framework's link) is declared as an external, `external({ from, renders })`
|
|
98
|
+
in `externals/*.ads.ts`, and used as one of an owner's elements: ADS checks it as the element it renders, emits a
|
|
99
|
+
re-export of the real component, previews a stand-in, and `ads-guard` verifies the library renders that element with
|
|
100
|
+
the class and no style of its own.
|
|
101
|
+
|
|
97
102
|
## Styling rules (blocking)
|
|
98
103
|
|
|
99
104
|
Components own their control states and appearance. Patterns own arrangement,
|
|
@@ -55,6 +55,10 @@ context). Breakpoint widths, column counts and condition bounds are compiled int
|
|
|
55
55
|
media queries and track lists, so a context cannot change them
|
|
56
56
|
(`spatial-context-unsupported`): declare another spatial profile instead.
|
|
57
57
|
|
|
58
|
+
- **Gap gutters.** A gutter may be a gap (`gutters: { cards: { gap: "--card-gap" } }`): the grid writes
|
|
59
|
+
`column-gap`, the outer cells sit flush with the region's edges, and tracks share the width left after the gaps.
|
|
60
|
+
Use it for card grids; an edge gutter (`start`, `end`) insets each cell.
|
|
61
|
+
|
|
58
62
|
## Choose the behaviour first
|
|
59
63
|
|
|
60
64
|
| The user wants… | Choose |
|
|
@@ -105,7 +109,10 @@ corners, then the other set under a named condition of the spatial profile:
|
|
|
105
109
|
"end-end"] } } }`. A named condition holds below its bound.
|
|
106
110
|
|
|
107
111
|
Columns of unequal width: `columns: 2, weights: [0.85, 1.15]` on a fluid grid
|
|
108
|
-
(one positive number per local column).
|
|
112
|
+
(one positive number per local column). Columns as wide as their content, a
|
|
113
|
+
space apart (link columns of a footer): `columns: 6, contentFrom: "lg"`; below
|
|
114
|
+
that tier the columns share the width, so place the cells for the narrower
|
|
115
|
+
tiers. Never write `grid-template-columns`.
|
|
109
116
|
|
|
110
117
|
The field exposes its label, control and help rows; `alignRows` binds them through
|
|
111
118
|
subgrid. The cell must span exactly those rows, in the order the component exposes
|
|
@@ -145,7 +145,7 @@ code: an attribute it sets (`data-dragging`, `aria-busy`) or a native state;
|
|
|
145
145
|
a recipe never creates a state machine.
|
|
146
146
|
|
|
147
147
|
- `paintTransition` interpolates `background-color`, `border-color`, `color`,
|
|
148
|
-
`box-shadow`, `filter` (the surface's `blur`, `shapeShadow`, `groupShadow`)
|
|
148
|
+
`text-decoration-color` (a link's underline, the surface's `textDecorationColor`), `box-shadow`, `filter` (the surface's `blur`, `shapeShadow`, `groupShadow`)
|
|
149
149
|
or `backdrop-filter` (`backdropBlur`, `backdropSaturate`) between the base
|
|
150
150
|
surface and its state surfaces, timed by a motion profile with a `static`
|
|
151
151
|
reduced-motion policy. A channel that does not change, an effect that changes
|
|
@@ -164,7 +164,24 @@ a recipe never creates a state machine.
|
|
|
164
164
|
never inject an HTML string. A colour that follows the container (a link in a
|
|
165
165
|
heading) is the container surface's `provides`, not a prop on the link. A list
|
|
166
166
|
item keeps its marker: give it no arrangement, and space a nested list with a
|
|
167
|
-
part's `spaceBefore` in its block flow.
|
|
167
|
+
part's `spaceBefore` in its block flow. A flow that needs many distances gives
|
|
168
|
+
each part its own spacing profile (`spacing: "h2-spacing"` with
|
|
169
|
+
`spaceBefore`/`spaceAfter`). A paragraph or heading part has its browser margin
|
|
170
|
+
reset automatically.
|
|
171
|
+
- Markers: `pseudo: { marker: { surface, text } }` on the list item (a colour-only
|
|
172
|
+
surface, a text profile of weight and numerals) and `markers: [...]` on the
|
|
173
|
+
list (number system per depth). Numbering that the browser's list counter
|
|
174
|
+
cannot give (1.1.2 clauses, numbered headings) is a CSS counter: `counter: {
|
|
175
|
+
reset }` on the container, `counter: { increment }` on each item, and
|
|
176
|
+
`content: { counters | counter, separator, suffix }` on its `marker` or
|
|
177
|
+
`before`. Check marks are a visual part in the item, not a marker.
|
|
178
|
+
- A code block either keeps each line whole and scrolls (`overflow: "scroll-inline"`, focusable) or keeps the text's
|
|
179
|
+
spaces and line breaks and wraps long lines so all of it is visible (`wrap: "preserve"` on its code text). Choose
|
|
180
|
+
by what matters more: lines that read exactly as written, or nothing hidden.
|
|
181
|
+
- A rule between children (table rows, settings rows) is `between: { surface,
|
|
182
|
+
frame }` on their parent, never borders on each child with a last-child
|
|
183
|
+
exception. Text only assistive technology reads (a table caption) is a part
|
|
184
|
+
with `presence: "assistive"`.
|
|
168
185
|
- A colour that depends on where an element sits (links and icons in a tinted
|
|
169
186
|
banner, the cells of a selected row, actions on a dark card) is a contextual
|
|
170
187
|
role: the container's surface profile `provides: { "--link-ink": "--on-warning" }`.
|
|
@@ -262,6 +279,21 @@ fragment or a native frame-only element.
|
|
|
262
279
|
`mandatory` or `proximity`), aligning the children it places. Snap without
|
|
263
280
|
scrolling, or a child's own snap, is rejected.
|
|
264
281
|
|
|
282
|
+
- **Distribution and gaps.** `justify: "space-between"` (or `"space-around"`, `"space-evenly"`) puts a row's or
|
|
283
|
+
stack's free space between its items: a logo at the start of a header and its actions at the end. On a wrapping
|
|
284
|
+
`inline` row, `gap` spaces the items and `rowGap` the lines.
|
|
285
|
+
- **Loose flow.** `carry: true` on a list and on its item: an item that ends in a paragraph, code block or figure is
|
|
286
|
+
followed at the larger of the list's gap and that block's space after; after the last item the list's own space
|
|
287
|
+
after applies.
|
|
288
|
+
- **Filling parts.** `extent: "fill"` in a stack starts at the part's content and grows into free space, so a
|
|
289
|
+
scrolling body never collapses in a stack sized by its content.
|
|
290
|
+
- **End alignment.** Blocks a stack holds end on one line (`source/end-misaligned`): a painted block by its outer
|
|
291
|
+
edge, an unpainted one where its content ends. Put a header on the same grid and gutter as the sections below it.
|
|
292
|
+
- **Tables.** `align: "start"` on a cell (`vertical-align: top` for rows whose cells wrap to different heights);
|
|
293
|
+
`extent: "container"` on a table root makes it as wide as its container.
|
|
294
|
+
- **The document.** One pattern may render the page's `<html>`: `recipe({ element: "document" })`, with `lang`
|
|
295
|
+
from a required prop, `<body>` inside, and the framework's `head` and `end` slots.
|
|
296
|
+
|
|
265
297
|
<a id="layers"></a>
|
|
266
298
|
## Layers
|
|
267
299
|
|
|
@@ -286,6 +318,10 @@ A region recipe's root can live in the browser's top layer through a closed
|
|
|
286
318
|
no authored `open` on a sheet, an accessible name, and no layer root as a grid
|
|
287
319
|
cell. Focus, Escape and dismissal are behaviour guarantees for browser tests.
|
|
288
320
|
|
|
321
|
+
- **Modal cards.** A dialog with `edge: "center"` or `"block-start"` is a card in the viewport, kept the layer
|
|
322
|
+
profile's `viewportMargin` from its edges, fading in with `motion: "fade"`. The backdrop surface may set
|
|
323
|
+
`backdropBlur`. A zoom view grows an image from its place with a measured `translate` and a measured `scale`.
|
|
324
|
+
|
|
289
325
|
<a id="measured"></a>
|
|
290
326
|
## Measured values and runtime paints
|
|
291
327
|
|
|
@@ -361,6 +397,14 @@ text part breaks one way, set by one `wrap` field:
|
|
|
361
397
|
its alignment, on a control's label too. Balanced, pretty and trimmed text degrade to plain wrapping and
|
|
362
398
|
spacing in a browser without them.
|
|
363
399
|
|
|
400
|
+
- **Code that wraps.** `wrap: "preserve"` keeps spaces and line breaks and wraps long lines, so the whole block is
|
|
401
|
+
visible; `overflow: "scroll-inline"` keeps lines whole instead.
|
|
402
|
+
- **Truncation.** One-line `wrap: "truncate"` clips only sideways, so descenders stay whole with a trimmed line box.
|
|
403
|
+
- **Native controls.** A `<button>`, `<input>`, `<textarea>` or `<select>` that a construction draws loses the
|
|
404
|
+
browser's font, centred text, border, fill and margin wherever the construction states none.
|
|
405
|
+
- **Range sliders.** `pseudo: { sliderTrack, sliderThumb }` on an `<input type="range">` part, each a surface and a
|
|
406
|
+
frame profile; the thumb needs 3:1 against the track. Tick labels are a `space-between` row.
|
|
407
|
+
|
|
364
408
|
<a id="assets"></a>
|
|
365
409
|
## Assets in recipes
|
|
366
410
|
|
|
@@ -374,6 +418,12 @@ glyph reference, never a name string. Brand artwork and multicolour drawings
|
|
|
374
418
|
are declared under `assets/`: see `ads://guides/branding` and
|
|
375
419
|
`ads://guides/pictograms`.
|
|
376
420
|
|
|
421
|
+
- **A logo per colour scheme.** Two visual parts, `scheme: "light"` and `scheme: "dark"`, each bound for a theme of
|
|
422
|
+
that scheme, follow the page's scheme with no `theme` prop.
|
|
423
|
+
- **Content media.** An `<img>` or a `<video>` without a binding is application media; `sizeAxis: "inline"` on its
|
|
424
|
+
visual profile caps its width (logo strips) instead of its height.
|
|
425
|
+
- **A drawing picked by state.** `const glyph = open ? closeGlyph : arrowGlyph`, drawn with `glyph.source`, is fine.
|
|
426
|
+
|
|
377
427
|
<a id="rejected"></a>
|
|
378
428
|
## What is rejected, and why
|
|
379
429
|
|
|
@@ -43,6 +43,10 @@ ADS's `lint:ds` script runs `ads check .` and `emit:ds` runs `ads emit`. ADS gat
|
|
|
43
43
|
do not require Oxlint. Projects can run their chosen linter through their own
|
|
44
44
|
explicitly configured check scripts. Init preserves application scripts.
|
|
45
45
|
|
|
46
|
+
**`"use client"`** is ADS's to write: an emitted owner that calls a hook or handles an event starts with it, a
|
|
47
|
+
presentational one does not and renders in a React Server Component. Don't write it by hand; one written where
|
|
48
|
+
nothing needs it is a review item.
|
|
49
|
+
|
|
46
50
|
## MCP connection
|
|
47
51
|
|
|
48
52
|
Choose [direct code editing or MCP-only editing](workflows.md) independently of
|
|
@@ -112,6 +112,8 @@ import { Container, EventLog, Placeholder, useEvents, type Scenario } from "@req
|
|
|
112
112
|
Token, icon and brand preview pages are not scenarios: the generated Tokens,
|
|
113
113
|
Profiles and Artwork views show them.
|
|
114
114
|
|
|
115
|
+
`Container inline: "phone"` is 390px, the phone-viewport tool's width: use it, not the 360px column, for a phone.
|
|
116
|
+
|
|
115
117
|
## Files and identities
|
|
116
118
|
|
|
117
119
|
A scenario's id is the design-system-relative path without `.ads.scenario.*`; a canonical
|
|
@@ -74,3 +74,5 @@ Load only the guide(s) for the requested transition.
|
|
|
74
74
|
| 0.5.0 | 0.5.1 | [The text keyline check, surface effects, entrances and font fallback metrics](references/0.5.0-to-0.5.1.md) |
|
|
75
75
|
| 0.5.1 | 0.5.2 | [Two emitted-CSS fixes, checks that now accept what they refused, a TypeScript configuration error that is now reported, the render audit measuring owner states by itself (and which audit-only scenario states can go), and new state, geometry, surface, outset, focus, control and prose language](references/0.5.1-to-0.5.2.md) |
|
|
76
76
|
| 0.5.2 | 0.5.3 | [Prose becomes content components, contextual roles (`provides`), fixed-size frames keep their size, workarounds that can go (design state, heading levels, drawn inputs, repeated parts and cells, optional cells, corner radii, inline entrances, the target spacing exception, hidden glyphs), and composed contrast through plain modules](references/0.5.2-to-0.5.3.md) |
|
|
77
|
+
| 0.5.3 | 0.5.4 | [A part's browser margin is reset, five 0.5.3 gaps fixed, list markers, CSS counters, part spacing profiles, rules between children, visually hidden text and underline states](references/0.5.3-to-0.5.4.md) |
|
|
78
|
+
| 0.5.4 | 0.5.5 | [Stricter checks (document text, forced-colours edges, border corners, end alignment), native control resets, layout, media, layer and forced-colours language, and render-audit environment passes](references/0.5.4-to-0.5.5.md) |
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# ADS 0.5.3 → 0.5.4
|
|
2
|
+
|
|
3
|
+
No source change is required. One change alters emitted CSS (a part's browser
|
|
4
|
+
margin is reset); the rest fixes 0.5.3 gaps and adds list, table and link
|
|
5
|
+
language. Owner analysis moves to schema `ads-owner-analysis/13`, so the first
|
|
6
|
+
check after the upgrade analyses every owner again.
|
|
7
|
+
|
|
8
|
+
## Emitted CSS that changes
|
|
9
|
+
|
|
10
|
+
- **A part's browser margin.** A part rendered as `p`, `h1`–`h6`, `ul`, `ol`,
|
|
11
|
+
`dl`, `dd`, `blockquote`, `figure`, `pre`, `hr` or `menu` now writes
|
|
12
|
+
`margin: 0`: the arrangement owns the space around it. A design that relied on
|
|
13
|
+
the browser's margin gives the part its space instead (`spaceBefore`,
|
|
14
|
+
`spaceAfter`, or its own `spacing` profile), or states the margin with
|
|
15
|
+
`normalize`.
|
|
16
|
+
|
|
17
|
+
Run `ads emit` and review the owners whose parts are paragraphs, headings,
|
|
18
|
+
lists or quotes.
|
|
19
|
+
|
|
20
|
+
## Fixed: workarounds that can go
|
|
21
|
+
|
|
22
|
+
| Before | Now |
|
|
23
|
+
| --- | --- |
|
|
24
|
+
| `enter.from.translateInline` was refused ("Unsupported owner value: translate-inline") | Accepted: a pushed screen slides in from the side |
|
|
25
|
+
| A glyph in an optional part that a lead replaces needed `icon && lead === undefined && …` | `lead !== undefined ? <span …lead/> : icon && <span …mark…/>` works |
|
|
26
|
+
| An optional count text needed a two-value union (`"fits" \| "overflows"`) | `const rest: string \| undefined = more > 0 ? \`+${more}\` : undefined` is design state |
|
|
27
|
+
| A glyph-only `frame: "control"` part had to name a text profile | It sits on its text slot's line |
|
|
28
|
+
| A content renderer in lists and tables ended in "compositions exceed 512 distinct chains" | Followed to the end |
|
|
29
|
+
|
|
30
|
+
## New language
|
|
31
|
+
|
|
32
|
+
| Need | Write |
|
|
33
|
+
| --- | --- |
|
|
34
|
+
| Bold, coloured list markers | `pseudo: { marker: { surface: "<colour-only>", text: "<weight>" } }` on the list item |
|
|
35
|
+
| Numbers, then letters, at each depth | `markers: ["decimal", "lower-alpha", "lower-roman"]` on the list |
|
|
36
|
+
| Clause numbering (1, 1.1, 1.1.2) | the list `counter: { reset: "clause" }`; each item `counter: { increment: "clause" }` and `pseudo: { marker: { content: { counters: "clause", separator: ".", suffix: ". " } } }` |
|
|
37
|
+
| A numbered heading ("2.3 Installation") | `counter` on the flow and the heading, `pseudo: { before: { content: { counters: "section", separator: ".", suffix: " " } } }` |
|
|
38
|
+
| Many distances in one flow (44/14 px around an h2, 24 px after a quote) | a spacing profile per part with `spaceBefore`/`spaceAfter`, named by the part: `spacing: "h2-spacing"` |
|
|
39
|
+
| A hairline between table rows, none after the last | `between: { surface, frame }` on the table body part |
|
|
40
|
+
| A caption only screen readers read | `presence: "assistive"` on the caption part |
|
|
41
|
+
| A pale underline that turns full on hover over 150 ms | `textDecorationColor` on the link's surfaces and `paintTransition: { channels: ["text-decoration-color"] }` |
|
|
42
|
+
| An underline a hover thickens | a hover text profile with `textDecorationThickness`; inside one container only: that container's surface `provides` the thickness token |
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# ADS 0.5.4 → 0.5.5
|
|
2
|
+
|
|
3
|
+
Several checks are stricter and some emitted CSS changes: run `ads check`, fix what it reports, then `ads emit` and
|
|
4
|
+
review the rendered owners. Owner analysis moves to schema `ads-owner-analysis/14` and owner emission to
|
|
5
|
+
`ads-owner-emission/2`, so the first check and emit after the upgrade redo every owner.
|
|
6
|
+
|
|
7
|
+
## Checks that can newly fail
|
|
8
|
+
|
|
9
|
+
| Code | What fails | Repair |
|
|
10
|
+
| --- | --- | --- |
|
|
11
|
+
| `foundation/document-text-incomplete` | The foundation's document text profile states no `fontSize` or `lineHeight` (text without its own profile showed the browser's 16px) | Give it `fontFamily`, `fontSize` and `lineHeight` |
|
|
12
|
+
| `construction/forced-boundary-missing` (`a11y-forced-colors`) | A control (a control construction, a `frame: "control"` part) whose frame declares no `borderWidth`: it has no edge in Windows contrast themes | Give the frame a `borderWidth`; `borderStyle: "forced-only"` keeps it transparent in normal mode |
|
|
13
|
+
| `construction/corner-overpaint` | A part with its own border reaching a rounded corner of an unclipped, uninset root (a field inside a rounded composer) | Clip the root, inset it, or round the part |
|
|
14
|
+
| `source/end-misaligned` | Blocks a stack holds end their content on different lines (a header's actions one gutter past the sections) | Put the block on the same grid and gutter, or give its frame the matching end padding |
|
|
15
|
+
| `construction/progress-contrast-insufficient` | A range slider's thumb under 3:1 against its track | Choose a thumb surface that contrasts with the track |
|
|
16
|
+
|
|
17
|
+
New review items, which never block: `review/forced-state-fill-only`, `review/border-paint-missing`,
|
|
18
|
+
`review/counter-unreset`, `review/client-directive-unneeded`.
|
|
19
|
+
|
|
20
|
+
## Emitted CSS that changes
|
|
21
|
+
|
|
22
|
+
- **Native controls.** A `<button>`, `<input>`, `<textarea>` or `<select>` a construction draws resets the
|
|
23
|
+
browser's font (inherited), centred text, border, fill and margin wherever the construction states none. A
|
|
24
|
+
button's label now starts at the start unless the recipe aligns it.
|
|
25
|
+
- **Filling parts in a stack** start at their content (`flex-basis: auto`) instead of a zero basis.
|
|
26
|
+
- **One-line truncation** clips only the inline axis (`overflow: clip visible`).
|
|
27
|
+
- **A control part** writes its frame's inline minimum and its text slot's line, as its target-size proof did.
|
|
28
|
+
- **Owner modules** that call a hook or handle an event start with `"use client"`. Remove hand-written directives.
|
|
29
|
+
|
|
30
|
+
## Fixed: workarounds that can go
|
|
31
|
+
|
|
32
|
+
| Before | Now |
|
|
33
|
+
| --- | --- |
|
|
34
|
+
| A token only a script read (`getPropertyValue("--toast-duration")`) was never emitted; it worked only if a construction used it | Emitted with the owner's token CSS |
|
|
35
|
+
| `const glyph = open ? a : b` was a glyph read; a fold bound two chevron assets | Pick the reference by state |
|
|
36
|
+
| A logo with light and dark files needed a `theme` prop | Two visual parts with `scheme: "light"` / `"dark"`, each bound for a theme of that scheme |
|
|
37
|
+
| `gap` and `rowGap` were one value on a wrapping row; insets stood in | `gap` between items, `rowGap` between lines |
|
|
38
|
+
| A video poster could not fill its frame | A `<video>` is content media; a cover profile fills the frame |
|
|
39
|
+
| Text inside `aria-hidden` (a breadcrumb's "/") was held to 4.5:1 | Decoration: no minimum |
|
|
40
|
+
| Window controls under 24px placed by a bar needed 24px | A private control placed only between spaced neighbours passes 2.5.8's spacing exception |
|
|
41
|
+
|
|
42
|
+
## New language
|
|
43
|
+
|
|
44
|
+
- Layout: `justify: "space-between" | "space-around" | "space-evenly"`; gap gutters
|
|
45
|
+
(`gutters: { cards: { gap } }`); `carry: true` for loose lists; cell `align`; table `extent: "container"`.
|
|
46
|
+
- Text: `wrap: "preserve"`; range sliders (`pseudo: { sliderTrack, sliderThumb }`).
|
|
47
|
+
- Media: `sizeAxis: "inline"` on a visual profile; `<video>` content media; scheme-paired declared artwork.
|
|
48
|
+
- Layers: modal cards (`edge: "center" | "block-start"`, `motion: "fade"`), `backdropBlur`, a measured `scale`.
|
|
49
|
+
- Forced colours: a surface's `forcedColors`; a frame's `borderStyle: "forced-only"`.
|
|
50
|
+
- The document pattern: `element: "document"`.
|
|
51
|
+
- Content-sized grid columns: `contentFrom: "<tier>"` on a fluid grid, for columns that were
|
|
52
|
+
`grid-template-columns: repeat(n, auto)` with `justify-content: space-between`.
|
|
53
|
+
- External components: `external<Props>({ from, renders })` in `externals/*.ads.ts`, used as an owner's element;
|
|
54
|
+
a framework's link no longer needs a component prop or a wrapper.
|
|
55
|
+
- Scenarios: `Container inline: "phone"` (390px).
|
|
56
|
+
|
|
57
|
+
## Render audit
|
|
58
|
+
|
|
59
|
+
Each scenario is also audited in forced colours and with a coarse pointer. The layout pass reports words broken by a
|
|
60
|
+
squeezed box, collapsed scroll areas and boxes whose painted edge a clip cuts; it no longer reports owned 24px hit
|
|
61
|
+
areas, `aria-hidden` initials as a visible label, inert panes of no size, or a multi-colour mark by its outline.
|
|
@@ -109,6 +109,12 @@ value to disguise it. Shared literals in the proper role sheet remain valid.
|
|
|
109
109
|
Nowhere-declared references keep one `token-css/token-missing` error per authored
|
|
110
110
|
site, including with a fallback and when unused; provenance does not duplicate it.
|
|
111
111
|
|
|
112
|
+
- A token a script reads by name (`getPropertyValue("--toast-duration")`) is emitted with the owner's token CSS.
|
|
113
|
+
- The foundation's document text profile states `fontFamily`, `fontSize` and `lineHeight`: it is every text's
|
|
114
|
+
fallback (`foundation/document-text-incomplete`).
|
|
115
|
+
- A frame that draws a border needs a border paint on its element's surface; without one the border takes the text
|
|
116
|
+
colour (`review/border-paint-missing`).
|
|
117
|
+
|
|
112
118
|
## Units
|
|
113
119
|
|
|
114
120
|
`ads check` restricts the unit in three places: `font-size`, and `line-height`
|
|
@@ -94,6 +94,11 @@ demonstration. See [review.md](review.md).
|
|
|
94
94
|
effects through props and callbacks. Re-exporting an application store, router
|
|
95
95
|
or service from a helper does not make it part of the design system.
|
|
96
96
|
|
|
97
|
+
A component another library supplies (a framework's link) is declared as an external, `external({ from, renders })`
|
|
98
|
+
in `externals/*.ads.ts`, and used as one of an owner's elements: ADS checks it as the element it renders, emits a
|
|
99
|
+
re-export of the real component, previews a stand-in, and `ads-guard` verifies the library renders that element with
|
|
100
|
+
the class and no style of its own.
|
|
101
|
+
|
|
97
102
|
## Styling rules (blocking)
|
|
98
103
|
|
|
99
104
|
Components own their control states and appearance. Patterns own arrangement,
|
|
@@ -55,6 +55,10 @@ context). Breakpoint widths, column counts and condition bounds are compiled int
|
|
|
55
55
|
media queries and track lists, so a context cannot change them
|
|
56
56
|
(`spatial-context-unsupported`): declare another spatial profile instead.
|
|
57
57
|
|
|
58
|
+
- **Gap gutters.** A gutter may be a gap (`gutters: { cards: { gap: "--card-gap" } }`): the grid writes
|
|
59
|
+
`column-gap`, the outer cells sit flush with the region's edges, and tracks share the width left after the gaps.
|
|
60
|
+
Use it for card grids; an edge gutter (`start`, `end`) insets each cell.
|
|
61
|
+
|
|
58
62
|
## Choose the behaviour first
|
|
59
63
|
|
|
60
64
|
| The user wants… | Choose |
|
|
@@ -105,7 +109,10 @@ corners, then the other set under a named condition of the spatial profile:
|
|
|
105
109
|
"end-end"] } } }`. A named condition holds below its bound.
|
|
106
110
|
|
|
107
111
|
Columns of unequal width: `columns: 2, weights: [0.85, 1.15]` on a fluid grid
|
|
108
|
-
(one positive number per local column).
|
|
112
|
+
(one positive number per local column). Columns as wide as their content, a
|
|
113
|
+
space apart (link columns of a footer): `columns: 6, contentFrom: "lg"`; below
|
|
114
|
+
that tier the columns share the width, so place the cells for the narrower
|
|
115
|
+
tiers. Never write `grid-template-columns`.
|
|
109
116
|
|
|
110
117
|
The field exposes its label, control and help rows; `alignRows` binds them through
|
|
111
118
|
subgrid. The cell must span exactly those rows, in the order the component exposes
|