css-slap-chop
remove unused css selectors
Last updated 7 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.

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)        
})

Current Tags

  • 0.1.1                                ...           latest (7 years ago)

2 Versions

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

Copyright 2014 - 2017 © taobao.org |