remove unused selectors from your css
JavaScript Ruby
Latest commit 62a2ebf Feb 14, 2013 @brianleroux Merge pull request #4 from jamsajones/master
Awesome thank you! Fix issue with pseudo selector replacement failure.
Permalink
Failed to load latest commit information.
bin with love from germany May 27, 2012
test
.gitignore
README.md
css-slap-chop.js Fixed crash on pseudo selectors other than :hover Feb 14, 2013
jquery.js with love from germany May 27, 2012
package.json bumped version and added binary May 27, 2012

README.md

CSS Slap Chop!

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

Prequeisits

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

Install

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.

css-slap-chop

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

Gnar.

FAQ

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
    console.log(css)        
})