# postcss-mqwidth-to-class

> PostCSS plugin converts min/max-width media queries to classes, useful for clients that do not support media queries e.g. IE8.

Latest version **0.3.2** (published 2015-09-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install postcss-mqwidth-to-class
pnpm add postcss-mqwidth-to-class
yarn add postcss-mqwidth-to-class
bun add postcss-mqwidth-to-class
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.2 |
| Published | 2015-09-01 |
| First published | 2015-09-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+6 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Abed Islam |
| Maintainers | notacouch |
| Keywords | postcss, css, postcss-plugin, ie8, responsive, width |

## Links

- npm: https://www.npmjs.com/package/postcss-mqwidth-to-class
- Repository: https://github.com/notacouch/postcss-mqwidth-to-class
- Issues: https://github.com/notacouch/postcss-mqwidth-to-class/issues
- npm.io page: https://npm.io/package/postcss-mqwidth-to-class

## Dependencies (1)

- [postcss](https://npm.io/package/postcss.md) ^5.0.2

## Alternatives

- [style-dictionary](https://npm.io/package/style-dictionary.md) — 2.0M weekly downloads
- [postcss-merge-idents](https://npm.io/package/postcss-merge-idents.md) — 1.7M weekly downloads
- [@fontsource/noto-sans](https://npm.io/package/@fontsource/noto-sans.md) — 93.0K weekly downloads
- [uglifycss](https://npm.io/package/uglifycss.md) — 71.6K weekly downloads
- [mat4-interpolate](https://npm.io/package/mat4-interpolate.md) — 23.3K weekly downloads

## Recent versions

- 0.3.2 (latest) — 2015-09-01

## README

# PostCSS mqwidth-to-class [![Build Status][ci-img]][ci]

[PostCSS] plugin converts min/max-width media queries to classes, useful for clients that do not support media queries e.g. IE8.

[PostCSS]: https://github.com/postcss/postcss
[ci-img]:  https://travis-ci.org/notacouch/postcss-mqwidth-to-class.svg
[ci]:      https://travis-ci.org/notacouch/postcss-mqwidth-to-class

## Examples

```css
/* Input example */
@media (min-width: 768px) and (max-width: 991px) {
    .foo {
        float: left;
    }
}
```

```css
/* Output example */
.min-width-768px.max-width-991px .foo {
    float: left;
}
```

## Usage

```js
postcss([ require('postcss-mqwidth-to-class') ])
```

See [PostCSS] docs for examples for your environment.

## Notes

* Only supports `px` units.
* Ignores anything else in the query, e.g. screen, print, orientation.
* You'd need JavaScript to add the classes to the `<html>` or `<body>` tags. E.g. [mqwidth-to-class.js](https://github.com/notacouch/mqwidth-to-class).
* For IE8, off the bat you can have the `<html>` tag via conditional comments.

## Credit

I used the [PostCSS Boilerplate](https://github.com/postcss/postcss-plugin-boilerplate) and these two projects as a base:
* [CSS MQPacker](https://github.com/hail2u/node-css-mqpacker)
* [PostCSS Media Minmax](https://github.com/postcss/postcss-media-minmax)

## [Changelog](CHANGELOG.md)

## [License](LICENSE)

---
_Source: https://npm.io/package/postcss-mqwidth-to-class · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
