Commit
Author: Howard Chiam [hchiam@users.noreply.github.com]
Committer: GitHub [noreply@github.com] Sun, 07 Jan 2024 05:58:32 +0000
Hash: 2885ff1cc597acb6e41bc70be587645c99ebaa6b
Timestamp: Sun, 07 Jan 2024 05:58:32 +0000 (11 months ago)

+12 -12 +/-1 browse
undo part of 327a70f (#392) to fix #455 to make figma-tokens plugin work again (#456)
undo part of 327a70f (#392) to fix #455 to make figma-tokens plugin work again (#456)

1diff --git a/build/to-figmatokens.js b/build/to-figmatokens.js
2index a529428..85c6350 100644
3--- a/build/to-figmatokens.js
4+++ b/build/to-figmatokens.js
5 @@ -15,25 +15,25 @@ export const toFigmaTokens = props => {
6 .map(hueName => hueName.toLowerCase())
7 let isColor = colors.some(color => key.includes(color))
8
9- if (isLength) meta.$type = 'sizing'
10- else if (isBorder) meta.$type = 'borderWidth'
11- else if (isRadius) meta.$type = 'borderRadius'
12- else if (isShadow) meta.$type = 'boxShadow'
13- else if (isColor) meta.$type = 'color'
14- else meta.$type = 'other'
15+ if (isLength) meta.type = 'sizing'
16+ else if (isBorder) meta.type = 'borderWidth'
17+ else if (isRadius) meta.type = 'borderRadius'
18+ else if (isShadow) meta.type = 'boxShadow'
19+ else if (isColor) meta.type = 'color'
20+ else meta.type = 'other'
21
22- if (!(meta.$type in figmatokens)) figmatokens[meta.$type] = {}
23+ if (!(meta.type in figmatokens)) figmatokens[meta.type] = {}
24
25 if (isColor) {
26 let color = /--(.+?)-/.exec(key)[1]
27- if (!(color in figmatokens[meta.$type])) figmatokens[meta.$type][color] = {}
28- figmatokens[meta.$type][color][key] = {
29- $value: token,
30+ if (!(color in figmatokens[meta.type])) figmatokens[meta.type][color] = {}
31+ figmatokens[meta.type][color][key] = {
32+ value: token,
33 ...meta,
34 }
35 } else {
36- figmatokens[meta.$type][key] = {
37- $value: token,
38+ figmatokens[meta.type][key] = {
39+ value: token,
40 ...meta,
41 }
42 }