Skip to content

fix: skip remote variable collections when matching by name#266

Open
phiilu wants to merge 1 commit intoRedMadRobot:masterfrom
phiilu:fix/skip-remote-variable-collections
Open

fix: skip remote variable collections when matching by name#266
phiilu wants to merge 1 commit intoRedMadRobot:masterfrom
phiilu:fix/skip-remote-variable-collections

Conversation

@phiilu
Copy link
Copy Markdown

@phiilu phiilu commented Mar 10, 2026

When using variablesColors, the Figma REST API (GET /v1/files/:id/variables/local) returns both local and remote (library-subscribed) variable collections.

If a remote collection shares the same name as a local one, .first(where:) may match the remote collection instead, which in my org contains fewer variables, leading to silently missing colors in the export.

Fix: Decode the remote field from the API response on VariableCollectionValue and filter it out during collection lookup:

The remote field is documented by Figma (https://developers.figma.com/docs/rest-api/variables-types/#variablecollection-type) as:

Whether the variable collection is remote.

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