hail2u / node-css-mqpacker

Pack same CSS media query rules into one using PostCSS
675 stars 60 forks source link

Broken sort with `min-width: 0` #57

Closed ethanresnick closed 6 years ago

ethanresnick commented 6 years ago

I realize this media query will always match, so it's a bit weird to even have it, but I do (for irrelevant reasons), and it doesn't seem to be sorted correctly.

I believe the issue is that this line checks !minWidth, so min-width: 0 is treated as though the min-width isn't specified at all.

hail2u commented 6 years ago

Thanks, 0 should be special-cased. This will ship as soon as possible.

ethanresnick commented 6 years ago

Thanks for responding to this so promptly! Looking at your fix, though, am I right to conclude that it'll only handle the case of min-width: 0, and not, e.g., min-width: 0px or min-width: 0em? If so, shouldn't it handle those other cases (i.e., 0 regardless of unit) as well?

hail2u commented 6 years ago

This bug only occurs with min-width: 0, not with min-width: 0px. And I think min-width: 0px etc. have been handled correctly in older releases.