Why Use Tailwind?
Understand the advantages of a utility-first workflow.
Traditional CSS asks you to name things and jump between files. Tailwind keeps styling next to your markup, which speeds up building and makes designs consistent.
Key benefits
- Fast — style without leaving your HTML.
- Consistent — a fixed design scale for spacing, color, and type.
- Responsive — add
sm:,md:,lg:prefixes for breakpoints. - No dead CSS — a build step removes unused styles for tiny files.
You still get full control: anything CSS can do, Tailwind can express.
Example
Loading editorβ¦
Press Run to see the result.
When to use it
- A team migrates from Bootstrap to Tailwind to eliminate unused CSS bloat and ship a smaller production bundle.
- A developer avoids naming conflicts in a large codebase by keeping all styles as composable utility classes rather than global class names.
- A product designer speeds up iteration by tweaking layout and color directly in HTML templates instead of switching between CSS files.
More examples
Eliminate custom class names
Tailwind removes the need to invent and maintain custom class names by expressing style intent directly in the markup.
<!-- Before: custom CSS required -->
<div class="card-header">Title</div>
<!-- After: no custom CSS needed -->
<div class="text-lg font-bold text-gray-900 border-b pb-2">Title</div>Consistent spacing scale
Tailwind's built-in spacing scale (4 = 1rem, 6 = 1.5rem, etc.) keeps spacing consistent without remembering arbitrary pixel values.
<div class="p-4 mb-6">
<p class="mt-2 text-sm text-gray-600">Spaced with the design scale</p>
</div>Fast prototype with utilities
A functional navigation bar is prototyped in seconds using flex, spacing, color, and hover utilities β no separate stylesheet needed.
<nav class="flex items-center justify-between bg-gray-900 px-6 py-4">
<span class="text-white font-bold text-xl">Brand</span>
<a href="#" class="text-gray-300 hover:text-white text-sm">Login</a>
</nav>
Discussion