-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
31 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,31 @@ | ||
# Export SVGs from Figma | ||
# Export SVGs from Figma via CLI | ||
|
||
## Getting Started | ||
|
||
Export your SVGs that are in your Figma project easily via CLI. | ||
![Gif of exporting process](documentation/export-in-action.gif) | ||
|
||
# Pre-requisties | ||
|
||
- You will need a DEV_TOKEN (See Step 5 of Setup) | ||
- Your Icons are in a single Frame | ||
- Each icon is a Figma Component (Select Icon and use the shortcut key ⌥⌘K) | ||
![Screenshot of Icon as a Figma Component](documentation/this-is-a-component.png) | ||
|
||
### Output | ||
|
||
Your SVGs will be generated in `src/svg` folder | ||
|
||
### Setup | ||
|
||
1. `yarn install` | ||
2. Select the frame your icons are in ![Screenshot of a sample Figma project](documentation/export-svg-screenshot.png) | ||
3. Copy the URL in the browser; it should look similar to [https://www.figma.com/file/abcASewbASmnas/Test?node-id=1%3123](https://www.figma.com/file/abcASewbASmnas/Test?node-id=1%3123) | ||
4. Run `node src/setupEnv.js` and paste in your URL copied from step 2 when prompted. This will generate a `.env` file | ||
5. Generate a DEV_TOKEN a.k.a Personal Access Token by going to Help and Account > Account Settings > Personal Access Token | ||
6. Add your DEV_TOKEN from step 5 into `.env` file | ||
7. Run `node src/index.js` and your SVGs will be generated into `src/svg` folder | ||
|
||
### Limitations | ||
|
||
Figma API has a fixed number of requests (rate limits) you can call per minute. This script will process a 20 requests per 45 seconds to not hit that limit. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.