Examples ā Advanced
The advanced template demonstrates a multi-file setup loaded by:
examples/templates/advanced/config.mjsdata: ["tokens/theme/*.tokens.json", "tokens/base.tokens.json"]
It splits tokens by domain and includes custom validation and types:
base.tokens.jsonfor shared primitives and aliasestheme/color.tokens.jsonfor semantic color mappingtheme/typography.tokens.jsonfor typography compositestheme/more.tokens.jsonfor dimensions, shadows, spacing, and motiontheme/custom.tokens.jsonfor customunknowntoken examples
The config uses dtcgJsonLoader + dtcgValidator and extends validation with customValidator rules.
Start here:
examples/templates/advanced/tokens/base.tokens.jsonexamples/templates/advanced/tokens/theme/color.tokens.jsonexamples/templates/advanced/tokens/theme/typography.tokens.jsonexamples/templates/advanced/tokens/theme/more.tokens.jsonexamples/templates/advanced/tokens/theme/custom.tokens.json
Outputs:
examples/templates/advanced/dist/sample.cssexamples/templates/advanced/dist/sample-typography.cssexamples/templates/advanced/dist/sample-flatten.json