Skip to content

Top-level pseudo selector not giving correct output #159

@daanvosdewael

Description

@daanvosdewael

When using the plug-in with the following CSS:

:where(.foo) {
  color: #000;

  &__bar {
    font-size: 1rem;
  }
}

The output currently is this:

:where(.foo) {
  color: #000;
}

:where(.foo)__bar {
  font-size: 1rem;
}

I get that the logic is supposed to be putting __bar at the end of the & parent, but in this case I would expect the following instead:

:where(.foo) {
  color: #000;
}

:where(.foo__bar) {
  font-size: 1rem;
}

Is there a way to make this happen?

For context, I'm using this setup to make BEM-style selectors that can easily be overridden due to the :where selector that brings the specificity down to 0.

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