# rework-selector-rename

> Rename selectors based on array of match/replace pairs.

Latest version **0.1.0** (published 2015-02-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install rework-selector-rename
pnpm add rework-selector-rename
yarn add rework-selector-rename
bun add rework-selector-rename
```

## 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.0 |
| Published | 2015-02-12 |
| First published | 2015-02-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Jacob Lane |
| Maintainers | jacoblane |
| Keywords | rework, css |

## Links

- npm: https://www.npmjs.com/package/rework-selector-rename
- Repository: https://github.com/jacoblane/rework-selector-rename
- Issues: https://github.com/jacoblane/rework-selector-rename/issues
- npm.io page: https://npm.io/package/rework-selector-rename

## 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.0 (latest) — 2015-02-12

## README

rework-selector-rename
======================

Rename css selectors based on an input array of match/replace pairs.

Input css:

```css
.black {
  color: black;
}
.u-left {
  float: left;
}
.fontSize-large {
  font-size: 30px;
}
```

```js
var rename = require('rework-selector-rename');

var replacements = [
    [".black", ".color-black"]
  , [ /^\.u-/, "."]
  , [ /[A-Z]/g, function(m) { return '-' + m.toLowerCase() }]
];

var css = rework()
  .use(rename(replacements))
  .toString();
```

Result:

```css
.color-black {
  color: black;
}
.left {
  float: left;
}
.font-size-large {
  font-size: 30px;
}
```

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