Repository navigation
Description
Summary
src/styles/host-reset.css:62 restates color on the widget's root as
color: hsl(var(--foreground)). --foreground is declared nowhere — not in src/, not by
the runtime palette engine, not by Radix Colors. So the declaration is invalid at computed-value
time, color computes to unset, and because color inherits, the widget's root takes the host
page's color instead.
That is the exact failure #156 and #236 exist to prevent, surviving in one of the six properties
host-reset.css is there to pin. A host's body { color: … } still tints every line of widget
copy that no Tailwind text-* utility covers.
Found incidentally while fixing the troubleshooting row in #261.
Approach
Measured on the shipped bundle, built from cab731c:
dist/assets/sheet-*.jsemits.sy-atlas{--sy-frame-h:100dvh;color:hsl(var(--foreground));font-family:…;letter-spacing:normal;text-align:start;text-transform:none;word-spacing:normal}.--foregroundappears exactly once in the whole ofdist/— that reference. There is no
declaration anywhere in the output, so nothing supplies it at runtime either.src/config/theme/palette.ts:194-200—MANAGED_VARScovers--{role}-on,--{role}-1…12
and--background.applyPalettenever writes--foreground.- There is no
@property --foregroundregistration:scripts/assert-css-scoped.mjsreports 62
registrations and allows only the--tw-prefix, so an unregistered custom property has no
typed initial value to fall back to.
The name that does exist is the Tailwind theme token --color-foreground: var(--gray-12)
(src/styles/globals.css:277), which is why text-foreground works while the root declaration
does not. The bare --foreground looks like a leftover from the channel-format scheme the brand
ramps still use (hsl(var(--primary-9))).
Decide between the two honest fixes and apply one:
color: var(--color-foreground)— reuses the token the rest of the sheet resolves colour
through. Note--color-foregroundresolves to--gray-12, a Radix hex, so it must not be
wrapped inhsl().- Declare
--foregroundbeside the other root tokens in the:root, .light, .light-themeblock
(src/styles/globals.css:289) in the channel formathsl()expects, with a.dark
counterpart.
Prefer 1 — it adds no token and cannot drift from the ramp. Check the dark mode either way:
--gray-12 already flips through @radix-ui/colors/gray-dark.css.
⚠ src/styles/ is in securityReview.triggerPattern (.claude/workflow.json), so the fix
triggers a branch-level security review.
Acceptance criteria
- The widget's root
colorresolves to a real colour in the shipped stylesheet, in both light
and dark mode. - A host page setting
body { color: … }does not change any widget text. - No declaration in the emitted CSS references a custom property that nothing declares.
-
docs/embedding.md's "Two things still cross" list stays true of the shipped sheet — it
namescoloras a restated property, which is only honest once this is fixed.
Verification checklist
-
pnpm build, thengrep -o -- '\.sy-atlas{[^}]*}' dist/assets/sheet-*.jsshows acolor
value that needs no undeclared variable. -
pnpm build, then confirm novar(--…)in the emitted sheet names a property absent from
the same output. - A spec pins the root
colordeclaration, so a token rename cannot silently re-break it. The
existingsrc/config/theme/palette.defaults.test.tsis the nearest precedent for a gate of
this shape. - Verify in a browser against a host page that sets
body { color: red }— a node spec cannot
see invalid-at-computed-value-time, since that is resolved by the CSS engine. Use
pnpm review:embed. -
pnpm lint && pnpm typecheck && pnpm test:runpass.
Notes
Why no gate caught it. assert-css-scoped.mjs checks that every rule is confined to
.sy-atlas, which this rule is. Nothing checks that a declaration's var() references resolve.
The widget looks correct on any host that sets no color, which is most of them, so the symptom
is invisible until it is not.
This is not the same bug as #236. #236 was about host selectors outranking the widget's;
the shadow root fixed that. This is the inherited-property half, which #236 deliberately kept
host-reset.css for — and that half has been a no-op for color the whole time.
src/styles/host-reset.css's own header states the intent: "Restating them here is what makes the
widget the root of its own world." For color it does not.
🤖 Written by the sydevs autonomous loop — see what this is
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Hold Until
Projects
- StatusShow more project fieldsDone
Activity
Ardnived commentedon Oct 10, 2026
@sydevs-bot implement
sydevs-bot commentedon Oct 10, 2026
🤖 no session running
recent dispatches
Written by the sydevs dispatcher. Sessions never edit this comment.
fix(build): pool check 5's declared properties across every sheet
docs(styles): state the #262 rule twice, not five times
refactor(map): apply the simplify pass