Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lbrian/postcss-class-rename
PostCSS plugin simply replaces string without hassle
https://github.com/lbrian/postcss-class-rename
css postcss postcss-plugin postcss-plugins rollup webpack webpack-loader
Last synced: 28 days ago
JSON representation
PostCSS plugin simply replaces string without hassle
- Host: GitHub
- URL: https://github.com/lbrian/postcss-class-rename
- Owner: LBrian
- License: mit
- Created: 2019-02-12T03:54:24.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-01-13T06:31:48.000Z (almost 3 years ago)
- Last Synced: 2024-10-05T09:58:13.353Z (about 1 month ago)
- Topics: css, postcss, postcss-plugin, postcss-plugins, rollup, webpack, webpack-loader
- Language: JavaScript
- Size: 6.84 KB
- Stars: 6
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# postcss-class-rename
[PostCSS] plugin to replace class name by giving key-value mapping in options.---
[postcss]: https://github.com/postcss/postcss## Installation
```
npm install postcss-class-rename --save-dev
```## Usage
### rollup
```
postcss({
plugins: [
require('autoprefixer'),
require('postcss-class-rename')({
// replace 'button-' in class name to 'btn-'
button-: 'btn-',
// All options are treated as replacement mapping
...
})
]
}),```
### postcss.config.js
```
const rename = require('postcss-class-rename');module.exports = ({ env }) => {
plugins: [
rename({
// All options are treated as replacement mapping
button-: 'btn-',
...
})
]
}
```