figma-tokens-flattener 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -7
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -10,14 +10,16 @@ A tool for transforming Ant Design tokens from Tokens Studio for Figma (Single f
|
|
|
10
10
|
|
|
11
11
|
Create a figma-tokens-flattener-config.json file in your project root:
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
```
|
|
14
|
+
{
|
|
14
15
|
"source": {
|
|
15
|
-
"tokensFile": "src/tokens/tokens.json"
|
|
16
|
+
"tokensFile": "src/tokens/tokens.json" // path to the token file
|
|
16
17
|
},
|
|
17
18
|
"target": {
|
|
18
|
-
"jsonsDir": "src/tokens"
|
|
19
|
+
"jsonsDir": "src/tokens" // path for the created files
|
|
19
20
|
}
|
|
20
|
-
}
|
|
21
|
+
}
|
|
22
|
+
```
|
|
21
23
|
|
|
22
24
|
## Run Transformation
|
|
23
25
|
|
|
@@ -27,15 +29,17 @@ Create a figma-tokens-flattener-config.json file in your project root:
|
|
|
27
29
|
|
|
28
30
|
Add a script to your package.json:
|
|
29
31
|
|
|
30
|
-
|
|
32
|
+
```
|
|
33
|
+
{
|
|
31
34
|
"scripts": {
|
|
32
35
|
"flatten-tokens": "simple-token-transformer flatten"
|
|
33
36
|
}
|
|
34
|
-
}
|
|
37
|
+
}
|
|
38
|
+
```
|
|
35
39
|
|
|
36
40
|
And run with:
|
|
37
41
|
|
|
38
|
-
|
|
42
|
+
`npm run flatten-tokens`
|
|
39
43
|
|
|
40
44
|
## How It Works
|
|
41
45
|
|
|
@@ -48,6 +52,7 @@ And run with:
|
|
|
48
52
|
4. Result Saving - Creates separate JSON files for each theme
|
|
49
53
|
|
|
50
54
|
## Output
|
|
55
|
+
|
|
51
56
|
After running the command, the following files will be created in the target directory:
|
|
52
57
|
|
|
53
58
|
light-theme-tokens.json - tokens for light theme
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "figma-tokens-flattener",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "A tool for transforming Ant Design tokens from Tokens Studio for Figma (Single file) into flat style mappings for light and dark themes.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
8
8
|
},
|
|
9
|
-
"keywords": [],
|
|
9
|
+
"keywords": ["figma", "design-tokens", "tokens", "json", "flattener", "transformer", "parser"],
|
|
10
10
|
"author": "Yurii Sudarskii",
|
|
11
11
|
"license": "ISC"
|
|
12
12
|
}
|