Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find all CSS styles used on website

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?

like image 632
Dave Anderson Avatar asked Nov 25 '09 09:11

Dave Anderson


2 Answers

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

like image 61
Ikke Avatar answered Sep 28 '22 02:09

Ikke


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.

like image 22
arturopuente Avatar answered Sep 28 '22 01:09

arturopuente