JSPM

  • Created
  • Published
  • Downloads 38677
  • Score
    100M100P100Q143809F
  • License MIT

Removed unused css. Compatible with single-page apps.

Package Exports

  • purify-css

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (purify-css) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

PurifyCSS

A tool that removes CSS that you aren't using in your app, which results in smaller file sizes, which ultimately reduces load time.

  1. Check which classes you use in your HTML or Javascript.
  2. Filter out your CSS file with only the classes that you do use.
  3. ??
  4. Profit

Install

npm install purify-css

API

var purify = require('purify-css');

purify(content, css, options);

content

Type: Array or String

Array of filepaths to the files you want purify to search through for used classes (HTML, Javascripts, Templates, anything)

String of content you want us to look for used classes.

css

Type: Array or String

Array of filepaths to the css files you want us to filter.

String of css you want us to filter.

##options

Type: Object
Properties of options object:
  • minify: Set to true to minify. Default: false

  • output: Filepath to write purified css to. Returns raw string if false. Default: false

  • info: Logs info on how much css was removed if true. Default: false