Tailwind CSS Class Generator

Generate Tailwind CSS utility classes — search, explore, and build class strings for spacing, typography, colors, and more.

About Tailwind CSS

Tailwind CSS is a utility-first CSS framework — instead of writing custom CSS, you compose small single-purpose utility classes directly in your HTML. Rather than .card{padding:1rem;background:white;border-radius:8px}, you write class="p-4 bg-white rounded-lg". This approach eliminates context switching, reduces CSS file size (via PurgeCSS), and keeps styling concerns in templates where they belong.

Tailwind uses a consistent naming convention: property-size (text-xl, p-4, m-2), property-value (bg-blue-500, text-gray-600, border-red-300), and modifier:property-value (hover:bg-blue-600, sm:flex, dark:text-white). The numeric scale (1=4px, 4=16px, 8=32px) provides consistent spacing throughout your design.

FAQ

Does Tailwind replace writing CSS entirely?
For most UI components, yes. For complex custom animations, highly specific layouts, or integrating with third-party styles, you may still write custom CSS using Tailwind's @layer directive. The @apply directive lets you compose Tailwind utilities into reusable CSS classes.
How does Tailwind keep file sizes small?
Tailwind v3 uses a JIT (Just-In-Time) compiler that scans your HTML/JSX/template files and only generates CSS for classes that are actually used. A typical production Tailwind stylesheet is 5-20KB (gzipped), much smaller than hand-written CSS or component libraries.