Skip to content

mbrookes/design-token-transformer

 
 

Repository files navigation

Design Token Transformer

This package is supposed to be used together with Design Token plugin for Figma. It transforms the exported design tokens using Amazon style directory.

Installation

1. Download or clone the repo to your computer

You can download this package or clone it via teh terminal.

git clone https://github.com/lukasoppermann/design-token-transformer.git

2. Install dependencies

  1. From within the terminal cd (navigate) this folder.
  2. Run npm i to install the dependencies

Usage

Local transformation

To use an exported json file and transform it locally on your machine, follow the 3 steps below:

  1. Save the .json file you exported using the Design Token plugin to the tokens folder (and remove the example files).
  2. In the terminal cd (navigate) to this folder
  3. Run npm run transform-tokens
  4. 🎉 Your converted tokens should be in the build folder.

Transformation in github repository

  1. Fork this repository
  2. Adapt the transform-tokens script in the package.json
  3. Adapt the github workflow
  4. Create a personal access token
  5. Add the push to server settings & your access token in Figma
  6. Run the Send Design Tokens to Url command from the plugin
  7. 🎉 You should be able to see the action running in your github repo and have all the converted files in the build folder once it is done.

Personal access token

The access token should be specifically for this plugin and only have the minimal permissions needed:

  • only public_repo is needed for a publis repository

The token is not stored with the Figma file but only locally on your machine.

You can find more information about creating personal access tokens in the docs.

Custom dev server

If you want to set up your custom server that response to a push from this plugin, check out the setup for github and adapt it to your needs. If you run into problems, please create an issues in the main Design Token plugin for Figma repository.

Customization

To customize the output please view the Amazon style directory documentation

Bugs, issues & feature requests

If you have issues concerning the Design Token plugin for Figma please create an issue the plugin repo.

Only create an issue in this repository if you have an issue with this transformation package.

About

Base repo to transform json design tokens from the figma design token plugin via amazon style directory.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 33.0%
  • Objective-C 21.5%
  • CSS 15.9%
  • Less 14.8%
  • SCSS 14.8%