Skip to content

Nested css rules with postcss 8 #1611

@JulienKode

Description

@JulienKode

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions