New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

purgecss-with-wordpress

Package Overview
Dependencies
Maintainers
0
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

purgecss-with-wordpress

PurgeCSS with wordpress

7.0.2
latest
Source
npm
Version published
Maintainers
0
Created
Source

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.

Keywords

wordpress

FAQs

Package last updated on 21 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts