mirror of
https://github.com/bitbaum/loki.git
synced 2026-12-04 08:58:25 +01:00
#734 pasted the .modes / .mode rules into the middle of the .dot rule's declaration block, and left .dot's `background` unterminated. CSS error recovery swallows everything from that declaration to the matching brace, so two things were broken on every site embedding /widget.js: - .dot lost its own `flex: none` and `box-shadow` halo, - .modes, .mode, .mode.on, .mode:disabled and .mode-hint never applied at all, so Report / Chat / Watch rendered as naked 16px text instead of chips. Neither is catchable by tsc — the CSS is a template string. The same rules also carried literal hex fallbacks (#333, #aaa, #f60, #fff, #888) behind var() lookups. The widget's Shadow DOM sets `all: initial` and defines no custom properties, so those var()s could only ever resolve to their fallback: a hardcoded colour wearing a token's clothes. Every colour now interpolates from the boot theme, which is generated from @bitbaum/design-tokens, like the rest of the file. Ratchet, so this class ends here: widget-theme-from-tokens now parses both emitted stylesheets and fails on a nested block inside a plain rule, an unterminated declaration, any var(), and any hex that is not a colour the generated theme supplied. All three faults were proven by mutation. Co-authored-by: Claude Opus 5 <noreply@anthropic.com>