Skip to content

Commit

Permalink
undo part of 327a70f (#392) to fix #455 to make figma-tokens plugin w…
Browse files Browse the repository at this point in the history
…ork again (#456)
  • Loading branch information
hchiam authored Jan 7, 2024
1 parent 0b38df4 commit 2885ff1
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions build/to-figmatokens.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,25 @@ export const toFigmaTokens = props => {
.map(hueName => hueName.toLowerCase())
let isColor = colors.some(color => key.includes(color))

if (isLength) meta.$type = 'sizing'
else if (isBorder) meta.$type = 'borderWidth'
else if (isRadius) meta.$type = 'borderRadius'
else if (isShadow) meta.$type = 'boxShadow'
else if (isColor) meta.$type = 'color'
else meta.$type = 'other'
if (isLength) meta.type = 'sizing'
else if (isBorder) meta.type = 'borderWidth'
else if (isRadius) meta.type = 'borderRadius'
else if (isShadow) meta.type = 'boxShadow'
else if (isColor) meta.type = 'color'
else meta.type = 'other'

if (!(meta.$type in figmatokens)) figmatokens[meta.$type] = {}
if (!(meta.type in figmatokens)) figmatokens[meta.type] = {}

if (isColor) {
let color = /--(.+?)-/.exec(key)[1]
if (!(color in figmatokens[meta.$type])) figmatokens[meta.$type][color] = {}
figmatokens[meta.$type][color][key] = {
$value: token,
if (!(color in figmatokens[meta.type])) figmatokens[meta.type][color] = {}
figmatokens[meta.type][color][key] = {
value: token,
...meta,
}
} else {
figmatokens[meta.$type][key] = {
$value: token,
figmatokens[meta.type][key] = {
value: token,
...meta,
}
}
Expand Down

0 comments on commit 2885ff1

Please sign in to comment.