Commit
Author: Adam Argyle [atom@argyleink.com]
Hash: 327a70f82aa3aa6c553138ffd1572b3c4fd0ab18
Timestamp: Fri, 18 Aug 2023 04:14:04 +0000 (1 year ago)

+16 -16 +/-2 browse
fixes #392
1diff --git a/build/to-figmatokens.js b/build/to-figmatokens.js
2index 85c6350..a529428 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 }
43 diff --git a/build/to-tokens.js b/build/to-tokens.js
44index 1102752..65a5a1d 100644
45--- a/build/to-tokens.js
46+++ b/build/to-tokens.js
47 @@ -11,12 +11,12 @@ export const toTokens = props =>
48 .map(hueName => hueName.toLowerCase())
49 let isColor = colors.some(color => key.includes(color))
50
51- if (isLength) meta.type = 'dimension'
52- else if (isEasing) meta.type = 'cubic-bezier'
53- else if (isColor) meta.type = 'color'
54+ if (isLength) meta.$type = 'dimension'
55+ else if (isEasing) meta.$type = 'cubic-bezier'
56+ else if (isColor) meta.$type = 'color'
57
58 return [key, {
59- value: token,
60+ $value: token,
61 ...meta,
62 }]
63 })
64\ No newline at end of file