Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested selectors are not recognized #52

Open
lonekorean opened this issue Jan 8, 2024 · 0 comments
Open

Nested selectors are not recognized #52

lonekorean opened this issue Jan 8, 2024 · 0 comments

Comments

@lonekorean
Copy link

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant