# mqify

> Turn a css string and media query config into classes for each breakpoint

Latest version **1.1.0** (published 2021-01-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install mqify
pnpm add mqify
yarn add mqify
bun add mqify
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2021-01-23 |
| First published | 2017-11-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 6.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Author | John Otander |
| Maintainers | johno |
| Keywords | css, responsive, functional, atomic, media, query |

## Links

- npm: https://www.npmjs.com/package/mqify
- Repository: https://github.com/johnotander/mqify
- npm.io page: https://npm.io/package/mqify

## Dependencies (6)

- [postcss](https://npm.io/package/postcss.md) ^8.2.4
- [isobject](https://npm.io/package/isobject.md) ^4.0.0
- [is-number](https://npm.io/package/is-number.md) ^7.0.0
- [strip-css-comments](https://npm.io/package/strip-css-comments.md) ^4.1.0
- [postcss-class-prefix](https://npm.io/package/postcss-class-prefix.md) ^0.3.0
- [postcss-class-postfix](https://npm.io/package/postcss-class-postfix.md) ^1.0.0

## Alternatives

- [gamedig](https://npm.io/package/gamedig.md) — 29.3K weekly downloads
- [join-monster](https://npm.io/package/join-monster.md) — 12.8K weekly downloads
- [masked](https://npm.io/package/masked.md) — 5.5K weekly downloads
- [@comunica/actor-query-process-explain-logical](https://npm.io/package/@comunica/actor-query-process-explain-logical.md) — 4.7K weekly downloads
- [@veracity/vui](https://npm.io/package/@veracity/vui.md) — 4.6K weekly downloads

## Recent versions

- 1.1.0 (latest) — 2021-01-23
- 1.0.0 — 2018-11-10
- 0.1.2 — 2018-06-18
- 0.1.1 — 2017-11-04

## README

# mqify [![Build Status](https://secure.travis-ci.org/johno/mqify.svg?branch=master)](https://travis-ci.org/johno/mqify) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard)

Turn a css string and media query config into classes for each breakpoint

## Installation

```bash
npm install --save mqify
```

## Usage

```javascript
var mqify = require('mqify')

mqify(CSS, [24, 32, 46])
```

#### Input

```css
.fl { float: left }
```

#### Output

```css
.fl { float: left }

@media screen and (min-width: 24em) and (max-width: 32em) {
  .fl-md { float: left }
}

@media screen and (min-width: 32em) and (max-width: 64em) {
  .fl-lg { float: left }
}

@media screen and (min-width: 64em) {
  .fl-xl { float: left }
}
```

#### Options

In addition to a breakpoint array, `mqify` accepts a key/value pair or a more complex config.

##### Key/value pair

```js
[
  { medium: 24 },
  { large: 48 }
]
```

##### All the options

```js
[
  {
    med: {
      value: 32,
      prefix: true,
      delimiter: '-',
      minWidth: true
    }
  }
]
```

##### Print query

`mqify` can also construct the `@media print` query:

```js
[
  // Pass a 'print' string
  'print',
  // Or a breakpoint named 'print'
  { print: true }
  // Or a breakpoint named 'print'. Its value will be the query identifier
  { print: 'p'}
]
```

## License

MIT

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

Crafted with <3 by John Otander ([@4lpine](https://twitter.com/4lpine)).

***

> This package was initially generated with [yeoman](http://yeoman.io) and the [p generator](https://github.com/johnotander/generator-p.git).

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