Skip to content

Rebuild the color system around palette, chromatic, and mode utilities#133

Merged
Aias merged 1 commit into
mainfrom
trombley/panda-color-system
Jul 2, 2026
Merged

Rebuild the color system around palette, chromatic, and mode utilities#133
Aias merged 1 commit into
mainfrom
trombley/panda-color-system

Conversation

@Aias

@Aias Aias commented Jul 2, 2026

Copy link
Copy Markdown
Owner

The color system stacks three overlapping mechanisms: Panda's built-in colorPalette variable indirection, an @scope layer 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: colorPalette inside 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:

  • palette aliases a chromatic hue ramp and its associated neutral ramp to --clr-* / --neu-*
  • chromatic flips --chroma between 100% and 0%
  • mode sets color-scheme, which every light-dark() pair resolves against per element

Each boundary re-declares the token formulas so its subtree re-resolves against the new context, and a base-layer rule re-asserts color: primary on 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 :root and ignoring theme boundaries, and drops the unused sage, teal, gray, and brown hue scales.

@Aias Aias marked this pull request as ready for review July 2, 2026 10:37
@Aias Aias merged commit 83f8618 into main Jul 2, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant