How to use nested CSS classes in Tailwind CSS v4.1 with CLI compiler (no tailwind.config.js support #18864
mdtaufiquekhan
started this conversation in
General
Replies: 1 comment 1 reply
-
This sounds like a warning in VSCode or some other linter, but I don't expect this to be an error from Tailwind itself. Rather, I see that you haven't terminated the @layer components{
.navbar-menu-link{
- @apply block
+ @apply block;
.navbar-menu-child{
- @apply flex
+ @apply flex;
}
}
} As an aside, Adam Wathan (creator of Tailwind) does seem to advocate avoiding |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm using Tailwind CSS v4.1 with the Tailwind CLI compiler (no
tailwind.config.js
support in this version). I want to understand the proper way to write nested classes (similar to SCSS nesting or@apply
usage) in this setup.What I’ve Tried:
Tried writing nested classes using @layer and @apply, but Tailwind throws errors like Unknown at rule @apply.
My Questions:
Beta Was this translation helpful? Give feedback.
All reactions