The CSS Redundancy Checker. A tool for checking your markup for outdated CSS rules that don’t match any of your HTML. We were discussing the need for something similar to this at Torchbox a few weeks ago.
The CSS Redundancy Checker. A tool for checking your markup for outdated CSS rules that don’t match any of your HTML. We were discussing the need for something similar to this at Torchbox a few weeks ago.
I guess the trick then is to have some kind of naming scheme for rules that apply to dynamically generated markup that won't otherwise exist in your files.
I often put a class of 'dynamic' on the body element when starting to apply JavaScript changes to a document - so I guess this tool could be tweaked to ignore any rules where the selector begins with body.dynamic (for example).
Drew - totally; that's the way we do it at NPG (we put .js-enabled on the body element). Usually, I've been running the script and piping it into Textmate, where I just go through and delete the irrelevant lines with Command-G/Ctrl-Shift-K.
I could add some kind of body-class-ignore functionality, but I'm wary of keeping it fully working.