Repository navigation
fix(theme): make theme token references resolve (borders, prose colours, focus ring) - #27
Merged
Merged
Conversation
JakeGinnivan
force-pushed
the
jakeginnivan/fix-theme-token-references
branch
from
October 19, 2026 02:03
419589d to
6a58c17
Compare
JakeGinnivan
changed the base branch from
main
to
jakeginnivan/upstream-fork-prs-158-202
October 19, 2026 02:04
JakeGinnivan
force-pushed
the
jakeginnivan/upstream-fork-prs-158-202
branch
2 times, most recently
from
October 19, 2026 02:14
2f11bf7 to
ebe65ca
Compare
Base automatically changed from
jakeginnivan/upstream-fork-prs-158-202
to
main
October 19, 2026 02:21
Upstreamed from dddwa/dddperth#205. The theme builder used flat dotted keys ('border.default'). Panda emits those as `--colors-border\.default`, but every reference to them (`{colors.border.default}`, `token(colors.border.subtle)`) resolves to `var(--colors-border-default)`, which was never defined. Those references silently computed to nothing: the border tokens rendered as no border, prose colours fell back to the inherited colour, the `bg.*`/`button.*`/`link.*` aliases were empty, and `token()` dividers vanished. - Nest the keys so Panda defines the hyphenated names; move the two hard-coded escaped references (body background, hero fade) over. - `focus-ring` was `{colors.interactive.focus}33`, which becomes `var(...)33`: an invalid box-shadow, so no ring showed. Use color-mix for the 20% alpha in both stub themes. - Drop `colorPalette="brand.primary|secondary"` from the voting, agenda, my agenda and feedback buttons. It no longer type-checks once `brand` is nested, and it was always a no-op: the button recipe reads `colorPalette.solid.*`, which brand never had, so the buttons inherited gray and still do. - New test fails on any referenced-but-undefined colour, border or shadow var, and on any dot-escaped token name. Stub baselines regenerated with `pnpm vr --update-snapshots=all`: home gains the Important Dates top border, prose links and anchor headings take `text.highlight`, sponsor tiles get their `border.sponsor` frame, and the talk dialog's title divider renders.
JakeGinnivan
force-pushed
the
jakeginnivan/fix-theme-token-references
branch
from
October 19, 2026 02:22
6a58c17 to
9ef5430
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Upstreamed from dddwa/dddperth#205.
What was broken
The theme builder used flat dotted keys (
'border.default'). Panda emits those as--colors-border\.default, but every reference to them ({colors.border.default},token(colors.border.subtle)) resolves tovar(--colors-border-default), which was never defined. Those references silently computed to nothing:border="default" | "subtle" | "emphasis", thesponsorborder and the admin borders rendered as no borderbg.*,button.*andlink.*aliases were emptytoken(colors.border.subtle)dividers vanishedUtility props like
bg="surface.card"kept working, because the class and the definition used the same escaped name. That's why it went unnoticed.focus-ringwas also broken separately:{colors.interactive.focus}33becomesvar(...)33, so the33is a stray number rather than a hex alpha, and the whole box-shadow was invalid.The fix
themes/theme-builder.ts: a smallnest()helper turns the dotted keys into nested groups, so Panda defines the hyphenated names.index.cssandhero.tsxmove off the hard-coded escaped name.color-mix(... 20%, transparent)_layout.voting.tsx,_layout.agenda.($year).tsx,_layout.agenda.my.tsx,_layout.feedback.tsx: removecolorPalette="brand.primary|secondary". It stops type-checking oncebrandis nested, and was always a no-op: the button recipe readscolorPalette.solid.*, which brand never had, so the buttons inherited gray and still do.app/theme/token-references.test.tsfails on any colour/border/shadow var the generated CSS references but never defines, and on any dot-escaped token name.What was upstreamed vs left behind
index.css,hero.tsx, both stub themes,_layout.agenda.my.tsx,_layout.feedback.tsx_layout.agenda.($year).tsxand_layout.voting.tsx, which differ from the fork for unrelated reasonsconference/theme/perth*.theme.ts(the stub themes are their counterpart) and the fork's Perth-branded baselinesBaselines
Regenerated against the stub on top of #26 (
main's tree is identical to it) withpnpm vr --update-snapshots=all(several changes sit under the 2% tolerance). 54 of 63 changed; I reviewed before/after crops of each route:text.highlight(teal)border.sponsorframe (slate in the stub, which differs from its page background)Testing
main):tscclean, 737 unit tests pass (38 skipped, as on Upstream 5/5: feedback, talk dialog and a fixture conference year for e2e (dddperth #198–#203) #26), eslint clean;pnpm vrpasses on the new baselines, including the date-pin guard. The WebKit projects were re-run after timeouts.After this merges, dddperth's next
/core-pullshould apply cleanly, since its copy is identical.🤖 Generated with Claude Code