Skip to content

Version 4.0.4 - Breaks desktop first support #16316

@austinwilcox

Description

@austinwilcox

Tailwind: 4.0.4
Build-tool: Vite 6.0.11
Node: 23.5.0
Browser: Chrome/Brave
OS: Windows and Linux

Describe your issue
We are using an anti-pattern with our project. We have been building desktop first and this worked just fine with tailwind v3. When we upgraded to v4 all of our media breakpoints have changed. We have scoured the docs and didn't see any reference to this changing. Here is what we see with the v3 code, and here is what the v4 code is generating.

V3

Code Snippet

<div class="hidden w-full justify-center md:hidden sm:flex">

Result in DOM

Image

Image

V4

Code Snippet

<div className="hidden w-full justify-center md:hidden sm:flex">

Result in DOM

Image

Image

Here is relevant part of the tailwind.config.js.

/** @type {import('tailwindcss').Config} */
export default {
  darkMode: "selector",
  content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"],
  theme: {
    screens: {
      "2xl": { max: "1536px" },
      xl: { max: "1280px" },
      lg: { max: "1024px" },
      md: { max: "900px" },
      sm: { max: "600px" },
    }
  },
  plugins: [],
}

This worked fine in v3 and hopefully we are just missing something small and this can be fixed without us having to downgrade back to v3.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions