CSS to Tailwind

Turn CSS declarations into Tailwind v4 utilities, with the spacing scale worked out and arbitrary values where there is no named class.

css
usage.tsxtsx
The classes appear here
Made something you like?Blocks written in these utilities

Questions

How are sizes turned into the scale?+

A value that is a multiple of 4px becomes a scale step, so 24px is p-6 and 1rem is m-4. Anything else becomes an arbitrary value rather than being rounded, because a silently changed measurement is the worst possible output.

Why are some declarations left out?+

Because they have no utility. Custom properties and rules such as mix-blend-mode are reported under the output instead of being guessed at, and they belong in CSS next to your classes.

Are the colors converted to theme names?+

No, they come out as arbitrary values holding your exact color. Mapping a hex onto a theme name would need your theme, and the tool would be guessing which token you meant.

Related tools

The tools are free. So is most of the library.

1935 blocks and 989 pieces for shadcn/ui and Tailwind, built on the same tokens these tools write. Install one with a command and the code is yours.

No signup for the tools. MIT for free blocks, commercial licence for Pro.

Markdown version