Replies: 2 comments 6 replies
-
Hey there! I don't think a What you refer to is probably a feature of another CSS pre-processor (maybe SCSS?). If you want this to work, you'll have to ensure that you run the according pre-processors before Tailwind in your postcss config. In general though, Tailwind v4 uses browser-based CSS nesting and lightningcss to flatten the nesting. |
Beta Was this translation helpful? Give feedback.
-
✅ The Fixes✅ Option 1: Flatten the NestingThe cleanest fix is: don’t nest when you’re using Tailwind classes +
This way, Tailwind clearly sees the ✅ Option 2: Safelist It (if you really wanna nest)If you must use nesting (
But honestly, this is annoying and fragile if you’re gonna do it for 20+ nested classes. 🛠️ Extra: If you're using
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
What version of Tailwind CSS are you using?
What build tool (or framework if it abstracts the build tool) are you using?
NextJS: 15.0.3
What version of Node.js are you using?
v20
What browser are you using?
Arc
What operating system are you using?
macOS
Describe your issue
When writing css such as:
Then the
.btn-primary
class is not generated and present in the css file.Beta Was this translation helpful? Give feedback.
All reactions