Skip to content

Commit

Permalink
feat(sync)!: get Figma file ID from environment, removes fileId fie…
Browse files Browse the repository at this point in the history
…ld from yaml config (#7)
  • Loading branch information
samwyness committed Sep 26, 2023
1 parent ba37b1d commit ede2a92
Show file tree
Hide file tree
Showing 11 changed files with 156 additions and 101 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ _Before building tokens make sure your project is configured properly - see setu

### API Token

Create a `.env` file in your projects root directory and add your Figma API personal access token.
Create a `.env` file in your projects root directory and add your Figma API personal access token and Figma file ID.

```json
FIGMA_TOKEN="ABCDEFG1234567"
FIGMA_FILE_ID="ABCDEFGH12345678"
FIGMA_TOKEN="figd_ABCDEFGH12345678"
```

_For more info on how to generate Figma personal access tokens, you can [follow this guide](https://www.figma.com/developers/api#access-tokens)_
Expand All @@ -42,15 +43,13 @@ You can run `npx skits-tokens init` and provide the requested details to generat

| Option | Description | Default |
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- |
| `fileId` | Thie figma file that contains your tokens - You can copy the file's ID from your browser's address bar | - |
| `outputFileName` | The name of the json file where the tokens should be generated - e.g the default value will create `tokens.json` file | `tokens` |
| `outputTransform` | When generating the tokens file, you can choose how you want the tokens to be transformed (examples coming soon). Available options are - `'flat', 'group', 'array'` | `flat` |
| `tokenFrames` | A list of tokens frames that can be found in your Figma file. Currently supported token frames are - `'colors', 'typography', 'spacing'` | - |

e.g.

```yml
fileId: <FIGMA_FILE_ID>
outputFilename: tokens
outputTransform: group
tokenFrames:
Expand Down
Loading

0 comments on commit ede2a92

Please sign in to comment.