question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Nested css rules with postcss 8

See original GitHub issue

With @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

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:closed
  • Created 2 years ago
  • Reactions:7
  • Comments:22 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
TheSeallycommented, Aug 19, 2021

@RadValentin thanks for quick response

1reaction
TheSeallycommented, Aug 18, 2021

My full name is Виктор Малий

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found