Repository navigation
fix: ensure Figma base scale output includes all tokens for override themes - #1355
Merged
Merged
Conversation
…themes Override themes (dark-dimmed, dark-high-contrast, light-high-contrast) inherit tokens from their parent theme. Previously, inherited tokens retained the parent's Figma collection name (e.g. base/color/dark instead of base/color/dark-dimmed), causing them to be missing from the override theme's collection in Figma output. Add collectionOverride support to the figmaAttributes transformer and pass collection mappings for each override theme in buildFigma.ts. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
🦋 Changeset detectedLatest commit: a642e86 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
Design Token Diff (Figma)The message is too long to be displayed here. For more details, please check the job summary. |
lukasoppermann
temporarily deployed
to
github-pages
April 20, 2026 08:05 — with
GitHub Actions
Inactive
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes Figma base scale exports for override themes by ensuring inherited tokens are emitted into the override theme’s Figma collection (instead of the parent collection).
Changes:
- Add
collectionOverridesupport to thefigmaAttributestransformer to remap collections based on platform options. - Pass
collectionOverridefor thedark-dimmed,dark-high-contrast, andlight-high-contrastbase scale builds inbuildFigma.ts. - Add unit tests covering
collectionOverridebehavior infigmaAttributes.
Show a summary per file
| File | Description |
|---|---|
src/transformers/figmaAttributes.ts |
Remaps collection (and default group) via optional collectionOverride map. |
src/transformers/figmaAttributes.test.ts |
Adds coverage for collection remapping + group preservation + mode selection. |
scripts/buildFigma.ts |
Supplies collectionOverride for affected base scale configs and passes it into the figma platform initializer. |
package-lock.json |
Updates package version metadata in the lockfile. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comments suppressed due to low confidence (1)
scripts/buildFigma.ts:44
collectionOverridemaps tobase/color/dark-high-contrast, but this base scale entry is nameddark-high-constrast(typo). This yields an inconsistent output filename vs collection name; consider renaming the base scalename/themetodark-high-contrast.
collectionOverride: {'base/color/dark': 'base/color/dark-high-contrast'},
- Files reviewed: 3/4 changed files
- Comments generated: 1
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Merged
This branch was successfully deployed
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.
Problem
Override themes (
dark-dimmed,dark-high-contrast,light-high-contrast) only define tokens that differ from their parent theme. For example,dark.dimmed.json5overridesblue,green,red, etc. but does not redefineneutral,black,inset, ortransparentsince they share the same values asdark.When building Figma base scale output, inherited tokens retained the parent's collection name (e.g.
base/color/darkinstead ofbase/color/dark-dimmed). This meant those tokens were missing from the override theme's Figma collection — they appeared under the parent collection instead.Affected themes and missing scales
dark-dimmedneutral,black,inset,transparent, display tokensdark-high-contrastneutral,white,inset,transparent, display tokenslight-high-contrastneutral,white,inset,transparent, display tokensSolution
Added
collectionOverridesupport to thefigmaAttributestransformer. When acollectionOverridemap is provided via platform options, any token whose collection matches a key in the map gets remapped to the corresponding value.In
buildFigma.ts, each override base scale entry now passes acollectionOverridethat maps the parent collection to the theme's own collection (e.g.{ 'base/color/dark': 'base/color/dark-dimmed' }).Changes
src/transformers/figmaAttributes.ts— AddedcollectionOverridelookup before returning collection/group attributesscripts/buildFigma.ts— AddedcollectionOverrideto the 3 affected base scale configs and passes it through to the figma platformsrc/transformers/figmaAttributes.test.ts— New test file covering the override behaviorValidation
figmaAttributes)