postcss-media-minmax icon indicating copy to clipboard operation
postcss-media-minmax copied to clipboard

Support (500px <= width) syntax

Open lschmelzeisen opened this issue 2 years ago • 2 comments

The following transformation works as expected:

@media (width >= 500px) {}
/* becomes: */
@media (min-width: 500px) {}

However, I just noticed, that the following does not work:

@media (500px <= width) {}
/* does not become the following: */
@media (min-width: 500px) {}

To my understanding also the latter syntax is expected to work according to Example 16 of Media Queries Level 4 and at least Firefox and Chrome already understand it.

lschmelzeisen avatar May 02 '23 18:05 lschmelzeisen

Hi @lschmelzeisen,

We fixed this issue in this PR : https://github.com/postcss/postcss-media-minmax/pull/44

Because we used postcss-media-minmax in postcss-preset-env we wanted to get this fix and others out to our users. So we released our updated version as a separate package.

You could use that version until the maintainers here have time again.

romainmenke avatar May 12 '23 14:05 romainmenke

Hey @romainmenke, great, thank you! I have switched my code to using your fork for now, as I have much more confidence with your rewrite instead of a regex-based implementation. Also I commend your efforts in pushing this back upstream :+1:

lschmelzeisen avatar May 22 '23 12:05 lschmelzeisen