Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/niksy/postcss-em-media-query
PostCSS plugin for transforming min/max-width/height media queries to ems.
https://github.com/niksy/postcss-em-media-query
Last synced: 18 days ago
JSON representation
PostCSS plugin for transforming min/max-width/height media queries to ems.
- Host: GitHub
- URL: https://github.com/niksy/postcss-em-media-query
- Owner: niksy
- License: mit
- Created: 2015-11-15T08:57:05.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2020-10-21T08:11:55.000Z (about 4 years ago)
- Last Synced: 2024-04-13T17:10:38.413Z (7 months ago)
- Language: JavaScript
- Size: 16.6 KB
- Stars: 25
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# postcss-em-media-query
[![Build Status][ci-img]][ci]
[PostCSS][postcss] plugin for transforming min/max-width/height media queries to
ems.## Install
```sh
npm install postcss postcss-em-media-query --save
```## Usage
```js
import postcss from 'postcss';
import emMediaQuery from 'postcss-em-media-query';postcss([
emMediaQuery({
/* options */
})
]);
``````css
/* 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ć](http://ivannikolic.com)
[ci]: https://travis-ci.com/niksy/postcss-em-media-query
[ci-img]: https://travis-ci.com/niksy/postcss-em-media-query.svg?branch=master
[postcss]: https://github.com/postcss/postcss