开发者

How to remove unused CSS class in my product?

开发者 https://www.devze.com 2022-12-12 10:42 出处:网络
I just want开发者_StackOverflow to remove an unused CSS class in my product. It\'s not a HTML file. It has .jsp XML and .js files. There is a lot of unused classes in my product. Removing them manuall

I just want开发者_StackOverflow to remove an unused CSS class in my product. It's not a HTML file. It has .jsp XML and .js files. There is a lot of unused classes in my product. Removing them manually is taking a long time. Dust-Me Selectors is a Firefox add-on tool. It's showing only the current page. It's suitable for only HTML files. Mine are all dynamic pages.

What is an efficient way to remove the unused CSS classes?


Dust-Me Selectors actually will work great for this purpose. It goes through all of the code for a page and outputs all of the code that is not being used. To automate this you need to have Java installed, then go to this page http://jclaim.sourceforge.net/running.htm and click to start the client.

Once you have this running go General > Handy Tools > Clean CSS

It outputs your fresh CSS code without all of the unused selectors. Just backup your old CSS file and replace it with the new stripped down one.

There is also the Stack Overflow post "How can I remove unused CSS classes from my website project?" which might help.

0

精彩评论

暂无评论...
验证码 换一张
取 消