fix(themes): read heritage light/dark from canon instead of deriving both from one seed - #131
Open
bryanfawcett wants to merge 1 commit into
Open
fix(themes): read heritage light/dark from canon instead of deriving both from one seed#131bryanfawcett wants to merge 1 commit into
bryanfawcett wants to merge 1 commit into
Conversation
…both from one seed `heritage()` took a single hex and synthesised the dark accent from it (`color-mix(hex 62%, white)`), on the stated premise that "mzizi's heritage records ship only the hex". That premise is false: heritage records ship both `lightHex` and `darkHex` (mzizi-registry/lib/tokens/palette.source.ts, also visible on GET /v1/brand). Deriving both modes from one seed made all fourteen heritage values wrong — 7 families x 2 modes — and, being a derivation rather than a constant, wrong again on every regeneration. The function now takes the canonical pair and each mode uses its own accent. The comment that carried the false premise is corrected, since it is the reason the bug survived. Only the light/dark derivation was wrong. The wash/container mixing is unchanged: the container is still mixed from the mode's accent into the active surface (~8% light / ~14% dark) and the on-container is still solved to an AAA-safe foreground, keeping the wash surface-relative. globals.css carried the same pre-Seven, Material-derived values as static tokens (`#1A237E` Indigo 900, `#A5D6A7` Green 200, `#80DEEA` Cyan 200) and was missing hematite and kalahari entirely — the two families added when heritage expanded to seven. Both blocks are now canon and complete, and the two new families are exposed as Tailwind colour tokens alongside the other five. Deliberately unchanged: `--on-container-sodalite: #1A237E`. That is Material Indigo 900 in a sodalite on-container role, not heritage-indigo. Verified: all 14 heritage accents now equal canon in both modes. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
github-merge-queue
Bot
removed this pull request from the merge queue due to Branch Protection failures
Sep 11, 2026
You're not authorized to push to this branch. Visit "About protected branches" for more information.
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.
The defect
src/lib/themes.tsdocumented its own bug:The premise is false. Heritage records ship both
lightHexanddarkHex— seemzizi-registry/lib/tokens/palette.source.ts(the source of truth on disk), the same pair returned byGET /v1/brand.heritage()took one hex and synthesised the dark accent from it (color-mix(hex 62%, white)), so all 14 heritage values were wrong (7 families x 2 modes) — and, being a derivation rather than a constant, wrong again on every regeneration.The fix
heritage(name, lightHex, darkHex)— each mode takes its accent straight from canon. The comment carrying the false premise is corrected, since it is why the bug survived.Only the light/dark derivation was wrong. The wash/container mixing is preserved exactly: the container is still mixed from the mode's accent into the active surface (~8% light / ~14% dark), the on-container is still solved to an AAA-safe foreground, and the wash stays surface-relative via
color-mix.globals.css
Carried the same pre-Seven, Material-derived values as static tokens (
#1A237E= Indigo 900,#A5D6A7= Green 200,#80DEEA= Cyan 200), and was missinghematiteandkalaharientirely — the two families added when heritage expanded to seven. Both blocks are now canon and complete, with the two new families exposed as Tailwind colour tokens alongside the other five.#1A237E/#8C9EFF#4527A0/#7986CB#5D4037/#FFCC80#8D6E1A/#E5C158#2E4A2E/#A5D6A7#4E342E/#A1887F#8B2500/#FF8A80#D84315/#FF7043#00525A/#80DEEA#006064/#4DD0E1#546E7A/#90A4AE#C9B589/#E8D9B5Verified, not changed
--on-container-sodalite: #1A237Eis left alone. It is Material Indigo 900 in a sodalite on-container role, not heritage-indigo — it matched the grep but is not this bug.Verification
All 14 heritage accents now equal canon in both modes:
Wash mechanism intact (
riverlight):color-mix(in srgb, #006064 8%, var(--surface)). Theme count still 15 (1 default + 7 heritage + 7 experimental), satisfyingthemes.test.ts.🤖 Generated with Claude Code