Report

Help us improve this tool

CSS To Tailwind Converter

Transform regular CSS into Tailwind @apply directives with configurable rem conversion and arbitrary property support.

O M T

Convert CSS to Tailwind CSS with @apply

Tailwind CSS encourages utility classes, but existing projects often start with traditional CSS. Migrating component styles to Tailwind can be tedious when done by hand. This CSS to Tailwind converter transforms standard CSS declarations into Tailwind @apply directives automatically.

What this tool does

Paste CSS rules and receive equivalent Tailwind utility mappings wrapped in @apply blocks. Configure the root font size for accurate rem-to-pixel conversion, and enable arbitrary properties when you need values that do not map to standard Tailwind utilities. Output includes a comment reminding you to prefer utility classes over @apply when possible.

Workflow tips

Start with the CSS Beautifier to normalize formatting before conversion. For the reverse direction, explore our CSS to JS Converter when you need JavaScript style objects instead of Tailwind utilities.

Frequently Asked Questions

Why does output use @apply instead of utility classes?

The converter maps CSS declarations to their closest Tailwind equivalents inside @apply blocks. Some values become arbitrary utilities like text-[red] when no exact match exists. Review output and replace with native utility classes where practical.

What does the rem conversion setting do?

Tailwind uses rem units internally. Setting root font size in pixels helps convert rem-based CSS values to accurate pixel arbitrary values during conversion.

What are arbitrary properties?

When enabled, the converter can output Tailwind arbitrary property syntax for CSS declarations that do not have a direct utility class match, improving coverage for uncommon properties.

Will every CSS rule convert perfectly?

Most common properties convert well. Complex selectors, custom values, and browser-specific hacks may need manual cleanup after conversion.