remove unused css selectors
Last updated 8 years ago by brianleroux .
Repository · Original npm · Tarball · package.json
$ cnpm install css-slap-chop 
SYNC missed versions from official npm registry.

CSS Slap Chop!

Findin' unused css selectors in your html, slappin' them around, and choppin' em out.


  1. Love. You must love the Pandas.
  2. NodeJS. You must install NodeJS.


npm install -g css-slap-chop

Use it

There is a Command Line Interface tool. Don't be bummed! The CLI is the most powerful interface of all.


That was fun! No problem. Now we can go and get CSS Slap Chop to show us a more friendly CSS document.

css-slap-chop -css ./app.css -html ./index.html

Cool! If you want to create a file just use some UNIX IO redirect magic.

css-slap-chop -css ./app.css -html ./index.html > ./tidy.css



Oh no! It fucking removed the stuff I add dynamically with captain AJAX what will I do?

Chill bitch! CSS Slap Chop can optionally take a JSON file contiaining selectors you want it to ignore. 

Hack it

The CSS Slap Chop can be accessed as a lib in NodeJS.

var csc = require('css-slap-chop')
csc.tidy({css:path_to_css, html:path_to_html, ignore:path_to_ignore_json}, function(err, css) {
    if (err) throw err

Current Tags

  • 0.1.1                                ...           latest (8 years ago)

2 Versions

  • 0.1.1                                ...           8 years ago
  • 0.1.0                                ...           8 years ago
Maintainers (1)
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 2
Dependencies (5)
Dev Dependencies (1)
Dependents (2)

Copyright 2014 - 2017 © taobao.org |