fix(design-tokens): neutral assignable via cascade, prune unused families, strip source CSS (#1619 #1620 #1603)#1621
Merged
Conversation
…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>
…x in CSS strip" This reverts commit 4dc8b71.
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>
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.
Summary
Three fixes for the init --rebuild clobber bug:
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.
Tailwind exporter only emits color families referenced by semantic tokens. Unmapped defaults no longer appear in the output.
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.