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.
Bug Description
When setting a breakpoint using
pxin@theme, it does not workcorrectly. But the same value in
remworks fine.Versions
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.