match-media-range
v2.0.0
Published
Use media query ranges in window.matchMedia
Downloads
6
Maintainers
Readme
match-media-range
match-media-range is a polyfill that lets you use media query ranges in
window.matchMedia
, following the Media Queries Level 4 specification.
matchMedia('(20em < width < 50em)');
Try it right now using CodePen
Usage
Add match-media-range to your build tool:
npm install match-media-range --save-dev
Import match-media-range as a resource.
import matchMedia from 'match-media-range';
match-media-range is 327 bytes when ES5 transpiled, minified, and gzipped.