Skip to content

huubl/purgecss-with-wordpress

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 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:

whitelist: [
  ...purgecssWordpress.whitelist,
  'red',
  'blue',
],
whitelistPatterns: [
  ...purgecssWordpress.whitelistPatterns,
  /^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.

About

Purgecss with wordpress

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%