News for hackers. Stuff that matters.
Re:Mincss "clears the junk out of your CSS" by junto on Tuesday January 22, 2013 @06:21AM (#5096566)
I've been looking for something like this, but with support for styles added using JavaScript. I have found anything yet, and it doesn't appear that this would do it either?
Re:Mincss "clears the junk out of your CSS" by oyvindeh on Tuesday January 22, 2013 @06:32AM (#5096585)
I started a similar project before Christmas. It has a whitelist feature, where you can list styles added using JavaScript. It may not be the perfect approach, but it's at least one way of getting around the problem.

It also supports lists of HTML and CSS files to search through. It can perform login, find duplicates, list used rules as well as unused rules, as well as count how many times each rule is matched in the markup.

Requires Node, can be installed with npm.

https://github.com/operasoftware/ucss

Re:Mincss "clears the junk out of your CSS" by junto on Monday January 28, 2013 @06:01AM (#5128027)
The only thing I could think of was to have some kind of browser extension, that works something like this:

  1. Start the extension scan

  2. Scan all external CSS currently in use (page load)

  3. Scan all inline CSS currently in use (page load)

  4. Monitor (this is the missing piece of the puzzle): Developer uses the app and extension monitors new AJAX or JavaScript added CSS rules

  5. Developer clicks a Finish and Report button:

    a) Warning for inline CSS that could be moved externally

    b) Warning for external CSS that is never used

    c) Export (per CSS file, or combined and minified) CSS files, with unused CSS removed.