DEV
Home About Services Projects Blog Contact
Hire me
JavaScript & Frontend

Why I Ditched Bootstrap for Tailwind CSS (and Never Looked Back)

🇫🇷 Lire en français
Why I Ditched Bootstrap for Tailwind CSS (and Never Looked Back)

Two years ago, I would have defended Bootstrap to the end. I knew every class by heart — col-md-6, d-flex align-items-center, btn btn-primary. It was comfortable. Then I tried Tailwind CSS on a side project, "just to see." Two weeks later, I was removing Bootstrap from all my active projects.

Here's what convinced me — and the few reasons not to choose Tailwind.

The Fundamental Problem with Bootstrap

Bootstrap is a component framework. It gives you buttons, navbars, cards — with a specific style that's hard to customize without overriding CSS. You start with their design and try to bend it toward yours.

Two classic problems result:

  1. Bootstrap sites all look the same. Users instantly recognize a Bootstrap site.
  2. CSS specificity becomes a nightmare. You end up writing !important everywhere to override Bootstrap styles.

Tailwind's Utility-First Approach: A Paradigm Shift

Tailwind doesn't give you components — it gives you utilities. Classes that do one precise thing. And you compose your design directly in HTML.

<!-- ❌ Bootstrap: dependent on imposed styling -->
<button class="btn btn-primary btn-lg">Create Account</button>

<!-- ✅ Tailwind: you control everything -->
<button class="bg-blue-600 hover:bg-blue-700 text-white font-semibold
               px-6 py-3 rounded-lg transition-colors duration-200
               focus:outline-none focus:ring-2 focus:ring-blue-500">
    Create Account
</button>

Bundle Size: The Myth That Tailwind is "Heavy"

People often say Tailwind generates huge CSS files. That was true before version 3. Today, Tailwind uses a JIT (Just-In-Time) compiler that only generates the classes you actually use.

Result: a final CSS of 5-15 KB (gzipped) on most projects. Bootstrap is 20-30 KB minified and gzipped — and you're shipping hundreds of components you don't use.

Productivity: What I Didn't Expect

What really surprised me was the speed. The responsive is trivial:

<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
    <!-- 1 column mobile, 2 tablet, 3 desktop -->
</div>

States (hover, focus, dark mode) are all handled with intuitive prefixes:

<button class="bg-slate-800 hover:bg-slate-700 dark:bg-white 
               dark:text-slate-900 text-white ...">
</button>

When NOT to Choose Tailwind

  • Ultra-fast prototyping → Bootstrap or DaisyUI are faster for MVPs
  • Teams without a designer → Bootstrap's design system guides you; Tailwind without design produces inconsistent interfaces
  • Dynamically generated content → Tailwind classes in database-generated content won't be included in the JIT bundle

Conclusion

Tailwind CSS isn't objectively better than Bootstrap. It's better for me, in my workflow, on my projects — because it matches how I work: think design => implement directly, without an abstraction layer.

If you've never tried it, start on your next side project. Not on a client project, not in direct production — on something small enough to explore without pressure. You'll see.

Related articles

Écrire sur WhatsApp