# rwdcss

> Generate responsive CSS classes

Latest version **3.0.0** (published 2016-04-29) · MIT license · 0 weekly downloads

## Install

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

## 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 | 3.0.0 |
| Published | 2016-04-29 |
| First published | 2016-01-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Craig Dennis |
| Maintainers | craigmdennis |
| Keywords | css, rwd, responsive, BEM, BEMIT, modular, scalable, eyeglass-module |

## Links

- npm: https://www.npmjs.com/package/rwdcss
- Repository: https://github.com/craigmdennis/rwdcss
- Homepage: https://github.com/craigmdennis/rwdcss#readme
- Issues: https://github.com/craigmdennis/rwdcss/issues
- npm.io page: https://npm.io/package/rwdcss

## 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

- 3.0.0 (latest) — 2016-04-29
- 2.1.1 — 2016-04-29
- 2.1.0 — 2016-04-29
- 2.0.1 — 2016-04-04
- 2.0.0 — 2016-04-04
- 1.1.0 — 2016-01-15
- 1.0.4 — 2016-01-10
- 1.0.1 — 2016-01-10

## README

# RWD
Generate responsive CSS classes using a single SCSS mixin and a variable map

[Edit on CodePen](http://codepen.io/craigmdennis/pen/Qydewy)

## Installation
Downaload and `@import` into your main `scss` file

### Create breakpoints
The current syntax is set up to use Bourbon Neat's `media` Breakpoint's `breakpoint` mixin.
```scss
$breakpoints: (
  mobile: max-width 47.9375em,
  tablet: 48em,
  hd: 62em
);
```

### Call the mixin
This will output content with the base class name as well as any breakpoints specified.
```scss
.component {
  @include rwd( mobile tablet hd ) {
    color: white;
    background: black;
  }
}

// .component {}
// .component--MQmobile {}
// .component--MQtablet {}
// .component--MQhd {}
```
If you only want a specific breakpoint and *no* base class, pass `false` as the second argument
```scss
.component {
  @include rwd( mobile, false ) {
    color: white;
    background: black;
  }
}

// .component--MQmobile {}
```

### Global settings
If you want to change the prefix you can add a settings map to your variables file

```scss
$rwdcss: (
  prefix: \@
);

// Default is "---MQ"
```

NOTE: Don't include the backslash in the HTML; it is purely to escape that character in CSS / SCSS
```scss
.component {
  @include rwd( mobile, true ) {
    color: white;
    background: black;
  }
}

// .component\@mobile {}
// <div class="component@mobile">This is only black <b>upto 48em</b></div>
```


### Use the classes
```html
<div class="component">This is always black</div>
<div class="component---MQmobile">This is only black <b>upto 48em</b></div>
<div class="component---MQtablet">This is only black at <b>48em wide</b></div>
<div class="component---MQhd">This is only black at <b>62em wide</b></div>
```

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