PostCSS nested not fully working
See original GitHub issueVersion
@nuxtjs/tailwindcss: v3.3.4 nuxt: v2.14.11
Reproduction Link
https://codesandbox.io/s/funny-hugle-1tyt8?file=/pages/index.vue
Steps to reproduce
I can’t append to class names.
I thought maybe I was doing something stupid but the example at postcss-nested doesnt work either.
.test {
color: red;
&_working {
color: green;
}
& .nested {
color: blue;
}
}
What is Expected?
.test {
color: red
}
.test_working {
color: green;
}
.test .nested {
color: blue;
}
What is actually happening?
.test {
color: red
}
.test {
&_working {
color: green;
}
}
.test .nested {
color: blue;
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:5
Top Results From Across the Web
Webpack - Postcss nesting not working used as suggested
The postcss.config.js is file loaded too. A screenshoot of the nested css in Chrome. enter image description here. Update. I set ...
Read more >PostCSS nested not fully working · Issue #227 · nuxt ... - GitHub
PostCSS nested not fully working #227 ... Nuxt does not include postcss-nested by default, but it is really easy to add postcss plugins:....
Read more >postcss-nested - npm
PostCSS plugin to unwrap nested rules like how Sass does it. Latest version: 6.0.0, last published: 3 months ago. Start using postcss-nested ......
Read more >Writing Complex Classes Using @apply and Postcss-Nesting ...
In the example above, when we style our button by typing the TailwindCSS classes in inline, we can see that the code is...
Read more >postcss-nested-ancestors | Yarn - Package Manager
When writing modular nested CSS, & current parent selector is often not enough. PostCSS Nested ancestors introduces ^& selector which let you reference...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @csheppard
Nuxt does not include
postcss-nested
by default, but it is really easy to add postcss plugins:I updated your sandbox and it’s working: https://codesandbox.io/s/postcss-plugin-with-nuxt-tailwind-gyfo8?file=/nuxt.config.js:292-379
I also updated the documentation: https://tailwindcss.nuxtjs.org/examples/postcss-plugin
PS: sorry for the late answer
Ok, mystery solved 😅 https://github.com/nuxt-community/tailwindcss-module/releases/tag/v4.0.1
postcss-nesting
is not the same aspostcss-nested
!👀
So, instead of
You need to do:
Which is compliant with https://drafts.csswg.org/css-nesting-1/