lukasoppermann / design-tokens

🎨 Figma plugin to export design tokens to json in an amazon style dictionary compatible format.
https://www.figma.com/community/plugin/888356646278934516/Design-Tokens
MIT License
964 stars 134 forks source link

Issue with exported JSON #271

Closed lunik2 closed 1 year ago

lunik2 commented 1 year ago

Hi! We're having an issue with the JSON structure when we export it and want to use it further in our designs. There is an object called "mode 1" that appears out of nowhere. the frustrating part is, it arbitrarily contains part of the tokens object and breaks up the hierarchy in an unfortunate way. Any way we can control this, or any idea why this happens? thanks!

Bildschirmfoto 2023-09-12 um 11 33 07 design-tokens.tokens_new.json.zip

caoimghgin commented 1 year ago

Might consider using modes in Figma variables rather than defining light/dark within a single mode?

andrewpucci commented 1 year ago

@lukasoppermann I believe that #273 and #274 are duplicates of this issue. I am also having this same problem.

To me, it looks like any variables that are referencing another variable get put into the redundant mode in the hierarchy. In my example below, all of these tokens should be in color.default.component.logo.company but there is one that references other variables that has another mode injected into the hierarchy for unknown reasons, which becomes color.default.default.component.logo.company.

image
lukasoppermann commented 1 year ago

This should be fixed thanks to @jonbrooks in the latest release, if so, please comment and close. 🙏