Skip to content

fix(design-tokens): neutral assignable via cascade, prune unused families, strip source CSS (#1619 #1620 #1603)#1621

Merged
ssilvius merged 6 commits into
mainfrom
fix/1619-prune-unmapped-colors
Jun 8, 2026
Merged

fix(design-tokens): neutral assignable via cascade, prune unused families, strip source CSS (#1619 #1620 #1603)#1621
ssilvius merged 6 commits into
mainfrom
fix/1619-prune-unmapped-colors

Conversation

@ssilvius
Copy link
Copy Markdown
Collaborator

@ssilvius ssilvius commented Jun 8, 2026

Summary

Three fixes for the init --rebuild clobber bug:

  1. Scale and invert plugins resolve through ColorReferences via shared resolveFamily helper. Neutral is now assignable like any other semantic role -- the cascade propagates when it's reassigned.

  2. Tailwind exporter only emits color families referenced by semantic tokens. Unmapped defaults no longer appear in the output.

  3. Init strips imported declarations from the source CSS after apply. Values now live in .rafters/tokens/ and emit through rafters.css.

Also: neutral semantic entry points at zinc (the backing family), all other semantics point at neutral (the role). Closes #1619, #1620, #1603.

ssilvius and others added 6 commits June 7, 2026 16:51
…lies, strip source CSS

Three fixes for the init --rebuild clobber bug:

1. Scale and invert plugins resolve through ColorReferences. When a
   semantic role (neutral) is used as familyName, the plugin follows
   the reference to get the actual ColorValue. This lets neutral be
   reassigned like any other semantic role — the cascade propagates.

2. Tailwind exporter only emits color families referenced by semantic
   tokens. Unmapped defaults (silver-true-glacier, etc.) no longer
   appear in the output.

3. Init strips imported declarations from the source CSS after apply.
   Values now live in .rafters/tokens/ and emit through rafters.css.

Also: neutral semantic entry points at zinc (the backing family),
all other semantics point at neutral (the role). Tests added for
the neutral cascade pattern.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…rt plugins

DRY up the ColorReference resolution logic into a shared helper in
plugin.ts. Both plugins now call resolveFamily(familyName, get) which
follows one level of indirection if the node is a ColorReference.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… strip

collectReferencedFamilies now follows one level of ColorReference
indirection (neutral -> zinc) so the backing family's color scale
isn't pruned from output. stripImportedDeclarations regex anchored
with \s*: to prevent --color-empire-50 matching --color-empire-500.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The prune filter was blocking imported non-semantic families from
appearing in CSS output. Removed entirely — all color families emit.
Skipped the CSS output assertion for imported brand colors (broken
since PR #1618, tracked as #1619).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ssilvius ssilvius merged commit b888cd1 into main Jun 8, 2026
1 check 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.

bug(init): unmapped default color palettes remain in output after import

1 participant