Convert a Card Rule Into Tailwind Classes
Admin ·
Start with the declarations that belong to one component. Translate the values you can match, then review the selector and cascade that made each declaration apply.
Convert the card and preserve its focus state
Choose Tailwind v3.4 and Load worked example. The base card uses flex, a half-rem gap, one-rem padding, a half-rem radius, semibold text, and a width of 37.5%. Its focus-visible style offsets the outline by 3 px.
Convert to Tailwind. Confirm the result includes flex, gap-2, p-4, rounded-lg, font-semibold and text-blue-600. With arbitrary syntax enabled, w-[37.5%] keeps the width and focus-visible:outline-offset-[3px] keeps the offset within the focus-visible condition.
Load the CSS card worked exampleTailwind CSS v3, adding custom styles
Compare standard and arbitrary mappings
Clear Use arbitrary syntax for unmatched values, then convert again. The standard utility suggestions stay visible. The width and focus offset appear as unmatched declarations, each with its original source line.
Choose Tailwind v4.3 and re-enable arbitrary syntax. The sample HEX color is kept as an arbitrary color because the pinned v4 blue palette uses different native values. The corresponding v3 blue-600 has the exact HEX value in the example.
Tailwind CSS v3, adding custom stylesTailwind CSS v4, upgrade guideTailwind CSS v4, adding custom styles
Paste the class attribute and review rule coverage
Choose HTML class attribute or JSX className attribute and convert again. Download the output, then attach the matching class text to each intended element. For more than one selector, the result labels each list with its original selector.
Keep the CSS for structural selectors or warnings about overlapping declarations. A rule such as padding followed by padding-left depends on order. Class attribute order cannot recreate that relationship by itself.
Tailwind CSS v3, hover, focus and other statesTailwind CSS v4, adding custom styles
Common questions
Does the converter execute imported stylesheets?
It treats pasted CSS as data. Imports are reported for review and no referenced file is fetched.
Can the converter use a custom Tailwind theme?
It uses the selected built-in profile. Use arbitrary values or review the classes with your own theme in its configured build.