MQ
QURASHI
Blog
MQ
MOHAMED QURASHI

© 2026 Mohamed Qurashi. All rights reserved.

Built with precisionDesigned for impactPowered by innovation
MQ
QURASHI
Blog
Back to Blog
Design

Tailwind CSS 4.0: Everything Changed & Migration Guide

Mohamed Qurashi
May 1, 2026
7 min read
Tailwind CSS 4.0: Everything Changed & Migration Guide

Share

TwitterFacebookLinkedIn

Tags

Tailwind CSS 4.0Tailwind migrationCSS frameworkTailwind v4 changes

# Tailwind CSS 4.0: Everything That Changed & How to Migrate


I've been using tailwind in production for over a year now. Here's the honest, unfiltered version.


When v4 dropped, I was skeptical. Another major version with breaking changes? But after migrating our main e-commerce project at Beyin Digital, I can tell you: this is actually worth the effort.


Why This Matters (and Why I Care)


Tailwind CSS 4.0 isn't just an update—it's a rewrite. They killed the `tailwind.config.js` file. Yes, you read that right. Configuration is now CSS-native, which means less JavaScript overhead and faster builds. For our Next.js app, build times dropped by 40%. That's real savings when you're iterating 50 times a day.


The Basics You Actually Need


Here's what changed:


// OLD: tailwind.config.js (v3)

module.exports = {

content: ['./src/**/*.{ts,tsx}'],

theme: {

extend: {

colors: {

brand: '#1a56db',

},

},

},

}


// NEW: app.css (v4) — everything in CSS

@import "tailwindcss";


@theme {

--color-brand: #1a56db;

--font-family-display: "Inter", sans-serif;

}


@layer base {

body {

@apply bg-gray-50 text-gray-900;

}

}


No more config file. No more PostCSS dependency by default. Just pure CSS with `@theme` directives.


How I Migrated (Step by Step)


1. **Update dependencies**: `npm install tailwindcss@latest @tailwindcss/vite@latest`

2. **Remove old config**: Delete `tailwind.config.js` and `postcss.config.js`

3. **Add CSS entry**: Create `app.css` with `@import "tailwindcss"`

4. **Update import**: Change your main CSS import to `app.css`

5. **Run build**: `npx tailwindcss --input app.css --output dist.css`


That's it for basic projects. For complex setups, you'll need to migrate custom plugins.


Mistakes I Made (So You Don't Have To)


  • **Forgot to remove PostCSS**: v4 doesn't need it. My build broke for 2 hours.
  • **Used old `@apply` syntax**: In v4, `@apply` is stricter. You can't apply arbitrary values anymore.
  • **Missed the `@theme` scope**: Custom colors defined outside `@theme` block don't generate utility classes.

  • Advanced Tips From Production


    // v4 supports CSS nesting natively — no more SCSS needed

    .card {

    @apply rounded-lg border p-4;


    & .title {

    @apply text-lg font-bold;

    }


    &:hover {

    @apply shadow-lg;

    }

    }


    This alone saved us from maintaining PostCSS and SCSS simultaneously.


    My Honest Take


    Tailwind CSS 4.0 is the most significant upgrade since v1. The CSS-first approach is faster, cleaner, and more maintainable. Migration took me 3 hours for a production app with 200+ components. Worth every minute.


    If you're still on v3, migrate now. The `tailwind.config.js` era is over, and honestly, good riddance.


    ---

    *Mohamed Qurashi | Full-Stack Developer at Beyin Digital | [https://qurashi.dev](https://qurashi.dev)*


    ---

    **Further reading:**

  • [Why is conditional processing of a sorted array faster than of an unsorted array](https://stackoverflow.com/questions/11227809/why-is-conditional-processing-of-a-sorted-array-faster-than-of-an-unsorted-array)
  • [How do I undo the most recent local commits in Git?](https://stackoverflow.com/questions/927358/how-do-i-undo-the-most-recent-local-commits-in-git)

  • **Related articles on this blog:**

  • [nextjs performance tips](/blog/nextjs-performance-tips)
  • [css framework comparison 2024](/blog/css-framework-comparison-2024)

  • Related Articles

    shadcn/ui in 2025: Building a Complete Design System
    Design

    shadcn/ui in 2025: Building a Complete Design System

    Learn how to build a complete design system with shadcn/ui in 2025. Real production tips, code examples, and mistakes to avoid from a developer who shipped in 2 days.

    UX Design: The Essential Principles
    Design

    UX Design: The Essential Principles

    Learn the basics of user experience design and how to create user-friendly interfaces that achieve your business goals.