Skip to content

Commit a3fd51f

Browse files
authored
Merge pull request #5 from atropical/feat/export-to-js
feat: export to JS
2 parents add6a95 + 74fa864 commit a3fd51f

9 files changed

Lines changed: 1116 additions & 1850 deletions

File tree

.figma/publishing-info.txt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
TAGLINE:
2-
Export Figma Variables to JSON and CSV
2+
Export Figma Variables to JSON, JS, CSV and CSS.
33

44
DESCRIPTION:
5-
VarVar is a Figma plugin that allows you to export your Figma variables to JSON, CSV or CSS formats, making it easier to integrate your design tokens into your development workflow.
5+
VarVar is a Figma plugin that allows you to export your Figma variables to JSON, JS, CSV or CSS formats, making it easier to integrate your design tokens into your development workflow.
66

77
Features
8-
Export Figma variables to JSON, CSV or CSS formats
8+
Export Figma variables to JSON, JS, CSV or CSS formats
99
Identifies linked variables
1010
JSON: linked variables start with $.VARIABLE.PATH
11+
JS: linked variables start with VARIABLE.PATH (without quotes)
1112
CSV: linked variables start with =VARIABLE/PATH
1213
CSS: linked variables will call CSS function var(--VARIABLE)
1314
Preview exported data within the plugin interface
@@ -17,15 +18,15 @@ Usage
1718
Design Mode
1819
Open your Figma file containing variables
1920
Run the VarVar plugin from the Plugins menu
20-
Choose your desired export format (JSON, CSV or CSS)
21+
Choose your desired export format (JSON, JS, CSV or CSS)
2122
Click "Export Variables"
2223
The exported file will be automatically downloaded
2324

2425
Dev Mode
2526
Open your Figma file containing variables
2627
Switch to Dev Mode
2728
Run the VarVar plugin from the Plugins menu
28-
Choose your desired export format (JSON, CSV or CSS)
29+
Choose your desired export format (JSON, JS, CSV or CSS)
2930
Click "Export Variables"
3031
The exported file will be automatically downloaded
3132

README.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,18 @@ VarVar is a Figma plugin that allows you to export your Figma variables to JSON,
44

55
## Features
66

7-
- Export Figma variables to JSON, CSV or CSS formats
7+
- Export Figma variables to JSON, CSV, CSS or JS formats
88
- Identifies linked variables*
99
- JSON: linked variables start with `$.VARIABLE.PATH`
10+
- JS: linked variables are referenced directly like `collection.mode.variable`
11+
- Numeric paths are converted to bracket notation: `collection.mode["500"]`
1012
- CSV: linked variables start with `=VARIABLE/PATH`
11-
- **Option:** *Use row & column positions.* This will produce instead a "formula-like" (i.e. `=E7`) linking in spreadsheet programs.
13+
- **Option:** *Use row & column positions.<sup>*</sup> This will produce instead a "formula-like" (i.e. `=E7`) linking in spreadsheet programs.
1214
- CSS: linked variables will be linked like so `--var-name: var(--VARIABLE)`
1315
- Preview exported data within the plugin interface
1416
- Automatically download exported files
1517

16-
*Note: When dealing with linked variables that have multiple modes, the plugin will only link to the first occurrence (i.e., the first mode).
18+
<sup>*</sup> When dealing with linked variables that have multiple modes, the plugin will only link to the first occurrence (i.e., the first mode).
1719

1820
## Figma Installation
1921

@@ -25,21 +27,23 @@ VarVar is a Figma plugin that allows you to export your Figma variables to JSON,
2527
### Design Mode
2628
1. Open your Figma file containing variables
2729
2. Run the VarVar plugin from the Plugins menu
28-
3. Choose your desired export format (JSON, CSV or CSS)
30+
3. Choose your desired export format (JSON, JS, CSV or CSS)
2931
4. Click "Export Variables"
3032
5. The exported file will be automatically downloaded
3133

3234
### Dev Mode
3335
1. Open your Figma file containing variables
3436
2. Run the VarVar plugin from the Plugins menu
35-
3. Choose your desired export format (JSON, CSV or CSS)
37+
3. Choose your desired export format (JSON, JS, CSV or CSS)
3638
4. Click "Export Variables"
3739
5. The exported file will be automatically downloaded
3840

3941
### Preview and Copy
4042

4143
- Toggle the "Preview output" switch to see the exported data within the plugin interface
42-
- Use the "Select all" button and copy (Ctrl/Cmd + C) the exported data to your clipboard
44+
- Use the "Select all" button and copy<sup>†</sup> (Ctrl/Cmd + C) the exported data to your clipboard
45+
46+
<sup>†</sup> Programmatically copying is currently not supported by Figma Plugin APIs.
4347

4448
## Development
4549

0 commit comments

Comments
 (0)