Toolvist

Conversor de CSS a Tailwind

Convierte declaraciones CSS planas en clases utilitarias de Tailwind equivalentes. Conversor CSS a Tailwind: pega tus reglas y obtén clases listas para usar.

Paste CSS rules — selectors are ignored, declarations are converted.

Conversor de CSS a Tailwind gratuito

El Conversor de CSS a Tailwind traduce declaraciones CSS planas en clases de utilidad Tailwind equivalentes. Pega un bloque CSS y obtén las clases correspondientes para espaciado, tipografía, colores, bordes y más.

The reverse mapping is more manually done, but the shorthand syntax is explained by the CSS Formatter & Beautifier and the properties it names are generated by the CSS Box Shadow Generator and CSS Gradient Generator. For class naming conventions, the BEM Class Name Generator is the tool.

Cómo usar CSS a Tailwind

  1. 1 Paste your CSS declarations or a rule.
  2. 2 Convert. Properties with a direct utility-class equivalent are translated.
  3. 3 Check the reported list of properties with no match, which need a custom value or an arbitrary class.
  4. 4 Copy the classes into your markup.

Cómo usarlo

Pega tu CSS a la izquierda y haz clic en Convertir. Cada declaración reconocida se convierte en una clase Tailwind; todo lo que no pueda mapear se muestra como comentario para que nada se pierda en silencio.

  • Mapea propiedades de espaciado, tamaño, tipografía, color, borde y flex
  • Convierte valores px a la escala de espaciado y tamaño de Tailwind
  • Los colores se convierten a la paleta Tailwind más cercana cuando el hex exacto no está disponible
  • Las declaraciones sin mapeo se marcan en comentarios
  • Se ejecuta enteramente en tu navegador

Cómo funciona el mapeo

Tailwind es un framework de utilidades, así que no todo valor CSS tiene una clase uno a uno. Los valores comunes se mapean limpiamente (margin, padding, font-size, color). Para valores arbitrarios el conversor puede emitir la sintaxis de corchetes como w-[320px] para que la salida siga funcionando.

Preguntas frecuentes

What does not translate cleanly?

Anything outside Tailwind's scale: a colour not in the palette, an arbitrary spacing value, a complex shorthand, or a selector that depends on child position. Tailwind's utility classes are bounded by its design tokens, so a value outside those tokens has to be expressed as an arbitrary value with a bracket syntax.

Is replacing CSS with utility classes a good idea?

It is a trade, not an improvement in itself. Utility classes make the styling of a component visible where the component is defined, and they avoid inventing names for things that are not really abstractions. The cost is that complex states and pseudo-selectors become less readable, and long class lists hurt diffs.

How do responsive variants work?

By prefixing a utility with a breakpoint, so a class applies only at that width and above. The convention is mobile-first: an unprefixed class applies everywhere, and a prefixed one overrides it from that breakpoint upward. Converting a desktop-first stylesheet into this model means inverting the logic, which is a design decision rather than a mechanical one.

Herramientas para desarrolladores relacionadas

Ver todo en Herramientas para desarrolladores →

También te puede interesar

Herramientas de otras categorías que suelen combinarse con CSS a Tailwind:

Explorar el directorio completo →