em-media-query
v2.0.0
Published
Transform min/max-width/height media queries to ems.
Downloads
73,487
Readme
em-media-query
Transform min/max-width/height media queries to ems.
This is a low-level module. You’re probably looking for PostCSS or Babel plugin.
Install
npm install em-media-query --save
Usage
import meMediaQuery from 'em-media-query';
console.log(emMediaQuery('screen and (min-width:600px)'));
// 'screen and (min-width:37.5em)'
API
emMediaQuery(str, [opts])
Returns: string
str
Type: string
Media query to convert.
opts
Type: Object
precision
Type: number
Default: 5
Rounding precision for values.
License
MIT © Ivan Nikolić