Nested css rules with postcss 8
See original GitHub issueWith @leozero
By upgrading postcss 7 to postcss 8 we encounter an issue.
On certain version of postcss the AST see some css with 1 selector, and with other version it is see as two selector.
The issues is available here: https://github.com/JulienKode/postcss-8-issue
- https://github.com/JulienKode/postcss-8-issue/blob/master/dist/index.prefixed.css
- https://github.com/JulienKode/postcss-8-issue/blob/chore/working-version-postcss-8/dist/index.prefixed.css
We have two branch:
- old postcss 8 version that are working well
- new postcss 8 version that have the issue
Here is a good example of the issue, the following css:
.foo {
svg {
display: none;
}
.bar {
display: inline;
}
}
Will have this output in postcss 8.0.9
.stuff .foo svg {
display: none;
}
.stuff .foo .bar {
display: inline;
}
But in postcss 8.1.0
this produce this output:
.stuff .foo .stuff svg {
display: none;
}
.stuff .foo .stuff .bar {
display: inline;
}
Did you have any idea what is causing this issue and how we can resolve it ? For now we keep old postcss 8 version
Issue Analytics
- State:
- Created 2 years ago
- Reactions:7
- Comments:22 (7 by maintainers)
Top Results From Across the Web
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 >postcss-nested - npm.io
PostCSS Nested. PostCSS plugin to unwrap nested rules like how Sass does it. .phone { &_title { width: 500px; @media (max-width: 500px) {...
Read more >Nested postcss at-rules are not removed - Stack Overflow
I would like this to return an empty string. Instead, I receive the output @removeme { .selector { color: red; } }. The...
Read more >postcss-extend-rule | Yarn - Package Manager
PostCSS Extend Rule lets you use the @extend at-rule and Functional Selectors in CSS, following the speculative CSS Extend Rules Specification.
Read more >PostCSS Plugins
See also postcss-preset-env plugins pack to add future CSS syntax by one line of code. ... postcss-if-media inline or nest media queries within...
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 Free
Top 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
@RadValentin thanks for quick response
My full name is Виктор Малий