6.0.0 • Published 1 month ago

purgecss-with-wordpress v6.0.0

Weekly downloads
1,752
License
MIT
Repository
github
Last release
1 month ago

PurgeCSS with Wordpress

Based on the gist made by @frnwtr, purgecss-with-wordpress is a set of templates for Wordpress CMS.

Getting Started

Installation

You need to install PurgeCSS first.

Install purgecss-with-wordpress:

npm i --save-dev purgecss-with-wordpress

Usage

import PurgeCSS from 'purgecss'
import purgecssWordpress from 'purgecss-with-wordpress'

const purgeCSSResults = await new PurgeCSS().purge({
  content: ['**/*.html'],
  css: ['**/*.css'],
  safelist: purgecssWordpress.safelist,
  safelistPatterns: purgecssWordpress.safelistPatterns
})

If you have additional classes you want to include in either of the safelist or safelistPatterns, you can include them using the spread operator:

safelist: [
  ...purgecssWordpress.safelist,
  'red',
  'blue',
],
safelistPatterns: [
  ...purgecssWordpress.safelistPatterns,
  /^red/,
  /blue$/,
]

Versioning

Purgecss-with-wordpress use SemVer for versioning.

Acknowledgment

Purgecss-with-wordpress is based on the gist made by @frnwtr

License

This project is licensed under the MIT License - see the LICENSE file for details.

6.0.0

1 month ago

6.0.0-alpha.0

1 year ago

5.0.0

2 years ago

4.1.0

2 years ago

4.0.3

3 years ago

4.0.2

3 years ago

4.0.0

3 years ago

3.1.3

3 years ago

3.0.0

4 years ago

2.3.0

4 years ago

2.1.0

4 years ago

1.1.0

5 years ago

1.0.0

6 years ago