figma-token
v0.1.3
Published
Export Figma Variables to design token files.
Readme
figma-token
figma-token applies a Figma Plugin tokens.json export to a project directory.
Install
npm install -D figma-tokenThe Figma Plugin can download a ZIP or all six formats directly. Use this optional CLI when a project needs those files written to a predictable folder and checked for changes.
Apply Plugin Tokens
npx figma-tokenWithout an input path, the CLI reads ./tokens.json from the current project and creates the following files in ./figma-token-output/:
tokens.json
theme.ts
variables.css
tokens.scss
tailwind.css
tokens.dtcg.jsonChoose a project directory with --out:
npx figma-token --out ./src/tokens
npx figma-token ./figma-export.jsonPreview all generated files without writing anything:
npx figma-token --dry-runCheck whether generated files are current:
npx figma-token --check
npx figma-token --check --out ./src/tokens--check and --dry-run cannot be used together. The old check subcommand is not supported.
Advanced Sync
The hidden sync command retains the previous single-format, snapshot, and Figma REST API flow for advanced users. It accepts --input, --output, --snapshot, --format, --export-name, --figma-token, --file-key, and --dry-run.
For Plugin usage and project-wide documentation, see https://github.com/lee090626/Project-F.
