Skip to content

Nested selectors are not recognized聽#52

Description

@lonekorean

Thank you for your work on this plugin!

When processing vanilla CSS nesting selectors with removeUnfound: true, it seems that some class names are not recognized, resulting in broken styling.

For example, these selectors:

div {
  &.make-green {
    background-color: #6c6;
  }
}

.excitable {
  &[data-excited="true"] .suffix::before {
    content: '!!!';
  }
}

You can see my test case here. The result should be a green box with "!!!" added inside.

This is what I get after processing. You can see that some necessary class names are removed (without being replaced with minified names):

<div class="a" data-excited="true">
  Hello
  <span class=""></span>
</div>
body {
  font: 4rem/1 sans-serif;
}

div {
  width: 400px;
  height: 200px;
  margin: 10px;
  background-color: #c66;
}

div {
  &.make-green {
    background-color: #6c6;
  }
}

.a {
  &[data-excited="true"] .suffix::before {
    content: '!!!';
  }
}

When I run with removeUnfound: false things render correctly (with some class names not minified).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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