Design tokens to CSS
dtcg_to_cssConvert W3C design tokens (DTCG) JSON into code. Pass tokens (JSON text or object) and optionally format (css, tailwind or both; default both) and prefix (added to every CSS name). Reads $type and $value with group-level $type inheritance, {alias} references (kept as var() references in CSS, resolved for Tailwind), color as a string or color object, dimension and duration as strings or {value, unit}, fontFamily, fontWeight, number, cubicBezier, shadow (one layer or several), border, transition and typography (expanded to one variable per field). Also reads the older value and type keys. Names come from the path (color.brand.500 becomes --color-brand-500) unless the token carries a name from css_to_dtcg. Validation reports missing types, circular or dangling aliases, name collisions and every token that has no CSS form (gradients, strokeStyle objects, unknown types) with the reason.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"tokens": "<tokens>"
},
"name": "dtcg_to_css"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| format | No | Default both. | |
| prefix | No | Optional prefix for CSS variable names, e.g. ds gives --ds-color-brand. | |
| tokens | Yes | W3C design tokens as JSON text or an object. |