8000 GitHub - hebuliang/purifycss: Remove unused CSS. Also works with single-page apps.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Remove unused CSS. Also works with single-page apps.

License

Notifications You must be signed in to change notification settings

hebuliang/purifycss

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Infomation

This project forked from purifycss for supportting LESS file.

Run

Clone this repo to your local machine for examle /Users/x/dev/, then go to your own project which you want to optimize, run:

cd your-project/

node /Users/x/dev/purifycss/bin/purifycss <css> <content> --option

API

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

purify(content, css, options, callback);

content

Type: Array or String

Array of filepaths to the files you want to search through for used classes (HTML, JavaScript, Templates, anything that relates to CSS classes)

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 (optional)

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.

  • rejected: Logs the CSS rules that were removed if true. Default: false

About

Remove unused CSS. Also works with single-page apps.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 94.3%
  • CSS 5.2%
  • HTML 0.5%
0