Commit ccb97d3
committed
fix(design-system): sample the titlebar color off what paints it
Moving the mode into the value made a token declaration stop being a colour:
`getComputedStyle(root).getPropertyValue('--background')` now reads back
`light-dark(oklch(1.000 0 0), oklch(0.205 0.004 286))`, a recipe that only
resolves where it is used. The Windows titlebar sampler fed that string to a
canvas, and both of its guards passed it: `CSS.supports('color', …)` accepts a
light-dark() pair, and the rejected `fillStyle` assignment left the canvas at
its default opaque black, whose alpha is 255. Measured in Chromium 151, light
and dark both sampled `#000000` — so the native control strip went black in
every palette, putting the light-mode symbol colour `#1c1d21` on it at 1.25:1
and, in dark mode, seaming a black strip against a `#171719` app background.
That seam is the whole reason this code samples instead of hard-coding a pair.
The colour comes from `body` now, which is where `--background` is painted;
`getComputedStyle().backgroundColor` is a used value, so the engine has already
picked the branch — the same read `readModalBackdropColor` already makes. The
helper takes the element rather than a string, so an unresolved declaration has
nowhere to enter, and `CSS.supports` goes with it. Its replacement is a
transparent starting fillStyle: an assignment the canvas cannot parse now reads
back at alpha 0 and takes the fallback, for any input, instead of sampling the
black it defaulted to.
ink-ladder-contract gains the rule rather than the instance — no product source
reads a custom property as a colour at all. There were none besides this one.
Generated-by: Claude Code1 parent eee8278 commit ccb97d3
3 files changed
Lines changed: 44 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
180 | | - | |
| 180 | + | |
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
| |||
Lines changed: 24 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
196 | 220 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
214 | | - | |
| 214 | + | |
215 | 215 | | |
216 | 216 | | |
217 | | - | |
218 | | - | |
| 217 | + | |
| 218 | + | |
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
| |||
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
234 | | - | |
235 | | - | |
236 | | - | |
| 234 | + | |
237 | 235 | | |
238 | 236 | | |
239 | 237 | | |
| |||
254 | 252 | | |
255 | 253 | | |
256 | 254 | | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
261 | 264 | | |
262 | 265 | | |
263 | 266 | | |
264 | 267 | | |
265 | 268 | | |
266 | 269 | | |
267 | | - | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
268 | 276 | | |
269 | 277 | | |
270 | 278 | | |
| |||
0 commit comments