Commit 6c0685b
feat(design-tokens): complete the CSS-var surface so the website can leave inline styles (#845)
* docs(specs): design token CSS-var completion + docs visual review findings
A visual review of the docs site found a set of measured defects: both sticky
rails are dead site-wide (body overflow-x makes <body> a scroll container),
.docs-table-scroll never scrolls because the table is width:100% with no
min-width, and no scroll-margin exists so every deep link lands behind the
81px fixed nav.
Roughly half the fixes are inexpressible in the inline style={{}} objects the
components use, so the work decomposes into three projects: token CSS-var
completion, substrate migration, then the polish arc.
Adds the findings audit (evidence log, reproducible) and the spec for project
one — emitting the type and space scales that generate-theme-css.ts never
learned about, resolving 18 hardcoded literals in global.css, and adding a
machine-checked parity test so the migration's core premise is verified rather
than assumed.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* docs(plans): implementation plan for design token CSS-var completion
Ten TDD tasks: parity spec first (red), then emit the type scale as Tailwind v4
composite --text-* tokens and the space scale, bring the orphaned tokens.css
under the generator, ship it, and resolve global.css's 18 literals in three
separately-committed categories so the one visible change is isolated.
Validated the parity spec's logic against the real tokens in the real vitest
runner before writing it down: 104 token leaves, 34 vars parsed today, and six
spot-checked paths are value-identical, which is the premise the substrate
migration rests on.
Also corrects the spec: two of the five stale-literal uses are already
var(--color-text-muted, #555770) fallbacks that render the token today, so the
visible change is bounded to table header text, table body text, and code-block
titles — not list markers and figure captions.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* test(design-tokens): assert token↔CSS-var parity (red — type and space scales unemitted)
* feat(design-tokens): emit the type scale as Tailwind v4 composite text tokens
* feat(design-tokens): emit the space scale; token↔CSS parity now green
* test(design-tokens): pin the --ds-* names cockpit and example apps reference
* refactor(design-tokens): generate tokens.css from light.ts so --ds-* can no longer drift
* build(design-tokens): export and ship tokens.css alongside theme.css
* refactor(website): use accent tokens for docs code chips and table rule
* fix(website): docs tables and code titles use the live text tokens
The literals #555770 and #8b8fa3 came from the old --ds-* surface and no
longer match any token. Visible change, bounded to table header text, table
body text, and code-block titles.
* refactor(website): name the docs-local constants that are not design tokens
* docs(design-tokens): correct the utility name and record two browser findings
Three corrections, all measured in a browser rather than reasoned about:
1. Tailwind strips the namespace prefix, so `--container-page` generates
`max-w-page`, not `max-w-container-page`. The spec, the plan, and a
committed code comment all had it wrong. Verified: `max-w-page` computes to
1200px, `p-section-y` to 64px, and `text-h2` to 36px/40.32px — which also
confirms the `--text-*--line-height` sub-key is honoured.
2. `.shiki` and `[data-rehype-pretty-code-title]` are dead CSS. rehype-pretty-code
runs with keepBackground:true, so it writes the theme background inline on
the <pre> and never emits a .shiki class; no code fence uses `title=`. Zero
matches on docs and blog. That narrows the visible surface of the token
adoption to table header and table body text only. Recorded as findings §9;
deleting dead rules is cleanup, not this project.
3. color-mix resolves and Lightning CSS emits a hex fallback plus an @supports
upgrade, so the open question in the spec resolves in its favour.
Also documents the website suite's 5 pre-existing failures as the baseline, so
Task 10 does not read them as a regression.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* fix(website): keep the code-title foreground with the syntax-theme constants
var(--color-text-muted) is a light-surface role token; on the dark #1a1b26
title bar it drops to 3.6:1, below AA. Move it to --docs-code-title-fg
alongside the other tokyo-night-coupled values.
* test(design-tokens): --ds-render-green is consumer-referenced, add it to the contract
Referenced 13x across cockpit/render. It was absent from the list because the
list was derived against the pre-generator tokens.css, which did not define it.
* test(design-tokens): enforce the invariant the light.* parity exclusion assumes
* test(design-tokens): assert cssVars() and generated tokens.css agree
Two hand-maintained emitters of the same --ds-* namespace, from the same
sources, with nothing enforcing agreement. They match today; this keeps them
matching.
* chore(design-tokens): align the regenerate command, fix a tint comment, drop an unused directive
---------
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>1 parent 2d5e685 commit 6c0685b
13 files changed
Lines changed: 2378 additions & 67 deletions
File tree
- apps/website/src/app
- docs/superpowers
- audits
- plans
- specs
- libs/design-tokens
- scripts
- src/lib
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
4 | 33 | | |
5 | 34 | | |
6 | 35 | | |
| |||
55 | 84 | | |
56 | 85 | | |
57 | 86 | | |
58 | | - | |
| 87 | + | |
59 | 88 | | |
60 | 89 | | |
61 | 90 | | |
| |||
74 | 103 | | |
75 | 104 | | |
76 | 105 | | |
77 | | - | |
78 | | - | |
| 106 | + | |
| 107 | + | |
79 | 108 | | |
80 | 109 | | |
81 | 110 | | |
| |||
97 | 126 | | |
98 | 127 | | |
99 | 128 | | |
100 | | - | |
| 129 | + | |
101 | 130 | | |
102 | | - | |
103 | | - | |
| 131 | + | |
| 132 | + | |
104 | 133 | | |
105 | 134 | | |
106 | 135 | | |
| |||
111 | 140 | | |
112 | 141 | | |
113 | 142 | | |
114 | | - | |
115 | | - | |
| 143 | + | |
| 144 | + | |
116 | 145 | | |
117 | 146 | | |
118 | 147 | | |
| |||
136 | 165 | | |
137 | 166 | | |
138 | 167 | | |
139 | | - | |
| 168 | + | |
140 | 169 | | |
141 | 170 | | |
142 | 171 | | |
| |||
151 | 180 | | |
152 | 181 | | |
153 | 182 | | |
154 | | - | |
155 | | - | |
| 183 | + | |
| 184 | + | |
156 | 185 | | |
157 | 186 | | |
158 | 187 | | |
159 | 188 | | |
160 | 189 | | |
161 | 190 | | |
162 | 191 | | |
163 | | - | |
| 192 | + | |
164 | 193 | | |
165 | 194 | | |
166 | 195 | | |
167 | 196 | | |
168 | 197 | | |
169 | 198 | | |
170 | | - | |
| 199 | + | |
171 | 200 | | |
172 | 201 | | |
173 | 202 | | |
| |||
179 | 208 | | |
180 | 209 | | |
181 | 210 | | |
182 | | - | |
| 211 | + | |
183 | 212 | | |
184 | 213 | | |
185 | 214 | | |
| |||
192 | 221 | | |
193 | 222 | | |
194 | 223 | | |
195 | | - | |
196 | | - | |
| 224 | + | |
| 225 | + | |
197 | 226 | | |
198 | 227 | | |
199 | 228 | | |
| |||
0 commit comments