purgecss-with-gutenberg

1.0.2 • Public • Published

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)$/
]

Package Sidebar

Install

npm i purgecss-with-gutenberg

Weekly Downloads

72

Version

1.0.2

License

GPL-3.0-or-later

Unpacked Size

38.7 kB

Total Files

4

Last publish

Collaborators

  • bfiessinger