/tokens-figma-node

Clone tokens from Figma to a JSON file, then parse to CSS files

Primary LanguageJavaScript

Why I created this project?

I want to have a parser to get design tokens from Figma. I caught the code to parse the code from Figma from Design Tokens with Figmna (the code's author knows).

Then I caught this Object then copied to output/tokens.json. After it, I parsed the code to separated CSS files with the CSS variables for each Design Token.

With that, I can easily update de CSS variables to SASS, CSS and styled-components. In that way, I can easily update my design tokens on my project.

How to use

Today I don't have a NodeJS CLI, so you should go to index.js replace figmaApiKey with your personal Figma key and the figmaId from your Id file Figma.

You can see an example of a Figma project here.