CLI
You can generate types of tokens for customized themes such as colors and font sizes using Yamada CLI.
The CLI reads the customized theme and generates token types in node_modules/@yamada-ui/core/dist/generated-theme.types.d.ts
.
Installation
Run either of the following commands in the terminal.
pnpm add --save-dev @yamada-ui/cli
Add a script to package.json
and specify the location of the customized theme in the script.
package.json
{..."scripts" : {..."theme" : "yamada-cli tokens path/to/theme.ts","theme:watch" : "yamada-cli tokens path/to/theme.ts --watch",} 、...}
Don't forget to replace path/to/theme.ts
.
Some package managers like pnpm
may not find the output destination due to symbolic links, etc. In that case, use the --out
option of the CLI to specify the output destination.
Usage
To generate the type of theme, execute any of the following scripts.
pnpm theme
If you want to continuously generate types while customizing the theme, execute any of the following scripts.
pnpm theme:watch
Edit this page on GitHub