如何删除产品中未使用的CSS类? [英] How to remove unused CSS class in my product?

查看:48
本文介绍了如何删除产品中未使用的CSS类?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只想删除产品中未使用的CSS类.这不是HTML文件.它具有.jsp XML和.js文件.我的产品中有很多未使用的类.手动删除它们需要很长时间. Dust-Me Selectors 是Firefox的附加工具.它仅显示当前页面.仅适用于HTML文件.我的都是动态页面.

I just want 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.

删除未使用的CSS类的有效方法是什么?

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

推荐答案

Dust-Me选择器实际上可以很好地实现此目的.它遍历页面的所有代码,并输出所有未使用的代码.要使其自动化,您需要安装Java,然后转到此页面 http://jclaim.sourceforge.net/running.htm ,然后单击以启动客户端.

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.

一旦运行此命令,请转到常规>便捷工具>清洁CSS

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

它输出您的新鲜CSS代码,而不包含所有未使用的选择器.只需备份您的旧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.

也有Stack Overflow帖子"如何从网站项目中删除未使用的CSS类?"可能会有所帮助.

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

这篇关于如何删除产品中未使用的CSS类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆