1.1.0 • Published 6 years ago

postcss-purifycss v1.1.0

Weekly downloads
25
License
MIT
Repository
github
Last release
6 years ago

postcss-purifycss

npm version node

Clean unnecessary CSS with PurifyCSS

Features

  • Easily integrates PurifyCSS with postcss
  • Allows you to use any PurifyCSS options
  • Ignore a line or whole chunks of code, exactly like with uncss

    /* purifycss:ignore */
    .selector1 {
      /* this rule will be ignored */
    }
    
    .selector2 {
      /* this will NOT be ignored */
    }
    
    /* purifycss:ignore start */
    
    /* all rules in here will be ignored */
    
    /* purifycss:ignore end */

    – taken from UnCSS example

Usage

An example of how to use this module:

const purify = require('postcss-purifycss');

postcss([
  purify({
    content: [],
    whitelist: [],
    purifyOptions: {
      info: false,
      rejected: false,
      whitelist: [],
    }
  }),
]);

Options

OptionRequiredDescription
contentThe PurifyCSS content argument
whitelistA whitelist using Regular Expressions
purifyOptionsThe optional PurifyCSS options argument

Credits

Credits to UnCSS (MIT) for the ignoring code and the foundation of a PostCSS plugin.