Skip to content

dsevillamartin/postcss-purifycss

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 

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

Option Required Description
content The PurifyCSS content argument
whitelist A whitelist using Regular Expressions
purifyOptions The optional PurifyCSS options argument

Credits

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

About

Clean unnecessary CSS with PurifyCSS

Resources

Stars

Watchers

Forks

Packages

No packages published