Skip to content

pavan15f/demo-design-token-generator

Repository files navigation

Design Token Android Generation - Demonstration

The required modules which you will need to have are

npm install
npm install -g style-dictionary
npm install token-transformer -g

In design/package.json, Alter the "scripts" as follows [on line.no 10]

For Linux and MacBook

  "scripts": {
    "build": "rm -rf build && token-transformer ./tokens/hds-token.json ./tokens/hds-token-transformer.json --resolveReferences=false && node ./build.js",
    "clean": "rm -rf build",
    "test": "echo \"Error: no test specified\" && exit 1"
  }

For Windows

"scripts": {
    "build": "del -f build && token-transformer ./tokens/hds-token.json ./tokens/hds-token-transformer.json --resolveReferences=false && node ./build.js",
    "clean": "del -f build",
    "test": "echo \"Error: no test specified\" && exit 1"
  }

Once the app the is initialized , run the following in the /design directory

npm run build 

Vary the config.json and build.js accordingly to generate your own custom tokens

The Expected Output is to be as follows Alt text

Please find the Docs of Style Dictionary, token-transformer
Style Dictionary - Documentation
Token Transformer - GitHub

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published