purgecss icon indicating copy to clipboard operation
purgecss copied to clipboard

[Bug]: Not Playing Well With Sass `@extend` Syntax

Open fweth opened this issue 9 months ago • 0 comments

Describe the bug

Not sure if this is in the responsibility of PurgeCSS, but when I have this SCSS file:

@import "bootstrap/scss/bootstrap";
/* purgecss start ignore */
.rte {
  a {
    @extend .text-decoration-underline, .link-offset-3;
  }
  blockquote {
    @extend .blockquote, .ms-4,.mt-5, .fs-4;
  }
}
/* purgecss end ignore */

then it doesn't create classes for a or blockquote if it can't find the classes inside the @extend clause in the wild. So I don't know how the pre-processed CSS handed from Sass to PurgeCSS exactly looks like and if PurgeCSS even has a change to fix this, but it's still not the behaviour I expected.

To Reproduce

Compile the SCSS code from with Sass and PurgeCSS, e.g. via Vite.js.

Expected Behavior

PurgeCSS should create styles for .rte a and .rte blockquote even when it doesn't encounter the Bootstrap classes the files it looks through.

Environment

Node 18

Add any other context about the problem here

No response

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

fweth avatar Sep 28 '23 14:09 fweth