bigslycat / mq-polyfill

CSSOM-valid and jsdom/Jest-compatible matchMedia server-side polyfill.
https://www.npmjs.com/package/mq-polyfill
MIT License
29 stars 5 forks source link

Polyfilled matchMedia never matches float "max-width" queries #3

Open TxHawks opened 6 years ago

TxHawks commented 6 years ago

Whenever passing a float as the value of a max-width query, matches returns false even when the test should pass. Tested this with both px and em based queries.

Expected behavior:

// After polyfilling matchMedia
window.innerWidth = 700;
window.outerWidth = 700;

window.matchMedia('(max-width: 2.5em)').matches; // => true

Actual behavior:

// After polyfilling matchMedia
window.innerWidth = 700;
window.outerWidth = 700;

window.matchMedia('(max-width: 2.5em)').matches; // => false
window.matchMedia('(max-width: 3em)').matches; // => true
TxHawks commented 6 years ago

To add to the above, float min-width queries always match

sunsheeppoplar commented 6 years ago

Was there any movement on this?