map_palette_to_semantics
Map generated palette scales to semantic tokens using built-in presets or custom rules. Write output to disk with configurable merge and split strategies.
Instructions
Map generated palette scales to semantic tokens using configurable rules. Includes built-in presets for light-mode and dark-mode mappings. Can write output to disk with merge and split strategies.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rules | No | Custom mapping rules as JSON array. Each rule: {"propertyClass":"background","intent":"accent","paletteScale":"brand","defaultStep":500} | |
| dryRun | No | Show what would be written without actually writing. Default: false. | |
| preset | No | Use a built-in mapping preset. Default: light-mode. | |
| states | No | Comma-separated additional states, e.g. 'hover,active,focus,disabled'. | |
| palette | Yes | The palette JSON from generate_palette (the 'palette' field from the result). | |
| outputDir | No | Directory to write generated files to (relative to project root). If omitted, tokens are returned inline. | |
| uxContexts | No | Comma-separated UX contexts to generate for, e.g. 'action,input,surface'. If omitted, generates only global (context-free) tokens. | |
| mergeStrategy | No | How to handle existing files. Default: additive. | |
| splitStrategy | No | How to split tokens across files. Default: by-context. |