Closed cailborg closed 10 months ago
@cailborg looks like it's a "nesting" issue. I'll try to reproduce this schema on my side
@cailborg that's odd. Can't reproduce this bug. I recreated the same structure (see the image below).
These missing color values are alias
values?
If it's okay for you, we can plan a call and check this issue together. Feel free to write me to pavellaptev.figma@gmail.com
One difference is I don't have a "value" column in my variables table - i'm setting up modes for light and dark
Oh and maybe the fact that they are aliased from another set of variables?
Hm… renaming the Value
title and add alias
variables didn't show the bug.
But might be there is a bug in the method how I check if the value is alias
.
Can you please test this version? (see attachment)
This is how you can add a custom plugin in Figma. Go to plugins » development » click on the plus button » add from manifest
Development version didn't change any outputs - are you using resolveForConsumer
in the Figma API to resolve aliases?
https://www.figma.com/plugin-docs/api/Variable#resolveforconsumer
I have discovered the source of the bug - aliases only work where base
is a new collection in the same file.
I was originally aliasing tokens from a variable collection in a different file (as I don't want people applying the base tokens to designs)
@cailborg thanks for investigating this. Will try to fix this today
@cailborg I published a new plugin version 1.2.0 Can you try it out?
The plugin will generate an alias name anyway, but it will be a path to the variable as if it was in the current file.
{
"button": {
"background": {
"type": "color",
"value": "{colors.light.primary.10}"
}
}
}
The plugin wouldn't include the variable into the generated JSON in order to avoid duplicates or conflicts with JSON files you can generate from another Figma files.
So you will need to merge the file with the base variables with another where you use them. Otherwise tools like Style Dictionary wouldn't be able to resolve the aliases.
Working perfectly, thanks!
When i run the plugin the schema generates fine - but there is no "value" key for the color tokens
Other tokens (e.g space) work fine