Canonicalize Tailwind classes
tailwind_canonicalizeRewrite Tailwind CSS classes into their canonical short form. Turns arbitrary values back into real design tokens: p-[1rem] becomes p-4, rounded-[24px] becomes rounded-3xl, -bottom-[4px] becomes -bottom-1. Backed by 12,438 replacements generated from Tailwind 4.3.3's own design system, so the answers are authoritative rather than guessed. Handles one class at a time and does NOT merge across classes (px-4 py-4 into p-4, w-6 h-6 into size-6) — that needs the surrounding group to be safe to collapse; use NormWind for that.
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": {
"classes": "<classes>"
},
"name": "tailwind_canonicalize"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| classes | Yes | A Tailwind class string, e.g. the contents of a class= attribute. Whitespace and unrecognized classes are preserved exactly. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes | The canonicalized class string. | |
| changed | Yes | ||
| changes | Yes | ||
| tailwindVersion | No |