em-media-query

2.0.0 • Public • Published

em-media-query

Build Status

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ć

Readme

Keywords

Package Sidebar

Install

npm i em-media-query

Weekly Downloads

15,420

Version

2.0.0

License

MIT

Unpacked Size

11.9 kB

Total Files

8

Last publish

Collaborators

  • niksy