csso icon indicating copy to clipboard operation
csso copied to clipboard

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

Open tszynalski opened this issue 1 year ago • 3 comments

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.

tszynalski avatar Feb 18 '24 22:02 tszynalski

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

Christoph-Wagner avatar Apr 29 '24 11:04 Christoph-Wagner

+1

stepanjakl avatar May 09 '24 19:05 stepanjakl

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

stepanjakl avatar May 09 '24 19:05 stepanjakl