what is a good cross-platform css compressor?

南笙酒味 提交于 2020-01-02 06:53:08

问题


i need to compress my css as part of my ant build. i noticed that csstidy does this, but it would not be easy to include this in my ant build because i would need to use a different binary on different platforms.

so, is there a java css compressor that people use?


回答1:


Check out the Yahoo YUI compressor.

It compresses CSS as well as Javascript, and it's written in Java.

Edit: You should be using some sort of HTTP compression as well, like mod_deflate or mod_gzip.




回答2:


I recently released CSS Compressor. It's a code fork of YUI Compressor, but adds more compression enhancements that make it more similar to csstidy, particularly with regards to grouping selectors that share the same rules. Obviously it's Java, and can be called via the command-line or used as a library within your own Java app.



来源:https://stackoverflow.com/questions/183434/what-is-a-good-cross-platform-css-compressor

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