Skip to content
On this page

Anima Token Transformers

Anima DSA, also provides a two-way transformation of your design tokens. So if you use a framework like TailwindCSS or Ant Design, you can transform your design tokens to the format that is compatible with those frameworks.

To generate design tokens from your framework config file, first install the Anima CLI,

sh
npm add -D @animaapp/anima-cli
sh
yarn add -D @animaapp/anima-cli
sh
pnpm add -D @animaapp/anima-cli

Then run the following command:

sh
anima generate-tokens --framework <framework-name> --config <path-to-config-file>

Where <framework-name> is the name of the framework you are using and <path-to-config-file> is the path to your framework config file.

Check TailwindCSS, or Ant Design v5 examples for more details.

Commads

OptionsShortDescriptionType
--framework    -fProvide your framework name i.e. tailwindstring
--config-cProvide your framework config file i.e. ./tailwind.config.cjsstring
--output-oProvide an output path of your design tokens file, i.e. ./design-tokens.jsonstring

To transform design tokens JSON into a framework's theme

We provide a package named @animaapp/framework-helpers that you can use to transform the design tokens JSON into a theme object.

Install the package in your project, using your package manager of choice:

sh
npm add -D @animaapp/framework-helpers
sh
yarn add -D @animaapp/framework-helpers
sh
pnpm add -D @animaapp/framework-helpers

How to use

Check our detailed guides for each framework:

TailwindCSS

Ant Design v5