https://github.com/FullHuman/purgecss-with-wordpress
Purgecss with wordpress
https://github.com/FullHuman/purgecss-with-wordpress
Last synced: about 1 year ago
JSON representation
Purgecss with wordpress
- Host: GitHub
- URL: https://github.com/FullHuman/purgecss-with-wordpress
- Owner: FullHuman
- License: mit
- Archived: true
- Created: 2018-02-11T11:10:24.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-10-22T20:31:11.000Z (over 6 years ago)
- Last Synced: 2024-12-27T02:02:56.848Z (over 1 year ago)
- Language: JavaScript
- Size: 10.7 KB
- Stars: 29
- Watchers: 7
- Forks: 10
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Purgecss with Wordpress
Based on the [gist](https://gist.github.com/frnwtr/5647673bb15ca8893642469d3b400cba) made by @frnwtr, `purgecss-with-wordpress` is a set of templates for
Wordpress CMS.
## Getting Started
#### Installation
You need to install [purgecss](https://github.com/FullHuman/purgecss) first.
Install `purgecss-with-wordpress`:
```sh
npm i --save-dev purgecss-with-wordpress
```
## Usage
```js
import Purgecss from 'purgecss'
import purgecssWordpress from 'purgecss-with-wordpress'
const purgeCss = new Purgecss({
content: ['**/*.html'],
css: ['**/*.css'],
whitelist: purgecssWordpress.whitelist,
whitelistPatterns: purgecssWordpress.whitelistPatterns
})
const result = purgecss.purge()
```
If you have additional classes you want to include in either of the `whitelist` or `whitelistPatterns`, you can include them using the spread operator:
```js
whitelist: [
...purgecssWordpress.whitelist,
'red',
'blue',
],
whitelistPatterns: [
...purgecssWordpress.whitelistPatterns,
/^red/,
/blue$/,
]
```
## Versioning
Purgecss-with-wordpress use [SemVer](http://semver.org/) for versioning.
## Acknowledgment
Purgecss-with-wordpress is based on the [gist](https://gist.github.com/frnwtr/5647673bb15ca8893642469d3b400cba) made by @frnwtr
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
for details.