PostCSS plugin for transforming min/max-width/height media queries to ems.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
test
.editorconfig
.eslintrc
.gitignore
.nycrc
.travis.yml
LICENSE.md
README.md
index.js
package.json

README.md

postcss-em-media-query

Build Status

PostCSS plugin for transforming min/max-width/height media queries to ems.

Install

npm install postcss-em-media-query --save

Usage

const postcss = require('postcss');
const emMediaQuery = require('postcss-em-media-query');

postcss([
	emMediaQuery({ /* options */ })
]);
/* Before */

@media screen and (min-width:600px) and (max-width:739px) {
	.foo {
		color:red;
	}
}

/* After */

@media screen and (min-width:37.5em) and (max-width:46.1875em) {
	.foo {
		color:red;
	}
}

Options

precision

Type: Integer
Default: 5

Rounding precision for values.

License

MIT © Ivan Nikolić