Skip to content

bfiessinger/purgecss-with-Gutenberg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Purgecss with Gutenberg

purgecss whitelist for the WordPress Gutenberg editor.

Getting started

Installation First install purgecss.

npm i --save-dev purgecss-with-gutenberg

Usage

import Purgecss from 'purgecss';
import purgecssGutenberg from 'purgecss-with-gutenberg';

const purgeCss = new Purgecss({
	whitelist: purgecssGutenberg.whitelist,
	whitelistPatterns: purgecssGutenberg.whitelistPatterns
});

const res = purgeCss.purge();

if you have additional classes for whitelist or whitelistPattners, you can use the spread operator:

whitelist: [
	...purgecssGutenberg.whitelist,
	...thirdparty.whitelist,
	'my-class'
],
whitelistPatterns: [
	...purgecssGutenberg.whitelistPatterns,
	...thirdparty.whitelistPatterns,
	/^my-(class|id)$/
]