Releases: divriots/style-dictionary-to-figma
v0.4.0
Minor Changes
-
ab01a1e: BREAKING: if an upper token group does not have a tokenset property, it will get placed in a "global" tokenset by default. This means that no action is required by the user of the transformer to get a working JSON for Figma Tokens Plugin, but this change is potentially breaking because of how it changes the JSON output.
Before
{ "core": { "color": { "primary": { "base": { "type": "color", "value": "#14b8a6" }, "secondary": { "type": "color", "value": "#ff0000" } } } } }
Nothing is changed in the output. However, if you have references, they might be broken because the plugin will interpret this as
"color"
being the upper property in a tokenset called"core"
.After
{ "core": { "color": { "primary": { "base": { "type": "color", "value": "#14b8a6" }, "secondary": { "type": "color", "value": "#ff0000" } } } } }
turns into
{ "global": { "core": { "color": { "primary": { "base": { "type": "color", "value": "#14b8a6" }, "secondary": { "type": "color", "value": "#ff0000" } } } } } }
Your reference, for example
{core.color.primary.base}
will now work properly because"core"
is not interpreted as the tokenset,"global"
is.
Patch Changes
- ab01a1e: Fix clean-meta utility by using a proper isObject check which excludes arrays (values can be arrays).
v0.3.3
Patch Changes
-
2c9be59: Allow tokensets to be the same name as the upper most keys in the tokens object, e.g.:
{ "core": { "tokenset": "core", "color": { "value": "#ff0000", "type": "color" } } }
will become
{ "core": { "core": { "color": { "value": "#ff0000", "type": "color" } } } }
so that Figma Tokens plugin picks it up properly.
v0.3.2
v0.3.1
v0.3.0
Minor Changes
- b6cb742: BREAKING: do not restore original value if it was not a reference value. Before, it used to always restore, which unintentionally also restored style-dictionary transforms. For nested values, restore fully if any reference is found inside the nested value (object or array). If undesired, you can always use
ignoreUseRefValue
(see README) to fall back to keeping the fully resolved value. Currently, a hybrid solution that restores only the subparts of a value that is partially using references, is not available. Feel free to raise an issue if needed to explain your use case.
v0.2.1
v0.2.0
Minor Changes
-
00c39e3: BREAKING: no longer using default export, this is considered an anti-pattern for JS libraries. Re-export wildstars with default exports in ESM is one example quirk, another example is CommonJS not supporting default exports next to named exports in a single file. Now, the main export is a named export called "transform" and you have to import it as such.
Before:
// ESM import styleDictionaryToFigma from '@divriots/style-dictionary-to-figma'; // CommonJS const styleDictionaryToFigma = require('@divriots/style-dictionary-to-figma'); styleDictionaryToFigma({...}) // figma object
After:
// ESM import { transform } from '@divriots/style-dictionary-to-figma'; // CommonJS const { transform } = require('@divriots/style-dictionary-to-figma'); transform({...}) // figma object