purgecss icon indicating copy to clipboard operation
purgecss copied to clipboard

[Bug]: Empty @media queries not purged

Open khemarato opened this issue 1 year ago • 1 comments

Describe the bug

Output css contains useless @media(foo){}

To Reproduce

Have a media query with an unused class inside.

Expected Behavior

The rule and the query should be purged, but actually only the rule is purged and the empty media query stays with only comments and whitespace inside.

Environment

Any?

Add any other context about the problem here

I'm using the Primer framework but not all of its features and am using PurgeCSS to clean what I'm not using

Code of Conduct

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

khemarato avatar Jul 23 '22 21:07 khemarato

I'm getting this as well. Related issue: https://github.com/FullHuman/purgecss/issues/561

For example:

@media only screen and (min-device-width:1025px) and (max-device-width: 1439px) {
}

doesn't get removed by purgecss.

afreemanio avatar May 15 '23 20:05 afreemanio