CSS file can be compressed by YUI compressor of Yahoo.
I used to use v2.4.2 to do it. Now I saw YUI compressor 2.4.7 released.
Let me see how big difference of them.
One normal CSS file, which can be easy to read and edit.
File size 74,032
I use 2.4.2 to compress it. I got a file size 49,943
I use 2.4.7 to compress it. I got a file size 49,164 (2% less of 2.4.2)
Look at the release notes below, there are not many big changes of it. Most of them are fixs.
Yes. New version did make the file smaller.
Now, it is 66% of the original CSS file.
YUI Compressor 2.4.7
+ Handle data urls without blowing up Java memory (regex)
+ Updated docs to reflect Java >= 1.5 required for CssCompressor
+ Fixed issue where we were breaking #AABBCC id selectors, with the
#AABBCC -> #ABC color compression.
YUI Compressor 2.4.6
+ Show usage information when started without arguments.
YUI Compressor 2.4.5
+ Default file encoding changed from system default to UTF-8.
+ Errors/messages/usage info all are sent to stderr.
+ Removed unnecessary warning about short undeclared global symbols.
+ Added support for processing multiple files with a single invokation
+ $ in CSS files doesn’t throw exceptions
+ white space in ! important comments preserved in CSS
+ fix in greedy empty CSS declaration blocks removal
+ safe handling of strings and comments in CSS files
+ shorter alpha opacity CSS filers
+ shorter Mac/IE5 hack -> /*\*/ hack {mac: 1} /**/
+ JS port of the CSS minifier
+ safe @media queries handling
+ stripping the trailing ; in CSS declaration blocks
+ shorter border:none->0 where applicable
+ fixed transform-origin: 0 0 [bug 2528060]
+ tests++
YUI Compressor 2.4.4
+ Interim 2.4.5 release
YUI Compressor 2.4.3
+ Changed custodian to ci-tools@

To download the YUI compressor.

David Yin

David is a blogger, geek, and web developer — founder of FreeInOutBoard.com. If you like his post, you can say thank you here

Leave a Reply

Your email address will not be published. Required fields are marked *