| .. | ||
| .gitignore | ||
| build-tokens.mjs | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
token-gen
Generates Kotlin (Jetpack Compose) source files from design tokens defined in the ds-tokens git submodule.
Updating tokens
- Update the
ds-tokenssubmodule to the latest commit:git submodule update --remote core/ui/ds-tokens - Re-run the build:
cd core/ui/token-gen && npm run build - Commit both the submodule pointer and generated files.
How it works
The script uses Style Dictionary v5 with @tokens-studio/sd-transforms to read JSON token files from core/ui/ds-tokens/tokens/ and generate Kotlin files into core/ui/src/main/java/com/tangem/core/ui/res/generated/.
All generated files are written to com.tangem.core.ui.res.generated and should not be edited manually.