Rebuild the color system around palette, chromatic, and mode utilities#133
Merged
Conversation
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 color system stacks three overlapping mechanisms: Panda's built-in
colorPalettevariable indirection, an@scopelayer that re-declares every semantic alias on every element of a palette subtree, and a[data-chromatic]token-condition block. Parts of it are silently broken:colorPaletteinside recipes never resolves, and chromaticity can't be un-set below a chromatic ancestor.Replaces all of it with a single engine modeled on barnsworthburning's triptych system. Each semantic color token becomes one formula,
color-mix(in oklch, <neutral>, <chromatic> var(--chroma)), over inherited ramp aliases, and three typed utilities set the theme axes anywhere in the tree:palettealiases a chromatic hue ramp and its associated neutral ramp to--clr-*/--neu-*chromaticflips--chromabetween 100% and 0%modesetscolor-scheme, which everylight-dark()pair resolves against per elementEach boundary re-declares the token formulas so its subtree re-resolves against the new context, and a base-layer rule re-asserts
color: primaryon boundary elements so plain inherited text adapts while explicit colors, recipe or atomic, still win the cascade. Consumers are untouched:color: 'primary'works as before, and only boundary-setting call sites migrate. Also fixes border tokens baking at:rootand ignoring theme boundaries, and drops the unused sage, teal, gray, and brown hue scales.