Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/niksy/postcss-media-query-gap

PostCSS plugin for applying gap on max-width/height media queries.
https://github.com/niksy/postcss-media-query-gap

Last synced: about 2 months ago
JSON representation

PostCSS plugin for applying gap on max-width/height media queries.

Awesome Lists containing this project

README

        

# postcss-media-query-gap

[![Build Status][ci-img]][ci]

[PostCSS][postcss] plugin for applying gap on max-width/height media queries.

Useful when you want to
[prevent double breakpoints](http://tzi.fr/css/prevent-double-breakpoint).

## Install

```sh
npm install postcss postcss-media-query-gap --save
```

## Usage

```js
import postcss from 'postcss';
import mediaQueryGap from 'postcss-media-query-gap';

postcss([
mediaQueryGap({
/* options */
})
]);
```

```css
/* Before */

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

/* After */

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

## License

MIT © [Ivan Nikolić](http://ivannikolic.com)

[ci]: https://travis-ci.com/niksy/postcss-media-query-gap
[ci-img]: https://travis-ci.com/niksy/postcss-media-query-gap.svg?branch=master
[postcss]: https://github.com/postcss/postcss