Tailwind CSS Playground and Class Builder
Edit HTML with utility classes, preview it at phone, tablet or desktop width, add @theme values, and turn existing CSS into Tailwind class lists.
S'executa al teu navegador. Els fitxers mai no surten del dispositiu. Mira com comprovar-ho
…
Com es fa
- 1Pick a template
Choose one from Templates or open your HTML file.
- 2Edit classes
Type in the HTML; use the suggestion bar or Tab to complete class names.
- 3Preview sizes
Switch between Full, Phone, Tablet and Desktop widths and toggle dark.
- 4Add theme values
Open the theme box and add @theme variables.
- 5Convert CSS
In CSS to Tailwind paste rules and copy the class lists.
- 6Tidy classes
Use Class sorter to group, de-duplicate and copy a clean list.
Sobre aquesta eina
Tailwind CSS styles elements with small utility classes such as p-4, flex or text-slate-700. This playground lets you try them without setting up a project. Write HTML on the left and the preview on the right updates with the official Tailwind v4 browser build, inside a sandboxed frame. Switch the preview to 375, 768 or 1280 pixels to test responsive variants, toggle a dark class, and add your own theme variables. A suggestion bar completes class names as you type inside class attributes, the class sorter groups and de-duplicates long class lists, and the converter rewrites ordinary CSS rules as Tailwind classes.
Who it is for
Developers learning Tailwind, designers prototyping a component, teams migrating hand-written CSS to utilities and anyone who wants to check how a snippet from documentation looks.
The playground
Pick a template (product card, navbar, pricing grid or sign-in form) or open your own HTML file. Inside a class attribute, the bar under the editor suggests matching utilities, including variants such as hover: or md:, and Tab inserts the first one. The theme box accepts Tailwind v4 @theme blocks: --color-brand: #0ea5e9 creates bg-brand, text-brand and border-brand. Download HTML saves a standalone page.
Responsive and dark mode
Tailwind is mobile first: unprefixed classes apply everywhere and sm:, md:, lg:, xl: and 2xl: apply from 640, 768, 1024, 1280 and 1536 pixels up. Use the width buttons to watch a layout change at each breakpoint. The dark class toggle helps when your configuration uses class-based dark mode.
CSS to Tailwind
Paste CSS rules or bare declarations. Spacing in px or rem maps to the 4-pixel scale (16px becomes 4, 1px becomes px), font sizes and weights, border radius, line height, widths in percent, flex and grid properties map to named utilities, colours become arbitrary values such as bg-[#2563eb], and :hover, :focus or @media (min-width: 768px) become variants. Anything without a utility is kept as an arbitrary property like [mix-blend-mode:multiply] and listed so you can review it.
Class sorter
Paste a long class string to see it grouped into layout, sizing, spacing, typography, colour and interaction, with duplicates and likely conflicts (such as p-4 and p-6 on the same element) flagged.
Worked example
The CSS rule .card { padding: 24px; border-radius: 12px; background-color: #fff; box-shadow: 0 4px 12px rgba(0,0,0,.1) } with .card:hover { transform: translateY(-2px) } converts to p-6 rounded-xl bg-[#fff] shadow-[0_4px_12px_rgba(0,0,0,.1)] hover:[transform:translateY(-2px)], with the transform noted as an arbitrary property.
Limits
The browser build of Tailwind is meant for prototyping, not production; build real sites with the Tailwind CLI or a bundler plugin. The converter covers common properties and the default scale, not every utility or your custom theme, and output should be reviewed. The preview needs cdn.jsdelivr.net to load Tailwind.
Exemple resolt
.card padding 24px, radius 12px, white background and shadow → p-6 rounded-xl bg-[#fff] shadow-[…].
En resum
- Categoria: Desenvolupament i dades
- S'executa al navegador, sense registre, sense pujar res.
- La informació que introdueixes es queda al dispositiu.
- Disponible en anglès.
- Contingut revisat per última vegada:
- Font oficial: Tailwind CSS v4 documentation (utility classes, variants, @theme) and the official @tailwindcss/browser build
Preguntes freqüents
Which Tailwind version does the preview use?
Tailwind CSS 4.1.11, the official browser build, loaded in a sandboxed frame.
Can I use my own colours?
Yes. Add variables in the @theme box, for example --color-brand, and use bg-brand.
Is the converted output exact?
For common properties it uses named utilities; other values become arbitrary classes that you should review.
Does the preview run my scripts?
It runs in a sandboxed frame without access to this page, so scripts in your HTML cannot reach it.
Can I test responsive layouts?
Yes. Switch the preview to 375, 768 or 1280 pixels to see each breakpoint.
Should I use the browser build on my site?
No. Tailwind recommends compiling CSS with its CLI or bundler plugins for production.
