CSS to design tokens
css_to_dtcgConvert CSS custom properties into W3C design tokens (DTCG) JSON. Pass css (a :root block, a whole stylesheet, or a Tailwind v4 @theme block). Each variable is typed from its value and name (color, dimension in px or rem, duration, number, fontFamily, fontWeight, cubicBezier, shadow), grouped by type (color, spacing, radius, font-size, duration, and so on), and a var(--other) value becomes a {group.name} alias. The original CSS name and any dark value (from prefers-color-scheme: dark or a .dark or data-theme=dark selector) are kept in $extensions so dtcg_to_css can round-trip them. Variables that cannot be typed (calc(), clamp(), percentages, gradients, compound values, references to undefined variables) are listed with the reason instead of being guessed.
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": {
"css": "<css>"
},
"name": "css_to_dtcg"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| css | Yes | CSS with custom properties. Free up to 100,000 characters; Pro up to 2,000,000. |