Find all CSS styles used on website

半世苍凉 提交于 2019-12-04 08:07:38

问题


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?


回答1:


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




回答2:


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.



来源:https://stackoverflow.com/questions/1795735/find-all-css-styles-used-on-website

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!