logo
HomeAboutSkillsProjectsExperienceBlogContact
© 2026 Sarun Maharjan.
Theme:
Back to all posts
CSSTailwindFrontend

Why I Switched to Tailwind CSS

November 15, 2025

I was a CSS purist for years. Semantic class names, BEM methodology, CSS modules — I believed in separation of concerns with religious fervor. Then I tried Tailwind CSS on a real project, and I haven't looked back.

The Problem with Traditional CSS

Naming is Hard

Coming up with meaningful class names is one of the hardest problems in CSS. Is it .card-wrapper, .card-container, or .card-outer? With Tailwind, you don't name anything. You describe what you want.

Dead CSS Accumulates

In large projects, CSS grows but rarely shrinks. Nobody wants to delete a class that *might* be used somewhere. Over time, your CSS bundle balloons with unused styles.

Tailwind generates only the classes you actually use. Your production CSS is typically under 10KB.

Context Switching

With traditional CSS, you're constantly jumping between HTML and CSS files. With Tailwind, everything is in one place:

// Before: two files, mental mapping required
<div className="card-header">...</div>

// card.module.css
.card-header {
  display: flex;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid #e5e7eb;
}

// After: one file, intent is clear
<div className="flex items-center p-4 border-b border-gray-200">...</div>

What Changed My Mind

Speed

The development speed increase was immediate and dramatic. I could build UIs 2-3x faster because I wasn't context-switching or debating class names.

Consistency

Tailwind's design system (spacing scale, color palette, typography) enforces consistency across the entire application. No more padding: 13px in one place and padding: 1rem in another.

Responsive Design

Responsive design becomes trivial with Tailwind's breakpoint prefixes:

<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">

Dark Mode

Adding dark mode support is as simple as prefixing classes:

<div className="bg-white dark:bg-gray-900 text-gray-900 dark:text-white">

Common Objections (And My Responses)

"The HTML looks ugly"

Yes, utility classes are verbose. But with component-based frameworks like React, you extract components, not CSS classes. The "ugly" markup lives inside well-named components.

"It's just inline styles"

No. Tailwind gives you:

  • A constrained design system
  • Responsive variants
  • Pseudo-class variants (hover, focus, active)
  • Dark mode support
  • Automatic purging of unused styles

Inline styles give you none of these.

"You can't do complex animations"

Tailwind v4 has come a long way with animation support, and you can always use CSS for the truly complex stuff. Tailwind and custom CSS coexist beautifully.

Tailwind v4: Even Better

Tailwind v4 brought significant improvements:

  • CSS-first configuration — no more tailwind.config.js
  • Lightning-fast builds with the new Oxide engine
  • Native CSS cascade layers
  • Zero-config content detection

Conclusion

Switching to Tailwind CSS was one of the best decisions I've made as a frontend developer. It's not for everyone, and that's okay. But if you haven't tried it on a real project, I encourage you to give it an honest shot. You might be surprised.