Skip to content

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

License

Notifications You must be signed in to change notification settings

niksy/postcss-em-media-query

Repository files navigation

postcss-em-media-query

Build Status

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

Install

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

Usage

import postcss from 'postcss';
import emMediaQuery from '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ć

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published