Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
aweell committed Oct 4, 2024
1 parent 373c9dc commit d648f8c
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions tokens/figma/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,38 +15,30 @@ This project is designed to update Figma variables based on a JSON input, primar
### Environment variables:

- `FIGMA_TOKEN`: The API token to authenticate with Figma.
- `MIDDLEWARE_KEY`: Token for file where the variables need to be created / updated
- `{BRAND}_FILE_KEY`: File key of each of the brand library files

### Dependencies:

- Node.js and packages such as `node-fetch`, `dotenv`, and `fs` are used to manage API requests, read local files, and load environment variables.

## Key functions

### `updateTheme(jsonData, brand, FILE_KEY)`
### `updateModeCollection(jsonData, brand)`

This function updates the theme variables in Figma for a specific brand. It:
This function updates the color-scheme variables in Figma for a specific brand. It:

- Fetches the current variables from Figma.
- Updates modes and variables for `"Light"` and `"Dark"` themes.
- Updates modes and variables for `"Light"` and `"Dark"` color-schemes.
- Sends a POST request to update Figma with the new data.

### `updateSkinColorVariables(brands, FILE_KEY)`
### `updateBrandCollection(jsonData)`

This function focuses on updating color variables in the "Brand" collection. It:

- Maps color variables from the "Mode" collection to the "Brand" collection.
- Adds non-color variables for each brand.
- Creates or updates modes for each brand.
- Ensures proper aliasing of variables between collections.

### `updateSkinOtherVariables(jsonData, brands, FILE_KEY)`

This function updates non-color variables, such as font families and icon sets, for each brand. It:

- Handles specific design tokens like radius, font weight, and line height.
- Adds brand-specific font families and icons.

## Usage

1. Navigate to the `tokens/figma` directory:
Expand Down

0 comments on commit d648f8c

Please sign in to comment.