fix: give a darkHue-only color its own hue var in both schemes - #87
Merged
Conversation
A color that authored only `darkHue` referenced the theme's `--{name}-hue`
var in both schemes, so the `--{color}-hue` declaration emitted in the dark
block was never read and the dark hue was silently dropped from `splitHue`
exports. A color that authors a hue in either scheme now gets its own hue
custom property in both, tracking the theme hue in the scheme it did not
author, so the shared `var()` reference stays valid and runtime re-skinning
keeps working. Covers `css({ splitHue: true })` and the Tasty token map.
Also correct the `tone: 'max'` / `'min'` with a `base` docs: high-contrast
variants are not exempt from the light-shift replay. They follow the same
rule, and because their window is already the full range the replay
reproduces the plain mapping unless the base itself sits asymmetrically
across schemes. Behavior unchanged — `extremeDarkTone` already read the
dark base variant, so dropping its redundant `baseDarkTone` parameter and
folding the extreme's tone clamp into the solve literal are cleanups.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
📦 Snapshot releasePublished |
Merged
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.
Follow-up fixes that were left uncommitted when #84 (
darkHue/darkSaturation) and #82 (extreme tone with abase) were merged. Re-applied on top of currentmain— the original changesets were already consumed by the version-packages PRs, so this ships its ownpatchchangeset.The bug
A color that authored only
darkHue(no lighthue) got the theme's--{name}-huevar as itsvar()reference in both schemes. The per-color--{color}-huedeclaration was still emitted in the dark block — but nothing read it, so the dark hue was silently dropped.Before, dark got
--surface-hue: 90;next to a--surface-colorthat still interpolatedvar(--brand-hue).A color that authors a hue in either scheme now gets its own hue custom property in both, tracking the theme hue (
--surface-hue: var(--brand-hue)) in the scheme it did not author — so the shared reference stays valid and runtime re-skinning still works. Applies tocss({ splitHue: true })and the Tasty token map alike;darkHueDeclarationsbecomesbuildHueDeclarations, returning both schemes so the two sides can't drift apart again.Colors that author a light
hueare unaffected — they already got their own var in both schemes.Docs correction
docs/api.mdclaimed high-contrast variants were exempt from the extreme-tone light-shift replay because "their window is already the full range". They aren't exempt — they follow the same rule; the full-range window just means the replay usually reproduces the plain mapping, and only diverges when the base itself sits asymmetrically across schemes (amode: 'fixed'or contrast-solved base). Added a test pinning that divergence, plus assertions locking the exact tone valuesdocs/api.mdcites.No behavior change in the resolver
extremeDarkTonewas already only called withisDark === true, wherebaseTonewas the dark variant's tone — so dropping the redundantbaseDarkToneparameter, moving the extreme branch inside the absolute/extreme arm, and folding the extreme's tone clamp into thesolveliteral are all cleanups. Verified: reverting the source fixes leaves only the newsplitHuetest failing.Checks
pnpm test(353 passed),pnpm run typecheck,pnpm run lint,pnpm run format:check— all clean.🤖 Generated with Claude Code