Tailwind CSS Playground
Try Tailwind CSS classes and see the page live, with the generated CSS, a dark mode switch and a zip download.
Shortcuts: Ctrl+Enter run · / search (use ⌘ on Mac)
Free Online Tailwind CSS Playground
Try Tailwind classes and see the page. Type HTML with Tailwind classes, and the preview shows it at once, next to the exact CSS Tailwind generated for it. Add your own colours in a theme block, test dark mode with a switch, and download your page. Nothing you write is uploaded. Use it to find out what a class really does, to try a layout before adding it to a project, or to copy the CSS Tailwind generates for a few classes.
How to use the Tailwind playground
- Edit index.html and add classes such as
p-4,text-red-500ormd:flex. The preview updates as you type. - Read the Generated CSS under the preview to see what each class turned into, and use Copy to take it.
- Open styles.css to add your own design values inside
@theme { }, or to write@applyrules. - Switch on Preview in dark mode to test your
dark:classes, and choose a preview size to testsm:,md:andlg:classes. - Open the ⋯ menu and choose Download all files (.zip) to keep the page.
Good to know
This playground has one page (index.html) and one stylesheet (styles.css), because Tailwind reads the classes of the page it is in. For plain CSS and scripts in several files, use the HTML/CSS/JS Playground. To tidy the stylesheet you write, try the CSS Beautifier.
Worked example
The sample is a pricing card that uses a custom brand colour from styles.css. In styles.css:
@theme {
--color-brand: #0369a1;
}
In index.html the button uses it with bg-brand and a hover shade hover:bg-brand/90. Result: a white card with a blue button that darkens on hover, and in the Generated CSS box the rules for .bg-brand and .hover\:bg-brand\/90.
Common mistakes
- Building a class name from pieces, such as
class="text-${color}-500": Tailwind only finds whole class names written out in the page. - Expecting
dark:classes to follow your computer setting: here they follow the dark mode switch. - Looking for a config file: use an
@themeblock in styles.css instead. - Loading an image from the web without switching the internet option on.