# postcss-class-repeat

> Repeat class selectors to increase specificity

Latest version **0.1.1** (published 2017-11-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install postcss-class-repeat
pnpm add postcss-class-repeat
yarn add postcss-class-repeat
bun add postcss-class-repeat
```

## 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.1.1 |
| Published | 2017-11-06 |
| First published | 2016-03-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 (+6 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 3 |
| Author | John Otander |
| Maintainers | johno |
| Keywords | class, css, repeat, specificity, postcss, postcss-plugin |

## Links

- npm: https://www.npmjs.com/package/postcss-class-repeat
- Repository: https://github.com/johnotander/postcss-class-repeat
- Homepage: https://github.com/johnotander/postcss-class-repeat#readme
- Issues: https://github.com/johnotander/postcss-class-repeat/issues
- npm.io page: https://npm.io/package/postcss-class-repeat

## Dependencies (4)

- [postcss](https://npm.io/package/postcss.md) ^5.0.19
- [is-present](https://npm.io/package/is-present.md) ^1.0.0
- [class-repeat](https://npm.io/package/class-repeat.md) ^1.0.2
- [has-class-selector](https://npm.io/package/has-class-selector.md) ^1.0.0

## 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.1.1 (latest) — 2017-11-06
- 0.1.0 — 2016-03-03

## README

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

Repeat class selectors to increase specificity, useful for using utility classes with legacy codebases with high specificity

## Installation

```bash
npm install --save postcss-class-repeat
```

## Usage

```javascript
var postcss = require('postcss')
var classRepeat = require('postcss-class-repeat')

postcss([ classRepeat() ]).process(myCss).css
```

#### Input

```css
.foo.bar,
.baz:before {
  color: tomato;
}

.hello > .world {
  background-color: tomato;
}

@media screen and (min-width: 123em) {
  .yay { color: red; }
}
```

#### Output

```css
.foo.foo.bar.bar,
.baz.baz:before {
  color: tomato;
}

.hello.hello > .world.world {
  background-color: tomato;
}

@media screen and (min-width: 123em) {
  .yay.yay { color: red; }
}
```

##### Options

- `repeat`: Number, amount of times to repeat the class selectors. Default: `2`

###### Using custom options

```javascript
var postcss = require('postcss')
var classRepeat = require('postcss-class-repeat')

postcss([ classRepeat({ repeat: 4 }) ]).process(myCss).css
```

```css
.foo.foo.foo.foo.bar.bar.bar.bar,
.baz:before.baz:before.baz:before.baz:before {
  color: tomato;
}

.hello.hello.hello.hello > .world.world.world.world {
  background-color: tomato;
}

@media screen and (min-width: 123em) {
  .yay.yay.yay.yay { color: red; }
}
```

## Related

* <https://github.com/johnotander/class-repeat>

## 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/postcss-class-repeat · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
