Skip to content

px breakpoints sorted before rem in generated CSS causing wrong cascade order #20032

@TheLoneSoul

Description

@TheLoneSoul

Bug Description

When setting a breakpoint using px in @theme, it does not work
correctly. But the same value in rem works fine.

Versions

  • Tailwind CSS: v4.3.0
  • @tailwindcss/postcss: v4.3.0
  • Vite: v8.0.10
  • React: v19.2.5

Code to Reproduce

@theme {
--breakpoint-lg: 992px; (does not work)
--breakpoint-lg: 62rem; (works perfectly)
}

Expected

992px and 62rem are the same width (992 / 16 = 62rem),
so both should behave identically.

Actual

px gets sorted before rem defaults in generated CSS,
so md: styles override lg: styles incorrectly
between 992px and 1024px.

Workaround

Use rem instead of px.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions