em-media-query

Transform min/max-width/height media queries to ems.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
em-media-query
002.0.02 years ago6 years agoMinified + gzip package size for em-media-query in KB

Readme

em-media-query
!Build Statusci-imgci
Transform min/max-width/height media queries to ems.
This is a low-level module. You’re probably looking for PostCSSpostcss-plugin or Babelbabel-plugin 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ć