Skip to content

fix(figma): resolve optional dark colors independently - #49

Merged
DavidBabinec merged 1 commit into
mainfrom
fix/figma-raw-color-sync
Oct 27, 2026
Merged

DavidBabinec merged 1 commit into
mainfrom
fix/figma-raw-color-sync

Conversation

@DavidBabinec

Copy link
Copy Markdown
Contributor

Fixes #48

The bug

Saving a RAW color reference without a dark value crashed while preparing Figma variables. Dark colors also used the light value's format check, so mixed literal and referenced colors could be missing or incorrect.

The fix

Resolve dark values only when present and enabled, independently of the light value. Dark references use the source's dark color when available.

Verification

Nine export regressions cover missing dark values, transparency, and mixed light/dark formats. Six fail against the original source and all pass with the fix.

Figma tests: 43 passed
Web tests: 206 passed
Web and Figma production builds: passed
Biome check on changed TypeScript: passed

Notes

Figma Desktop was not exercised; validation covers variable preparation and the existing mocked host tests.

RAW references without dark values crashed variable preparation before the host could save them. Resolve an enabled dark value on its own and use the referenced dark color when available.
@DavidBabinec
DavidBabinec marked this pull request as ready for review October 27, 2026 10:14
@DavidBabinec
DavidBabinec merged commit 3f1eed1 into main Oct 27, 2026
8 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.

[Bug]: Figma sync silently fails when a color references another color via var() and has no darkValue

1 participant