views:

248

answers:

2

I have a DotNetNuke skin that has a single CSS file over 3,500 lines long. It contains styles for YUI, Telerik, Cluetip as well as the actual customisation of the site. The old developers just kept adding styles and never cleaned up the old unused ones.

I want to cleanup the file and get it to a more managable size. I first thought about scanning through the code base but this is 5,500 files with a mixture of CSS applied in the .aspx, .ascx and .cs files as well as jQuery aplying styles sometimes from generated code and sometimes from js files. Some styles are applied with class selectors and others with id selectors.

Is there a way I can easily check just which styles the website actually needs across all of its pages? Is there some crawler that could do this?

+8  A: 

For firefox there is an add-in called dust-me-selectors. If you provide a sitemap, it will find all unused css styles.

Ikke
Really great tool, just what I needed, and another good reason to sort out my sitemap!
Dave Anderson
dust-me-selectors -- Cool been looking for something along these lines
PurplePilot
+1  A: 

If you run dust-me-selectors, remember to run it in every page of your website so you don't delete any styles that are actually used.

arturopuente
If you give a sitemap, it will spider all those pages.
Ikke
I didn't know that, thanks a lot!
arturopuente