@reqvire-org/ads 0.3.46 → 0.3.48

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.
Files changed (122) hide show
  1. package/README.md +21 -11
  2. package/dist/a11y.mjs +4 -2
  3. package/dist/assets.mjs +20 -15
  4. package/dist/atomic-composition.mjs +3 -2
  5. package/dist/brand-assets.mjs +48 -11
  6. package/dist/brands.mjs +82 -0
  7. package/dist/browser-audit/worker.mjs +51 -0
  8. package/dist/browser-audit.mjs +147 -0
  9. package/dist/capture/worker.mjs +1 -0
  10. package/dist/capture-store.mjs +2 -0
  11. package/dist/capture.mjs +7 -4
  12. package/dist/check.mjs +38 -8
  13. package/dist/cli.mjs +45 -10
  14. package/dist/color-values.mjs +325 -0
  15. package/dist/config.mjs +16 -2
  16. package/dist/control-padding.mjs +93 -0
  17. package/dist/design-values.mjs +3 -2
  18. package/dist/finding-rules.mjs +61 -0
  19. package/dist/foundation.mjs +17 -4
  20. package/dist/icons.mjs +107 -0
  21. package/dist/init.mjs +3 -0
  22. package/dist/mcp/apps.mjs +9 -6
  23. package/dist/mcp/context.mjs +1 -1
  24. package/dist/mcp/drafts.mjs +3 -0
  25. package/dist/mcp/mutations.mjs +40 -1
  26. package/dist/mcp/preview-widget.bundle.js +36 -36
  27. package/dist/mcp/project-widget.bundle.js +12 -12
  28. package/dist/mcp/server.mjs +23 -11
  29. package/dist/mcp/widget.bundle.js +17 -17
  30. package/dist/palette-generated.mjs +180 -0
  31. package/dist/preview-resources.mjs +12 -3
  32. package/dist/render-color-probe.mjs +148 -0
  33. package/dist/runtime-contracts.mjs +14 -4
  34. package/dist/scenarios.mjs +1 -1
  35. package/dist/showcase/client.bundle.js +28 -28
  36. package/dist/showcase/icons.js +146 -0
  37. package/dist/showcase/index.html +2 -1
  38. package/dist/showcase/style.css +19 -2
  39. package/dist/skills/README.md +2 -1
  40. package/dist/skills/ads-break-ui/SKILL.md +6 -5
  41. package/dist/skills/ads-break-ui/references/atomic-styles.md +12 -12
  42. package/dist/skills/ads-break-ui/references/contracts.md +13 -10
  43. package/dist/skills/ads-break-ui/references/design-data.md +137 -29
  44. package/dist/skills/ads-break-ui/references/drafts.md +3 -1
  45. package/dist/skills/ads-break-ui/references/guarded-editing.md +3 -2
  46. package/dist/skills/ads-break-ui/references/validation.md +13 -4
  47. package/dist/skills/ads-designer/SKILL.md +23 -16
  48. package/dist/skills/ads-designer/references/accessibility.md +41 -5
  49. package/dist/skills/ads-designer/references/atomic-styles.md +12 -12
  50. package/dist/skills/ads-designer/references/branding.md +37 -10
  51. package/dist/skills/ads-designer/references/cli.md +8 -2
  52. package/dist/skills/ads-designer/references/contracts.md +13 -10
  53. package/dist/skills/ads-designer/references/design-data.md +137 -29
  54. package/dist/skills/ads-designer/references/drafts.md +3 -1
  55. package/dist/skills/ads-designer/references/guarded-editing.md +3 -2
  56. package/dist/skills/ads-designer/references/validation.md +13 -4
  57. package/dist/skills/ads-import/SKILL.md +9 -8
  58. package/dist/skills/ads-import/references/atomic-styles.md +12 -12
  59. package/dist/skills/ads-import/references/cli.md +8 -2
  60. package/dist/skills/ads-import/references/contracts.md +13 -10
  61. package/dist/skills/ads-import/references/design-data.md +137 -29
  62. package/dist/skills/ads-import/references/drafts.md +3 -1
  63. package/dist/skills/ads-import/references/guarded-editing.md +3 -2
  64. package/dist/skills/ads-import/references/tokens.md +7 -3
  65. package/dist/skills/ads-import/references/validation.md +13 -4
  66. package/dist/skills/ads-motion/SKILL.md +6 -5
  67. package/dist/skills/ads-motion/references/atomic-styles.md +12 -12
  68. package/dist/skills/ads-motion/references/contracts.md +13 -10
  69. package/dist/skills/ads-motion/references/design-data.md +137 -29
  70. package/dist/skills/ads-motion/references/drafts.md +3 -1
  71. package/dist/skills/ads-motion/references/guarded-editing.md +3 -2
  72. package/dist/skills/ads-motion/references/validation.md +13 -4
  73. package/dist/skills/ads-port/SKILL.md +6 -5
  74. package/dist/skills/ads-port/references/atomic-styles.md +12 -12
  75. package/dist/skills/ads-port/references/cli.md +8 -2
  76. package/dist/skills/ads-port/references/contracts.md +13 -10
  77. package/dist/skills/ads-port/references/design-data.md +137 -29
  78. package/dist/skills/ads-port/references/drafts.md +3 -1
  79. package/dist/skills/ads-port/references/guarded-editing.md +3 -2
  80. package/dist/skills/ads-port/references/validation.md +13 -4
  81. package/dist/starters/preact/design-system/review/token-preview/TokenPreview.tsx +11 -2
  82. package/dist/starters/react/ADS.md +43 -10
  83. package/dist/starters/react/README.md +14 -9
  84. package/dist/starters/react/design-system/assets/brand/README.md +8 -3
  85. package/dist/starters/react/design-system/assets/glyphs/README.md +4 -1
  86. package/dist/starters/react/design-system/components/Content/Icon/Icon.ads.fixture.ts +6 -1
  87. package/dist/starters/react/design-system/components/Content/Icon/Icon.ads.scenario.tsx +3 -2
  88. package/dist/starters/react/design-system/components/Content/Icon/README.md +2 -1
  89. package/dist/starters/react/design-system/components/Content/Logo/Logo.tsx +3 -9
  90. package/dist/starters/react/design-system/components/Content/Logo/README.md +4 -2
  91. package/dist/starters/react/design-system/controllers/Palette/Palette.ts +164 -0
  92. package/dist/starters/react/design-system/index.ts +3 -0
  93. package/dist/starters/react/design-system/review/brand-preview/BrandPreview.tsx +2 -5
  94. package/dist/starters/react/design-system/review/token-preview/TokenPreview.tsx +11 -2
  95. package/dist/starters/react/design-system/styles.css +1 -0
  96. package/dist/starters/react/design-system/tokens/base.css +8 -5
  97. package/dist/starters/react/design-system/tokens/colors.css +167 -175
  98. package/dist/starters/react/design-system/tokens/elevation.css +14 -21
  99. package/dist/starters/react/design-system/tokens/themes.generated.css +142 -0
  100. package/dist/starters/react/design-system/tokens/themes.generated.ts +402 -0
  101. package/dist/style-boundaries.mjs +2 -1
  102. package/dist/themes-generated.mjs +150 -0
  103. package/dist/themes-watch.mjs +42 -0
  104. package/dist/themes.mjs +214 -63
  105. package/dist/token-export.mjs +22 -11
  106. package/dist/token-policy.mjs +2 -1
  107. package/dist/token-quality.mjs +28 -25
  108. package/dist/tokens.mjs +27 -32
  109. package/dist/validation.mjs +17 -1
  110. package/dist/verification/browser.mjs +14 -3
  111. package/dist/verification.mjs +25 -4
  112. package/docs/ADS.md +41 -27
  113. package/docs/ARCHITECTURE.md +49 -22
  114. package/docs/CACHING.md +2 -3
  115. package/docs/CHANGELOG.md +117 -13
  116. package/docs/CONTRACTS.md +13 -10
  117. package/docs/GUIDE.md +94 -22
  118. package/docs/MCP.md +50 -30
  119. package/docs/benchmarks/bun-previews.md +5 -5
  120. package/docs/benchmarks/{gidi-preview-memory.md → preview-memory.md} +14 -12
  121. package/docs/benchmarks/turbo-poc.md +24 -6
  122. package/package.json +2 -1
@@ -0,0 +1,146 @@
1
+ // The Icons view: ADS renders the project's glyph folder itself, in showcase chrome colours.
2
+ export const ICONS_URI = "ads://project/icons";
3
+ const SVG = "http://www.w3.org/2000/svg";
4
+
5
+ function element(tag, props = {}, ...children) {
6
+ const node = Object.assign(document.createElement(tag), props);
7
+ node.append(...children.filter(child => child !== null && child !== undefined && child !== false));
8
+ return node;
9
+ }
10
+
11
+ const paint = { fill: "black", stroke: "none", "stroke-width": "1", "stroke-linecap": "butt", "stroke-linejoin": "miter", "stroke-miterlimit": "4", "stroke-dasharray": "none", "fill-opacity": "1", "stroke-opacity": "1", "fill-rule": "nonzero" };
12
+ /** Project SVG drawn inline so currentColor and the set's default strokes apply; scripts, foreign content and handlers are dropped. */
13
+ function sanitize(markup) {
14
+ const parsed = new DOMParser().parseFromString(markup, "image/svg+xml").documentElement;
15
+ if (parsed.namespaceURI !== SVG || parsed.localName !== "svg") return null;
16
+ for (const node of parsed.querySelectorAll("*")) {
17
+ if (["script", "foreignObject", "iframe", "image", "a", "animate", "set", "animateTransform", "animateMotion"].includes(node.localName) || node.namespaceURI !== SVG) node.remove();
18
+ }
19
+ for (const node of [parsed, ...parsed.querySelectorAll("*")]) {
20
+ for (const attribute of Array.from(node.attributes)) {
21
+ if (/^on/i.test(attribute.name) || /href$/i.test(attribute.name) && !attribute.value.trim().startsWith("#")) node.removeAttribute(attribute.name);
22
+ }
23
+ }
24
+ const svg = document.importNode(parsed, true);
25
+ for (const name of ["width", "height", "class"]) svg.removeAttribute(name);
26
+ // The showcase styles its own svg chrome; inline the glyph's own (or initial) paint so it draws as in the project's Icon.
27
+ for (const [name, initial] of Object.entries(paint)) if (!svg.style.getPropertyValue(name)) svg.style.setProperty(name, svg.getAttribute(name) ?? initial);
28
+ svg.setAttribute("aria-hidden", "true"); svg.setAttribute("focusable", "false");
29
+ return svg;
30
+ }
31
+
32
+ function glyph(item, px, label) {
33
+ const span = element("span", { className: "icons-glyph" });
34
+ span.style.width = span.style.height = `${px}px`;
35
+ const svg = sanitize(item.svg);
36
+ if (svg) span.append(svg);
37
+ if (label) { span.setAttribute("role", "img"); span.setAttribute("aria-label", label); span.title = label; }
38
+ else span.setAttribute("aria-hidden", "true");
39
+ return span;
40
+ }
41
+
42
+ /** One line per viewBox unit (thinned on large boxes), the center lines stronger, under the glyph. */
43
+ function grid(box) {
44
+ const svg = document.createElementNS(SVG, "svg");
45
+ svg.setAttribute("class", "icons-grid"); svg.setAttribute("aria-hidden", "true");
46
+ svg.setAttribute("viewBox", `${box.x} ${box.y} ${box.width} ${box.height}`);
47
+ svg.setAttribute("preserveAspectRatio", "xMidYMid meet");
48
+ const step = Math.max(1, Math.ceil(Math.max(box.width, box.height) / 48));
49
+ const line = (x1, y1, x2, y2, mid) => {
50
+ const node = document.createElementNS(SVG, "line");
51
+ for (const [name, value] of Object.entries({ x1, y1, x2, y2 })) node.setAttribute(name, value);
52
+ if (mid) node.setAttribute("class", "mid");
53
+ svg.append(node);
54
+ };
55
+ for (let unit = 0; unit <= box.width; unit += step) line(box.x + unit, box.y, box.x + unit, box.y + box.height, unit * 2 === box.width);
56
+ for (let unit = 0; unit <= box.height; unit += step) line(box.x, box.y + unit, box.x + box.width, box.y + unit, unit * 2 === box.height);
57
+ if (box.width % 2 && step === 1) line(box.x + box.width / 2, box.y, box.x + box.width / 2, box.y + box.height, true);
58
+ if (box.height % 2 && step === 1) line(box.x, box.y + box.height / 2, box.x + box.width, box.y + box.height / 2, true);
59
+ return svg;
60
+ }
61
+
62
+ const plural = (count, word) => `${count} ${word}${count === 1 ? "" : "s"}`;
63
+ function findingCount(findings) {
64
+ const errors = findings.filter(item => item.severity === "error").length;
65
+ return errors === findings.length ? plural(errors, "error") : plural(findings.length, "issue");
66
+ }
67
+ function findingBox(finding) {
68
+ return element("p", { className: "icons-finding", title: finding.file ?? "" }, element("strong", { textContent: finding.rule }), " ", finding.message);
69
+ }
70
+
71
+ function card(item, sizes) {
72
+ const article = element("article", { className: "icons-card" });
73
+ article.dataset.glyph = item.name;
74
+ if (item.findings.length) article.dataset.findings = String(item.findings.length);
75
+ const header = element("div", { className: "icons-card-head" }, element("h3", { textContent: item.name }), item.findings.length ? element("span", { className: "icons-badge", textContent: findingCount(item.findings) }) : null);
76
+ const magnified = element("div", { className: "icons-mag" });
77
+ if (item.grid) magnified.append(grid(item.grid));
78
+ magnified.append(glyph(item, 96));
79
+ const scale = element("div", { className: "icons-sizes" }, ...sizes.map(size => element("span", { className: "icons-size" }, glyph(item, size.px), element("small", { textContent: String(size.px), title: size.token }))));
80
+ article.append(...[header, element("p", { className: "icons-alias", textContent: item.aliases.length ? `alias: ${item.aliases.join(", ")}` : "", title: item.aliases.join(", ") }), magnified, scale, ...item.findings.map(findingBox)].filter(Boolean));
81
+ article.setAttribute("aria-label", item.name);
82
+ return article;
83
+ }
84
+
85
+ function logo(file) {
86
+ const figure = element("figure", { className: "icons-logo" });
87
+ figure.dataset.logo = file.name;
88
+ if (file.tooLarge) { figure.append(element("figcaption", { textContent: `${file.name} (over 1 MB; not shown)` })); return figure; }
89
+ const muted = element("span", { className: "icons-logo-muted", title: `${file.name}, muted` });
90
+ muted.setAttribute("aria-hidden", "true");
91
+ muted.style.maskImage = muted.style.webkitMaskImage = `url("${file.src}")`;
92
+ figure.append(element("img", { src: file.src, alt: file.name, title: file.file }), muted, element("figcaption", { textContent: file.name }));
93
+ return figure;
94
+ }
95
+
96
+ const matches = (item, query) => !query || [item.name, ...item.aliases].some(name => name.toLowerCase().includes(query));
97
+
98
+ /** Renders the view into slot; a later call with the same slot keeps the search text and scroll. */
99
+ export function renderIcons(slot, data) {
100
+ let view = slot.querySelector(":scope > .icons-view");
101
+ const query = view?.querySelector("input[type=search]")?.value ?? "";
102
+ const scroll = view?.scrollTop ?? 0;
103
+ view = element("div", { className: "icons-view" });
104
+ view.setAttribute("role", "region"); view.setAttribute("aria-label", "Icons");
105
+ if (!data?.configured) {
106
+ view.append(element("h1", { textContent: "Icons" }), element("p", { className: "icons-summary", textContent: "The project configures no glyph set (assets.glyphs)." }));
107
+ slot.replaceChildren(view); return view;
108
+ }
109
+ const grid = data.mixed ? "mixed grids" : data.grid ? `${/^(?:8|11|18)(?!\d)|^8/.test(String(data.grid.width)) ? "an" : "a"} ${data.grid.width}×${data.grid.height} grid` : "no viewBox";
110
+ const summary = `${data.source} · ${plural(data.glyphs.length, "glyph")} on ${grid} · ${data.aliasCount} ${data.aliasCount === 1 ? "alias" : "aliases"}`;
111
+ const search = element("input", { type: "search", placeholder: "Search name or alias", value: query });
112
+ search.setAttribute("aria-label", "Search glyphs by name or alias");
113
+ const set = element("div", { className: "icons-set" });
114
+ set.setAttribute("role", "list"); set.setAttribute("aria-label", "The set");
115
+ const cards = element("div", { className: "icons-cards" });
116
+ const empty = element("p", { className: "icons-empty", hidden: true });
117
+ const text = data.textSize;
118
+ view.append(
119
+ element("div", { className: "icons-head" }, element("div", {}, element("h1", { textContent: "Icons" }), element("p", { className: "icons-summary", textContent: summary })), search),
120
+ ...data.findings.map(findingBox),
121
+ element("h2", {}, "The set ", element("small", { textContent: text ? `every glyph at ${text.px} px, the size used beside text` : "every glyph" })), set,
122
+ element("h2", {}, "Glyphs ", element("small", { textContent: data.sizes.length ? "each on its grid, at every icon size" : "each on its grid" })), empty, cards,
123
+ );
124
+ for (const item of data.glyphs) {
125
+ const wrapper = element("span", { className: "icons-set-item" }, glyph(item, text?.px ?? 18, item.name));
126
+ wrapper.dataset.glyph = item.name; wrapper.setAttribute("role", "listitem");
127
+ set.append(wrapper);
128
+ cards.append(card(item, data.sizes));
129
+ }
130
+ if (data.logos) {
131
+ view.append(element("h2", {}, "Other products' logos ", element("small", { textContent: `${data.logos.source} · in color and muted` })),
132
+ data.logos.files.length ? element("div", { className: "icons-logos" }, ...data.logos.files.map(logo)) : element("p", { className: "icons-summary", textContent: "No images yet." }));
133
+ }
134
+ const filter = () => {
135
+ const value = search.value.trim().toLowerCase();
136
+ let shown = 0;
137
+ data.glyphs.forEach((item, index) => { const visible = matches(item, value); set.children[index].hidden = cards.children[index].hidden = !visible; shown += visible; });
138
+ empty.hidden = shown > 0; empty.textContent = `No glyph matches “${search.value.trim()}”.`;
139
+ };
140
+ search.addEventListener("input", filter);
141
+ filter();
142
+ slot.replaceChildren(view);
143
+ view.scrollTop = scroll;
144
+ if (query && document.activeElement === document.body) search.focus();
145
+ return view;
146
+ }
@@ -7,11 +7,12 @@
7
7
  <nav id="sections" aria-label="Showcase sections">
8
8
  <button data-section="brand" hidden><svg viewBox="0 0 16 16"><path d="M8 1.5 9.9 5.6l4.4.5-3.3 3 .9 4.4L8 11.3l-3.9 2.2.9-4.4-3.3-3 4.4-.5L8 1.5Z"/></svg>Brand</button>
9
9
  <button data-section="tokens" aria-current="page"><svg viewBox="0 0 16 16"><path d="m8 2 6 3-6 3-6-3 6-3Zm-6 6 6 3 6-3M2 11l6 3 6-3"/></svg>Tokens</button>
10
+ <button data-section="icons" hidden><svg viewBox="0 0 16 16"><circle cx="5" cy="5" r="2.5"/><rect x="9.5" y="2.5" width="4" height="5" rx="1"/><path d="m2.5 13.5 2.5-4 2.5 4ZM9.5 11.5h4M11.5 9.5v4"/></svg>Icons</button>
10
11
  <button data-section="components"><svg viewBox="0 0 16 16"><path d="m8 1 6 3.5v7L8 15l-6-3.5v-7L8 1Zm-6 3.5 6 3.5 6-3.5M8 8v7"/></svg>Components</button>
11
12
  <button data-section="patterns"><svg viewBox="0 0 16 16"><rect x="2" y="2" width="5" height="5"/><rect x="10" y="2" width="4" height="5"/><rect x="2" y="10" width="5" height="4"/><rect x="10" y="10" width="4" height="4"/></svg>Patterns</button>
12
13
  <button data-section="composition"><svg viewBox="0 0 16 16"><path d="M2 2h4v4H2zM10 2h4v4h-4zM2 10h4v4H2zM10 10h4v4h-4z"/></svg>Composition</button>
13
14
  </nav>
14
- <div class="actions"><button id="preview-status" data-phase="opening" aria-label="Preview status: Connecting to ADS MCP…" title="Connecting to ADS MCP…" popovertarget="status-details"><span class="status-dot" aria-hidden="true"></span></button><div id="status-details" popover><p id="status" role="status">Connecting to ADS MCP…</p><p id="warmup-status" hidden></p></div><button id="viewport" aria-label="Phone viewport" aria-pressed="false" aria-controls="frame-slot" title="Preview at phone width (390 px)"><svg viewBox="0 0 16 16" aria-hidden="true"><rect x="4" y="1" width="8" height="14" rx="1.5"/><path d="M7 12.5h2"/></svg></button><button id="grid-overlay" aria-label="Show grid overlay" title="Show grid overlay" aria-pressed="false"><svg viewBox="0 0 16 16"><path d="M3 2v12M6.5 2v12M9.5 2v12M13 2v12"/></svg></button><button id="theme" aria-label="Use dark theme" title="Use dark theme"><svg viewBox="0 0 16 16"><path d="M13.5 9a5.5 5.5 0 0 1-6.5-6.5A5.5 5.5 0 1 0 13.5 9Z"/></svg></button><button id="minimize" aria-label="Minimize showcase menu" title="Minimize showcase menu (refresh to restore)"><svg viewBox="0 0 16 16"><path d="m4 10 4-4 4 4"/></svg></button></div>
15
+ <div class="actions"><button id="preview-status" data-phase="opening" aria-label="Preview status: Connecting to ADS MCP…" title="Connecting to ADS MCP…" popovertarget="status-details"><span class="status-dot" aria-hidden="true"></span></button><div id="status-details" popover><p id="status" role="status">Connecting to ADS MCP…</p><p id="warmup-status" hidden></p></div><button id="viewport" aria-label="Phone viewport" aria-pressed="false" aria-controls="frame-slot" title="Preview at phone width (390 px)"><svg viewBox="0 0 16 16" aria-hidden="true"><rect x="4" y="1" width="8" height="14" rx="1.5"/><path d="M7 12.5h2"/></svg></button><button id="grid-overlay" aria-label="Show grid overlay" title="Show grid overlay" aria-pressed="false"><svg viewBox="0 0 16 16"><path d="M3 2v12M6.5 2v12M9.5 2v12M13 2v12"/></svg></button><select id="brand-select" aria-label="Preview brand" title="Preview brand" hidden></select><button id="theme" aria-label="Use dark theme" title="Use dark theme"><svg viewBox="0 0 16 16"><path d="M13.5 9a5.5 5.5 0 0 1-6.5-6.5A5.5 5.5 0 1 0 13.5 9Z"/></svg></button><button id="minimize" aria-label="Minimize showcase menu" title="Minimize showcase menu (refresh to restore)"><svg viewBox="0 0 16 16"><path d="m4 10 4-4 4 4"/></svg></button></div>
15
16
  </header>
16
17
  <main>
17
18
  <aside id="sidebar"><nav id="entries" aria-label="Tokens"></nav></aside>
@@ -1,5 +1,5 @@
1
- :root{font:13px/1.5 system-ui,sans-serif;color-scheme:light;background:#fafafa;color:#444;--frame-bg:#fafafa;--frame-ink:#444;--frame-line:#ddd;--pane-width:min(276px,42vw)}
2
- :root[data-theme="dark"]{color-scheme:dark;--frame-bg:#181818;--frame-ink:#ddd;--frame-line:#444;background:var(--frame-bg);color:var(--frame-ink)}
1
+ :root{font:13px/1.5 system-ui,sans-serif;color-scheme:light;background:#fafafa;color:#444;--frame-bg:#fafafa;--frame-ink:#444;--frame-line:#ddd;--pane-width:min(276px,42vw);--icons-surface:#fff;--icons-muted:#6b7080;--icons-grid:#dfe0ee;--icons-grid-mid:#b4b7dc;--icons-grid-bg:#f6f6fd;--icons-error:#c23d51;--icons-error-bg:#fcecef}
2
+ :root[data-theme="dark"]{color-scheme:dark;--frame-bg:#181818;--frame-ink:#ddd;--frame-line:#444;background:var(--frame-bg);color:var(--frame-ink);--icons-surface:#202020;--icons-muted:#a0a4b0;--icons-grid:#34364a;--icons-grid-mid:#55598a;--icons-grid-bg:#1c1c26;--icons-error:#f08a9a;--icons-error-bg:#3a1f25}
3
3
  .entry-preview{float:right;display:inline-flex;align-items:center;margin-inline-start:8px;opacity:.65}.entry-preview svg{width:14px;height:14px}.entry-preview[data-state="building"] svg{animation:preview-spin 1s linear infinite}.entry-preview[data-state="error"],.entry-preview[data-state="ready"]{opacity:1}@keyframes preview-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.entry-preview svg{animation:none!important}}
4
4
  *{box-sizing:border-box}body{margin:0;height:100vh;display:flex;flex-direction:column;overflow:hidden}button,a{font:inherit;color:inherit}button{cursor:pointer;background:transparent;border:1px solid var(--frame-line);border-radius:4px}button:focus-visible,a:focus-visible{outline:2px solid var(--frame-ink);outline-offset:2px}svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;flex:none}svg:not([aria-label]){pointer-events:none}
5
5
  header{height:52px;display:flex;flex:none;border-bottom:1px solid var(--frame-line);align-items:stretch;background:var(--frame-bg)}#brand{width:var(--pane-width);display:flex;flex:none;gap:8px;align-items:center;padding:0 12px;border-right:1px solid var(--frame-line);font-weight:600;white-space:nowrap}#brand .mark{font-weight:700}#title{min-width:0;overflow:hidden;text-overflow:ellipsis}#pane-toggle{width:28px;height:28px;margin-inline-start:auto;display:grid;place-items:center;flex:none}.collapsed #brand{width:44px;padding:0 8px;border-right:0}.collapsed #brand .mark,.collapsed #title{display:none}
@@ -28,3 +28,20 @@ main{flex:1;min-height:0;display:flex}#sidebar{width:var(--pane-width);flex:none
28
28
  @media(max-width:480px){#preview-error{flex-wrap:wrap}#preview-error-message{flex-basis:calc(100% - 24px)}#preview-error-details{margin-inline-start:22px}}
29
29
 
30
30
  #preview-status[data-warmup="warming"][data-phase="ready"] .status-dot{background:transparent;border:1.5px solid currentColor;animation:status-pulse 1.6s ease-in-out infinite}#warmup-status{margin:8px 0 0;opacity:.7}
31
+ /* The brand selector sits beside the theme button only when the project declares brands. */
32
+ #brand-select{height:28px;max-width:12em;font:inherit;color:inherit;background:transparent;border:1px solid var(--frame-line);border-radius:4px;padding:0 4px}
33
+ /* Icons: the project's glyph folder drawn natively in showcase chrome colours. */
34
+ body[data-active-section="icons"] #sidebar{display:none}
35
+ .icons-view{height:100%;overflow:auto;padding:24px 28px 40px;font-size:14px;line-height:1.4}.icons-view h1{font-size:22px;margin:0 0 4px}.icons-view h2{font-size:16px;margin:24px 0 10px}.icons-view h2 small{font-size:14px;font-weight:400;color:var(--icons-muted)}
36
+ .icons-head{display:flex;gap:16px;align-items:flex-start;justify-content:space-between;flex-wrap:wrap}.icons-summary{margin:0;color:var(--icons-muted);overflow-wrap:anywhere}.icons-head input{font:inherit;color:inherit;background:var(--icons-surface);border:1px solid var(--frame-line);border-radius:6px;padding:6px 10px;width:min(260px,100%)}
37
+ .icons-set{display:grid;grid-template-columns:repeat(auto-fill,minmax(44px,1fr));gap:12px 0;justify-items:center;background:var(--icons-surface);border:1px solid var(--frame-line);border-radius:12px;padding:16px 18px}.icons-set-item{display:grid;place-items:center;padding:4px}
38
+ .icons-glyph{display:inline-flex;flex:none;color:inherit}.icons-glyph>svg{display:block;width:100%;height:100%;pointer-events:none}
39
+ .icons-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(200px,100%),1fr));gap:12px;align-items:start}
40
+ .icons-card{min-width:0;background:var(--icons-surface);border:1px solid var(--frame-line);border-radius:12px;padding:12px 14px}.icons-card[data-findings]{border-color:var(--icons-error)}
41
+ .icons-card-head{display:flex;gap:8px;align-items:center;justify-content:space-between}.icons-card h3{margin:0;font:600 14px/1.4 ui-monospace,SFMono-Regular,Consolas,monospace;overflow-wrap:anywhere}
42
+ .icons-badge{flex:none;background:var(--icons-error-bg);color:var(--icons-error);border-radius:999px;font-size:11px;font-weight:600;padding:1px 8px}.icons-alias{margin:2px 0 0;font-size:12px;line-height:1.4;min-height:1.4em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--icons-muted);overflow-wrap:anywhere}
43
+ .icons-mag{position:relative;width:96px;height:96px;margin:10px auto;background:var(--icons-grid-bg)}.icons-mag>.icons-grid{position:absolute;inset:0;width:100%;height:100%}.icons-mag>.icons-glyph{position:absolute;inset:0}
44
+ .icons-grid line{stroke:var(--icons-grid);stroke-width:.5px;vector-effect:non-scaling-stroke}.icons-grid line.mid{stroke:var(--icons-grid-mid);stroke-width:1px}
45
+ .icons-sizes{display:flex;flex-wrap:wrap;gap:10px;align-items:flex-end;justify-content:center}.icons-size{display:flex;flex-direction:column;align-items:center;gap:2px}.icons-size small{font-size:10px;color:var(--icons-muted)}
46
+ .icons-finding{margin:10px 0 0;font-size:12px;color:var(--icons-error);background:var(--icons-error-bg);border-radius:6px;padding:5px 8px;overflow-wrap:anywhere}.icons-empty{color:var(--icons-muted)}
47
+ .icons-logos{display:flex;flex-wrap:wrap;gap:12px}.icons-logo{display:flex;align-items:center;gap:10px;margin:0;background:var(--icons-surface);border:1px solid var(--frame-line);border-radius:10px;padding:8px 12px}.icons-logo img,.icons-logo-muted{width:24px;height:24px;object-fit:contain}.icons-logo-muted{display:inline-block;background:var(--icons-muted);-webkit-mask:center/contain no-repeat;mask:center/contain no-repeat}.icons-logo figcaption{font-family:ui-monospace,SFMono-Regular,Consolas,monospace}
@@ -71,7 +71,8 @@ redistributing the skills. Component-library notices belong beside the imported
71
71
  project, separate from these skill notices.
72
72
 
73
73
  The showcase is a tool-owned minimal shell plus an MCP client and Apps host.
74
- Its four sections discover token categories and scenario entries through MCP.
74
+ Its Brand, Tokens, Components, Patterns and Composition sections discover token
75
+ categories and scenario entries through MCP; its Icons tab shows the glyph set.
75
76
  The skills use the connected runtime URL, or `ads showcase` for browser-only work;
76
77
  they do not generate page browsers or duplicate the tool shell. Scenarios,
77
78
  fixtures and adapters remain colocated with their owners; larger entries live in
@@ -114,11 +114,11 @@ helpers do not grant custom scenario CSS.
114
114
 
115
115
  For atomic base/variant styling, helper/wrapper class composition, extracted
116
116
  custom-property arithmetic, typed `@property` registrations, or an
117
- `atomic-composition-review` / `atomic-composition-limit` advisory, read
117
+ `atomic-composition-review` / `atomic-composition-limit` finding, read
118
118
  [atomic style composition](references/atomic-styles.md). The same guide is served
119
119
  as `ads://guides/atomic-styles`. It explains shorthand/logical conflicts and
120
120
  matching-property fixes, plus the build resolver for preserving opaque custom
121
- properties through extraction. Review warnings in the real `cx` composition and verify
121
+ properties through extraction. Check review items in the real `cx` composition and verify
122
122
  computed styles across affected sizes/states; retain intentional product behavior.
123
123
 
124
124
  Controllers are UI behavior owners: private helpers stay with their component or
@@ -311,9 +311,10 @@ foundation CSS rather than assigning shared token values in JavaScript. Keep
311
311
  full-app integration harnesses and workflow coverage in application test support.
312
312
 
313
313
  Foundation CSS is checked, not an escape hatch. Value sheets define shared tokens
314
- on the document root/themes; `fonts.css` holds font-face metadata. `base.css` has
315
- three closed roles: root/body typography, canvas and theme defaults; limited native
316
- normalization; and global focus indicators/reduced-motion rules. Every selector
314
+ on the document root (per-theme halves) or a brand's `[data-brand]`; `fonts.css`
315
+ holds font-face metadata. `base.css` has three closed roles: root/body typography,
316
+ canvas and theme defaults; limited native normalization; and global focus
317
+ indicators/reduced-motion rules. Every selector
317
318
  branch, property and value must fit its role. Token-backed control skins, layout,
318
319
  interactive state rules and owner hooks are rejected even through `:where()`.
319
320
  Do not copy an unchecked upstream preflight or turn a component repair into a reset.
@@ -1,7 +1,7 @@
1
1
  # Atomic style composition
2
2
 
3
3
  Use this guide when creating or migrating component/pattern styles, changing
4
- base/size/state combinations, or reviewing `atomic-composition-review` warnings.
4
+ base/size/state combinations, or reviewing `atomic-composition-review` items.
5
5
  It is also available as `ads://guides/atomic-styles` through ADS MCP.
6
6
 
7
7
  ## Why valid tokens can still render incorrectly
@@ -203,7 +203,7 @@ entire className; `<button {...props} className={cx(base, className)} />` compos
203
203
  it explicitly. Keep the product's intended forwarding behavior when fixing an
204
204
  overlap. Do not change the public API simply to make tracing easier.
205
205
 
206
- Warnings include a bounded `composition` path through traced helpers and
206
+ Review items include a bounded `composition` path through traced helpers and
207
207
  components. A `target` identifies a statically reached DOM element. This
208
208
  establishes source composition, not that a scenario mounted it or that its
209
209
  computed result is wrong. `writingModeDependent: true` identifies overlaps that
@@ -213,9 +213,9 @@ expand them safely. Token formulas, inheritance and runtime values still need
213
213
  review. A margin shorthand and `margin-inline: auto` may agree horizontally but
214
214
  disagree in vertical text, so horizontal equality alone is insufficient.
215
215
 
216
- ## Respond to a warning
216
+ ## Respond to a review item
217
217
 
218
- 1. Follow the warning's related file/line locations and inspect the actual `cx`
218
+ 1. Follow the review item's related file/line locations and inspect the actual `cx`
219
219
  composition. Variant lookups may contribute several possible combinations.
220
220
  2. In a current built preview, inspect computed properties and the winning CSS
221
221
  rules. Establish whether extraction order, specificity, writing mode or an
@@ -231,7 +231,7 @@ Increasing specificity, adding `!important`, copying styles into scenarios or
231
231
  moving component styling into `base.css` can hide the symptom while retaining
232
232
  the conflict. Prefer resolving the composition itself. If an overlap is
233
233
  intentional, document why its precedence is stable and verify the resulting
234
- behavior rather than changing product capabilities to silence a warning.
234
+ behavior rather than changing product capabilities to silence a review item.
235
235
 
236
236
  Use existing behavior contracts and `ads_verify` for important geometry. Register
237
237
  a check beside its owner, link its real scenario and use the project's browser
@@ -249,16 +249,16 @@ states, themes and supported writing modes. Wait for observable readiness; an
249
249
  event-stream connection can prevent `networkidle` from settling. A generic
250
250
  overlap scan cannot decide which dimensions the product intended. A failed
251
251
  registered geometry assertion is blocking through the existing verification
252
- contract; an overlap warning remains a review signal.
252
+ contract; an overlap review item remains a review signal.
253
253
 
254
254
  ## What ADS checks
255
255
 
256
- `atomic-composition-review` is a nonblocking warning, returned under `advisories`
257
- with `severity: "warning"`. CLI checks still exit successfully when there are no
258
- errors; MCP checks and mutations preserve the warning and its guidance URI.
256
+ `atomic-composition-review` is a nonblocking review item, returned under `advisories`
257
+ with `severity: "review"`. CLI checks still exit successfully when there are no
258
+ errors; MCP checks and mutations preserve the review item and its guidance URI.
259
259
 
260
260
  An unchanged advisory baseline is not evidence that the affected styles are
261
- correct. Triage warnings that reach an edited owner or its shared helpers against
261
+ correct. Triage review items that reach an edited owner or its shared helpers against
262
262
  the actual DOM classes and computed styles in a compiled scenario. Interaction
263
263
  checks may pass without measuring padding, alignment or sizing. When an intended
264
264
  layout is known, add a focused rendered assertion for that contract; when keeping
@@ -285,7 +285,7 @@ unresolved DOM targets and traversal limits produce bounded
285
285
  `atomic-composition-limit` informational advisories where known atomic styles
286
286
  reach an unresolved composition. Ordinary externally supplied className values
287
287
  remain open inputs, not guaranteed safe styles. Depth, work and alternative
288
- limits keep source inspection bounded; an unreported path or an empty warning
288
+ limits keep source inspection bounded; an unreported path or an empty review
289
289
  list does not establish visual correctness. Actual failed registered
290
290
  browser/behavior checks remain blocking; potentially intentional source overlaps
291
- remain warnings.
291
+ remain review items.
@@ -154,11 +154,14 @@ valueFrom: ["paint", "scheme.day", "scheme.night"],
154
154
  ```
155
155
 
156
156
  Register each matching `config.*.<path>` in `paintInputs`. The producer may write
157
- one declared field, or an exact `light-dark(${entry.scheme.day}, ${entry.scheme.night})`
158
- template over two declared fields. The normal key/map/root proof still applies.
159
- Raw constants, undeclared fields, extra writes and unknown transforms are rejected.
160
- The browser audit checks actual accessible color references in both branches;
161
- a local SVG URL or `none` is not a CSS color inside `light-dark()`.
157
+ one declared field, or a per-theme value built with the generated helpers from
158
+ `tokens/themes.generated.ts`: `themed({ light: entry.scheme.day, dark: entry.scheme.night })`
159
+ (keys exactly the declared themes) or `themedByScheme({ light: …, dark: … })` (each theme
160
+ takes the value for its color scheme). Every value is a declared field and the argument is
161
+ an object literal without spreads. The normal key/map/root proof still applies. Raw
162
+ constants, undeclared fields, `light-dark()`, extra writes and unknown transforms are
163
+ rejected. The browser audit checks an accessible color reference in every theme's branch;
164
+ a local SVG URL or `none` is not a color there.
162
165
 
163
166
  Families cannot overlap shared tokens, private runtime
164
167
  prefixes or other bindings. A broad family such as `--color-${key}` grants no
@@ -167,12 +170,12 @@ cannot be established. Registered paint consumers list their allowed binding IDs
167
170
  borrowing a peer's binding family or private runtime variable remains invalid. Bindings are scoped
168
171
  to their actual root; portals outside it need deliberate project integration.
169
172
 
170
- A registered binding producer may combine two accessible color references as
171
- `light-dark(var(--light-token), var(--dark-token))`. The App paint audit checks
172
- both branches and their observed effect in the active color scheme. Raw colors,
173
- undefined tokens and SVG URLs inside this color function remain invalid.
173
+ A registered binding producer gives a per-theme value with `themed()` or
174
+ `themedByScheme()`; its output is `var(--ads-if-<theme>, <reference>)` once per declared
175
+ theme, in declared order. The App paint audit checks every branch and its observed effect
176
+ in the active theme. Raw colors, undefined tokens and SVG URLs in a branch remain invalid.
174
177
  This derived binding form does not widen public paint-input types; use constrained
175
- references for each theme input and verify both color schemes in browser checks.
178
+ references for each theme input and verify every theme in browser checks.
176
179
 
177
180
  The App audit checks current mounted instances, accessible values, local SVG
178
181
  resources and computed paint-property responses. Visibility and complete rendered
@@ -74,7 +74,7 @@ Review that intent and do not disguise a new design decision as arithmetic.
74
74
 
75
75
  ## Review overlap without deleting legitimate roles
76
76
 
77
- `token-overlap-review` is a nonblocking warning for shared tokens with identical
77
+ `token-overlap-review` is a nonblocking review item for shared tokens with identical
78
78
  normalized definitions across their declared theme/condition scopes. It identifies
79
79
  the tokens and source. Inspect their consumers and roles. If one decision is being
80
80
  copied, reuse one shared token or make its relationship explicit with an alias.
@@ -82,7 +82,7 @@ Equal values alone do not prove equal purpose: body text and strong text, spacin
82
82
  and control sizes, or two motion roles may intentionally differ later. A light-only
83
83
  match does not justify merging tokens whose dark/reduced-motion values differ.
84
84
 
85
- For our existing workspaces, convert independent component constants explicitly:
85
+ For existing workspaces, convert independent component constants explicitly:
86
86
  select an existing shared role when it means the same thing; centralize genuinely
87
87
  missing decisions; remove private sheets/imports and contract fields; update token
88
88
  sample coverage in the shared directory. Preserve themes, units, public APIs and
@@ -90,24 +90,25 @@ behavior unless changing the visual policy was explicitly intended. Review a Git
90
90
  diff and run core, project and browser checks. There is no compatibility mode that
91
91
  keeps independent component token definitions valid.
92
92
 
93
- ## Accessibility and rhythm reviews
93
+ ## Accessibility and rhythm checks
94
94
 
95
- `ads check` reviews token values, in every theme (each `:root[data-theme=…]` scope,
96
- resolving `var()` aliases there):
95
+ `ads check` checks token values in every theme and brand. Each finding below is an error:
97
96
 
98
- - `token-contrast` warns when the roles that meet on screen fall below WCAG 2.2 AA:
99
- `--text-strong`, `--text-body`, `--text-muted`, `--text-link` and `--accent-text` on
100
- `--bg-canvas`, `--bg-surface` and `--bg-hover`; `--accent-fg` on `--accent` and
101
- `--accent-hover`; each status's `-fg` on its solid and `-text` on its `-bg` (4.5:1);
102
- `--border-focus` and `--border-strong` on the canvas and surface (3:1). Pairs whose
103
- tokens a project does not define are not reviewed; colors outside hex, rgb() and hsl()
104
- are skipped.
105
- - `token-rhythm` warns when a numbered spacing step leaves the scale `--space-N` = N × 2 px.
106
- - `token-overlap-review` compares values only within a token family (`--radius-*` with
107
- `--radius-*`): a radius equal to a spacing step is two scales meeting, not a duplicate.
97
+ - `token-contrast`: the roles that meet on screen fall below WCAG 2.2 AA: `--text-strong`,
98
+ `--text-body`, `--text-muted`, `--text-link` and `--accent-text` on `--bg-canvas`,
99
+ `--bg-surface` and `--bg-hover`; `--accent-fg` on `--accent` and `--accent-hover`; each
100
+ status's `-fg` on its solid and `-text` on its `-bg` (4.5:1); `--border-focus` and
101
+ `--border-strong` on the canvas and surface (3:1). Fix it by choosing a different ramp
102
+ step for the role, in the theme the message names, never with a one-off color.
103
+ - `token-rhythm`: a numbered spacing step leaves the scale `--space-N` = N × 2 px.
104
+ - `control-padding`: pad a control with the token for its size. A block sized with
105
+ `--control-height-<size>` pads its sides with `--control-padding-<size>`; the small gap
106
+ inside a track (segmented control, switch) uses `--control-inset` (add it to the spacing
107
+ tokens if the project has none). Anything that is not a control does not use
108
+ `--control-height-*`.
108
109
 
109
- Fix a contrast warning by choosing a different ramp step for the role, in the theme the
110
- message names, rather than adding a one-off color.
110
+ `token-overlap-review` (review) compares values only within a token family (`--radius-*`
111
+ with `--radius-*`): a radius equal to a spacing step is two scales meeting, not a duplicate.
111
112
 
112
113
  ## Exchange format
113
114
 
@@ -143,18 +144,125 @@ Name roles by element and purpose, the same in every theme; only their values ch
143
144
 
144
145
  ## Themes
145
146
 
146
- Declare themes in `ds.config.json` (`themes: [{ name, scheme }]`, the first is the default).
147
- A theme changes values, never names: give the default theme's values on `:root`, override
148
- them under `[data-theme="<name>"]`, and keep roles aliasing ramp steps on
149
- `:root, [data-theme]` so they re-resolve wherever a theme applies. Override a whole ramp in a
150
- theme, not a few steps.
151
-
152
- - `data-theme` on `<html>` themes the page; on any element it themes one section (a dark
153
- hero in a light page). A themed section paints its own canvas and text (`base.css`).
154
- - `scheme` sets `color-scheme`, so native controls and scrollbars match the theme.
155
- - Add a theme for a real need: high contrast, a dimmed reading mode, a brand. Check it in the
156
- showcase (the theme button steps through declared themes) and capture it by name.
157
- - Runtime switching (user choice, `prefers-color-scheme`, remembering it) is application code.
147
+ Declare themes in `ds.config.json` (`themes: [{ name, scheme }]`, the first is the default;
148
+ `scheme` sets `color-scheme` for native controls and scrollbars).
149
+
150
+ Write a token that differs per theme as one half per theme, named with the theme as suffix,
151
+ on `:root`:
152
+
153
+ ```css
154
+ :root {
155
+ --color-accent-9-light: oklch(55% .2 280);
156
+ --color-accent-9-dark: oklch(70% .16 280);
157
+ --bg-canvas-light: var(--slate-1-light);
158
+ --bg-canvas-dark: var(--slate-2-dark);
159
+ --accent: var(--color-accent-9);
160
+ }
161
+ ```
162
+
163
+ - A half is a plain value or refers to halves: `--text-muted-dark: var(--slate-11-dark)`,
164
+ never `var(--slate-11)` (`theme-half-reference`).
165
+ - Give every themed token a half for every declared theme (`theme-coverage`). Tokens that do
166
+ not change per theme stay single values; a role that aliases a ramp step
167
+ (`--accent: var(--color-accent-9)`) needs no halves.
168
+ - Never set token values under `[data-theme]` or `prefers-color-scheme` (`theme-old-form`),
169
+ and never set a token both as one value and as halves (`theme-half-conflict`).
170
+ - ADS writes `tokens/themes.generated.css` from the halves and the declared themes and
171
+ brands: `ads assets` writes it, and the showcase and MCP server rewrite it whenever tokens
172
+ or `ds.config.json` change. Commit it, never edit it; it is the last foundation import.
173
+ After editing tokens without a running showcase, run `ads assets` (`themes-generated`
174
+ fails when it is stale).
175
+ - `data-theme="<name>"` on `<html>` themes the page; on any element it themes that section
176
+ and everything inside it, down to the next `data-theme`. A themed section paints its own
177
+ canvas and text (`base.css`).
178
+ - Add a theme for a real need: high contrast, a dimmed reading mode. Add a half for it to
179
+ every themed token. Check a theme in the showcase (the theme button steps through declared
180
+ themes) and capture it by name.
181
+ - Show content that belongs to one theme (a dark logo variant) with the generated display
182
+ switch: `display: var(--display-dark, block)`. It is `none` outside the nearest dark
183
+ theme. Never style by theme or brand with a selector (`[data-theme="dark"] &`,
184
+ `:root[data-brand] &`): it ignores the nearest section (`theme-selector`). Give per-theme
185
+ values as token halves instead.
186
+ - A per-theme value that comes from data at runtime (a chart series color, a highlighter
187
+ color) uses the generated helpers, never `light-dark()` (`theme-light-dark`):
188
+ `style={{ "--series": themed({ light: a, dark: b }) }}` with every declared theme as a key,
189
+ or `themedByScheme({ light: a, dark: b })` when the data has only light and dark (each
190
+ theme takes the value for its scheme). Values are complete colors.
191
+ - To follow the OS setting, set `"followSystemTheme": true` in `ds.config.json`: a page
192
+ without `data-theme` takes the first declared theme whose scheme matches
193
+ `prefers-color-scheme`. An explicit `data-theme` always wins. Letting the user choose and
194
+ remembering it is application code: it sets `data-theme`.
195
+
196
+ ## Brands
197
+
198
+ A brand is a second axis beside the theme: the theme sets the color mode, the brand sets
199
+ identity (an accent ramp, a font). Use brands for white label (one product, each customer's
200
+ accent, font and logo, each in light and dark), a product family, or a co-branded partner
201
+ section; without them every combination becomes a theme (`acme-light`, `acme-dark`, …).
202
+
203
+ Declare brands in `ds.config.json` (`brands: [{ name }]`, the first is the default; leave
204
+ `brands` out for one brand). The default brand's values are the ones on `:root`. Another
205
+ brand re-sets existing tokens on its own selector only, with every half of a themed token it
206
+ changes:
207
+
208
+ ```css
209
+ [data-brand="acme"] {
210
+ --color-accent-9-light: oklch(55% .2 25);
211
+ --color-accent-9-dark: oklch(70% .16 25);
212
+ --font-sans: Georgia, serif;
213
+ }
214
+ ```
215
+
216
+ - `data-brand="<name>"` on `<html>` brands the page; on any element that section. Brand and
217
+ theme are independent: each element takes its nearest brand and its nearest theme, at any
218
+ nesting depth, including the default brand inside another brand's section.
219
+ - Errors: a brand that gives a themed token one value (`brand-theme-value`) or only some of
220
+ its halves or ramp steps (`brand-coverage`), a token only a brand defines
221
+ (`brand-new-token`), a declared brand without values (`brand-empty`), a `data-brand` name
222
+ the config does not declare (`brand-undeclared`). `token-contrast` runs for every brand
223
+ in every theme.
224
+ - A brand's logo is brand artwork (`ads://guides/branding`). Render every brand's logo and
225
+ show each with `display: var(--display-brand-<brand>, block)`, so a section shows its
226
+ nearest brand's logo.
227
+ - The showcase shows a brand selector next to the theme button; captures take `brand`;
228
+ `ads tokens --format dtcg --brand <name>` exports a brand (with `--theme`, one brand in
229
+ one theme).
230
+
231
+ ## Colors in Canvas, WebGL and SVG renderers
232
+
233
+ A renderer that needs colors as values (a graph, a chart, a canvas) reads them from the
234
+ generated palette, never from the page per item. `tokens/themes.generated.ts` holds every
235
+ color token resolved for every context (`<theme>`, and `<brand>/<theme>` for other brands)
236
+ as `{ css, rgba }`: `css` is `#rrggbb`, or `rgba(…)` when translucent; `rgba` is sRGB
237
+ 0–255 with alpha 0–1. Aliases, halves and `color-mix()` are resolved; out-of-gamut colors
238
+ are clipped per channel, as a canvas does. ADS writes it with `themes.generated.css`.
239
+
240
+ ```ts
241
+ import { paletteFor, observePalette } from "@ds";
242
+
243
+ let colors = paletteFor(container); // once per render pass
244
+ const fill = colors["--accent"].rgba; // inside the per-node loop
245
+ const stop = observePalette(container, next => { colors = next; redraw(); });
246
+ ```
247
+
248
+ - `paletteFor(element)` returns the palette of the element's nearest theme and brand (and
249
+ the OS setting under `followSystemTheme`). Call it once per render or context change; look
250
+ colors up inside loops.
251
+ - `observePalette(element, callback)` calls back once when the element's theme or brand
252
+ changes; redraw from it instead of rebuilding the renderer. It returns the unsubscribe.
253
+ - `paletteContext(element)` returns the context key (`<theme>` or `<brand>/<theme>`) for
254
+ `palette[key]` or for caching per context.
255
+ - `resolveColor(element, value)` resolves a color that is not a palette token (currentColor,
256
+ a value from data) once, without inserting elements, and caches it.
257
+ - A token whose value cannot be resolved ahead of time (currentColor, relative color syntax,
258
+ system colors) is not in the palette in any context; `unresolved` lists it. Use
259
+ `resolveColor` for those.
260
+ - The palette reflects token sheets, not inline token overrides at runtime or `@media`
261
+ variants.
262
+
263
+ `render-color-probe` (review) flags a computed-style color read or `getImageData` inside a
264
+ per-item path (an array callback, a loop body, `nodeReducer`/`edgeReducer`, d3 `.attr`/
265
+ `.style` callbacks). Move the read out with `paletteFor`.
158
266
 
159
267
  ## Spacing
160
268
 
@@ -152,7 +152,9 @@ current rendered revision and complete acceptance before finishing the change.
152
152
  After rendered review, call `ads_accept({id,revision})` once. It checks that exact
153
153
  revision, runs mandatory ADS guards plus `acceptance.checks` and, when
154
154
  `acceptance.behaviorChecks` is enabled, affected registered behavior checks against an isolated candidate, and applies passing changes at
155
- their normal paths. Changes during checking or baseline conflicts prevent
155
+ their normal paths. When `acceptance.browserAudit` is enabled it also runs the axe-core
156
+ audit on the candidate's affected UI scenarios; an `a11y-axe` error rejects the draft.
157
+ Fix it in the component and accept the new revision. Changes during checking or baseline conflicts prevent
156
158
  application. Successful acceptance removes the proposal and records an event.
157
159
  There is no separate Apply or Iterate action. A failed attempt retains the draft;
158
160
  inspect its returned resultId with `ads_results` and fix the reported boundary.
@@ -23,8 +23,9 @@ ads_apply_patch({"unit":"components/Example","patchFile":"<returned patchFile>",
23
23
  The dry run validates the candidate in an isolated project copy using mandatory
24
24
  ADS guards, `acceptance.checks` and, when `acceptance.behaviorChecks` is enabled,
25
25
  affected registered behavior checks. Registration alone does not require a test
26
- at acceptance. See [validation policies](validation.md). Configured browser checks use that candidate's
27
- managed preview, not the live showcase. Read the summary, then page failing
26
+ at acceptance. With `acceptance.browserAudit`, axe-core also audits the candidate's
27
+ affected UI scenarios; `a11y-axe` errors reject the patch. See [validation policies](validation.md).
28
+ Configured browser checks use that candidate's managed preview, not the live showcase. Read the summary, then page failing
28
29
  `outcomes`, `diagnostics` or pipeline `checks` through `ads_results` with its
29
30
  `resultId`. Inspect one exact outcome with `ads_investigate({unit,check,runId})`;
30
31
  fix the draft and diff again. See [evidence.md](evidence.md) for page/range limits.
@@ -41,6 +41,15 @@ implicitly requiring them at acceptance.
41
41
  all registered behavior checks. Use before a release, after ownership/test/config
42
42
  migrations and for an explicit complete audit. Changed scope narrows registered
43
43
  owners while project scripts and core gates retain full scope.
44
+ - `browserAudit: true` in either policy adds the axe-core audit of every rendered
45
+ UI scenario in every brand and theme (`browser-accessibility-audit`). Its `a11y-axe`
46
+ findings are errors that fail the policy. With `acceptance.browserAudit`, draft
47
+ acceptance and guarded patches/transactions audit the candidate's affected UI
48
+ scenarios (all after configuration, foundation, token or asset changes) and reject
49
+ the change on any `a11y-axe` error or a `browser-audit` failure to run. Declare
50
+ `"sideEffects": ["**/*.css"]` in the project's `package.json`, as the starters do, so a
51
+ component change audits only the scenarios that import it. See
52
+ ads://guides/accessibility.
44
53
  - Draft create, edit and show are preview-only; they trigger neither policy.
45
54
  `ads_verify` explicitly runs selected checks independently of either policy.
46
55
  - Builds, hooks and CI trigger a policy only when their scripts invoke it. Use
@@ -49,11 +58,11 @@ implicitly requiring them at acceptance.
49
58
  disable tests or weaken configuration to make a failing change pass.
50
59
 
51
60
  Defaults: both script lists are empty, acceptance `behaviorChecks:false`,
52
- validation `behaviorChecks:true`. No lint/test/build script names are inferred.
61
+ validation `behaviorChecks:true`, both `browserAudit:false`. No lint/test/build script names are inferred.
53
62
  Every listed script must exist; commands are trusted project configuration, not
54
- MCP arguments. Move the removed `mcp.mutationChecks` field to `acceptance.checks`
55
- and explicitly choose behavior gating. Existing `mcp.mutationCheckTimeoutMs`
56
- still bounds each project script; behavior profiles have separate budgets.
63
+ MCP arguments. `mcp.mutationChecks` is a configuration error: list those scripts in
64
+ `acceptance.checks` and set `acceptance.behaviorChecks`. `mcp.mutationCheckTimeoutMs`
65
+ bounds each project script; behavior profiles have separate budgets.
57
66
 
58
67
  Report the chosen policy, scope and revision. Skipped tests are not passed tests;
59
68
  acceptance evidence is not complete-validation evidence. The two policies keep