css / csso

CSS minifier with structural optimizations
https://css.github.io/csso/csso.html
MIT License
3.74k stars 189 forks source link

Silently removes @media blocks containing "and (not ...)" #476

Open tszynalski opened 4 months ago

tszynalski commented 4 months ago

Media rules like @media (max-width: 701px) and (not (any-pointer: fine)) will result in the whole block being dropped. What's worse, it is completely silent, doesn't even issue a warning.

Christoph-Wagner commented 2 months ago

Same for @media (max-width: calc(…

stepanjakl commented 1 month ago

+1

stepanjakl commented 1 month ago

I think I've found a workaround. Removing the enclosing brackets seems to resolve the issue. Here's an example:

Before:

@media ((min-width: 45rem) and (min-aspect-ratio: 3/4)) { ... }

After:

@media (min-width: 45rem) and (min-aspect-ratio: 3/4) { ... }

This is also related to: https://github.com/css/csso/issues/464