You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
3.1: a dark StyleScope with a seeded scheme inside a light wrapper on a dark page gets light text tokens #558
Found while moving Tavilio to 3.0. Tavilio works around it in Tavilio#266.
Setup:html[data-theme="dark"] > a wrapper with data-theme="light" > a StyleScope with theme="dark" and an accentSeed. That gives one element with both data-theme="dark" and data-accent="custom".
Result: that element gets the light theme's text tokens.
Cause: the light block in tokens.css includes :is(dark) :is(light) :is([data-brand],[data-accent],[data-neutral]).
The scope matches it through its ancestors.
It has the same specificity (0,3,0) as the dark block's :is(light) :is(dark):is([data-…]).
It comes later in the sheet, so it wins.
Who hits it: any StyleScope that pins a theme and seeds a scheme inside a light-on-dark page. One example is a product site with its own light wrapper, viewed on a device in dark mode.
Fix direction: a nested-theme scope should resolve to its nearest data-theme. The theme-invert script (scripts/theme-invert.cjs) and themeSelector() should emit selectors where the closer theme wins. Two ways to get there:
make the self-match (:is(dark):is([data-…])) more specific than the ancestor match, or
order the generated blocks so the self-match comes last.
Activity