Skip to content

Commit

Permalink
allow for old token reference syntax when embedded inside a string va…
Browse files Browse the repository at this point in the history
…lue (#30)
  • Loading branch information
josefie authored Oct 25, 2022
1 parent fe49a73 commit 46aae71
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion config/style-dictionary/parsers.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ StyleDictionary.registerParser({
// replace the old reference syntax with the one style-dictionary understands
// e.g. "$fontFamilies.fira-sans" -> "{fontFamilies.fira-sans}"
// see https://docs.tokens.studio/tokens/aliases
const tokens = JSON.parse(contents.replace(/\$([^"]+)/g, `{$1}`))
const tokens = JSON.parse(contents.replace(/\$([^"\s]+)/g, `{$1}`))

// strip away the global key for global token set but keep the themes nested
// this is necessary, because the references from Figma Tokens do not include the token set key
Expand Down

0 comments on commit 46aae71

Please sign in to comment.