1.1.3 • Published 1 year ago

figma-tokens-transformer v1.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Ant for Figma tokens transformer

Tool transforming Ant Design for Figma tokens to less files.

Usage

  1. Add the dependency:

npm install figma-tokens-transformer --save-dev

  1. Create the configuration file using CLI wizard:

npx figma-tokens-transformer configure

Remember to add the generated secrets file to .gitignore as it contains sensitive data (license key, email).

  1. Run tokens transformation:

npx figma-tokens-transformer transform

You can also add the script to your package.json scripts:

"transform-tokens": "figma-tokens-transformer transform"

thanks to that you can call the script like so:

npm run transform-tokens

Configuration

It is recommended to configure the tool using the CLI wizard:

npx figma-tokens-transformer configure

However, it can be also done by hand - config files format is shown in the examples below.

tokens-transformer.config.json (Ant Design v4)

{
  "source": {
    "tokensFile": "src/tokens/tokens.json"
  },
  "target": {
    "lessDir": "src/less"
  }
}

tokens-transformer.config.json (Ant Design v5)

{
  "version": 5,
  "source": {
    "tokensFile": "src/tokens/tokens.json"
  },
  "target": {
    "jsonsDir": "src/ant-tokens"
  }
}

tokens-transformer.secret.json (do not commit this file!)

{
  "license": {
    "key": "6X2EF5E7-X96348A0-8871CEX3-A93XB7X9",
    "email": "test@example.com"
  }
}

CI

For continuous integration build purposes environment variables should be used to avoid keeping sensitive data (license) in the repository.

Available variables are:

  • SOURCE_FILE
  • TARGET_DIR
  • LICENSE_KEY
  • LICENSE_EMAIL
1.1.3

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.0

2 years ago

1.1.2

1 year ago

0.2.3

2 years ago

0.2.5

2 years ago

0.2.4

2 years ago

0.2.2

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.0

2 years ago