Closed six7 closed 1 week ago
Latest commit: e6bc8134a58a6aaf128f32ab26a8450534626a3a
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
Closes https://github.com/tokens-studio/figma-plugin/issues/2906
When we're creating variables, we currently use themes that are active to inform what variables should be used as references. However, if those theme groups aren't active, we won't know what variable references to use for tokens and will fall back to raw hex values inside variables. Especially in multi-file setup users sometimes only enable one theme group, meaning they won't have the necessary references available.
What does this pull request do?
Changes the logic to add another set of themes to the merge function, so that the references from the current theme group have preference, but after that we'll take into account other themes.
Note that this is kind of flawed as we will pick the first available variable reference that we find. However, I'd say it's OK enough, given:
Before:
After:
Testing this change
With this change, the references correctly map. Before, they used hex values.