till / cssmin

Automatically exported from code.google.com/p/cssmin
0 stars 0 forks source link

Plugin to order properties to optimize GZip compression #7

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi,

What would be very nice is to return the css with the properties ordered in 
alphbetical order. This will help to reduce the size of the file once 
gzipped.

Best regards

Daniel

Original issue reported on code.google.com by daniel.k...@gmail.com on 1 Sep 2009 at 1:51

GoogleCodeExporter commented 8 years ago

Original comment by joe.scylla on 6 Aug 2010 at 1:08

GoogleCodeExporter commented 8 years ago

Original comment by joe.scylla on 13 Jul 2011 at 9:25

GoogleCodeExporter commented 8 years ago
I believe the attached plugin re-orders properties as desired; it probably is a 
bit too cautious as I don't *quite* follow exactly what cssmin is doing, or the 
edge cases it might have to cope with, but it works for me :)  Doesn't make an 
enormous difference to my CSS file when gzipped (~1%) but this will vary hugely 
by the contents of your CSS file.

Enable by adding 'ReorderRulesForGzip'=>true to your filter configuration array.

Cheers!

Original comment by rowanb@gmail.com on 2 Aug 2011 at 6:05

GoogleCodeExporter commented 8 years ago
And here's the attached plugin without two obvious strict-mode errors :)

Original comment by rowanb@gmail.com on 2 Aug 2011 at 9:43

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks for you contribution rowanb. I will have a look on you plugin soon and 
will add it to the CssMin source if you permit it (with proper credits for 
sure).

Original comment by joe.scylla on 3 Aug 2011 at 6:37

GoogleCodeExporter commented 8 years ago
If you're happy with it of course you can add it - if so, credit to Rowan 
Beentje / <a href="http://assanka.net">Assanka</a> please :)

Original comment by rowanb@gmail.com on 3 Aug 2011 at 7:11

GoogleCodeExporter commented 8 years ago
Fixed in Version 3.0.1 (Revision #163)

See: http://code.google.com/p/cssmin/wiki/WhatsNewVersion301

Original comment by joe.scylla on 19 Aug 2011 at 10:25

GoogleCodeExporter commented 8 years ago
Cool - thanks! :)

It might be worth updating 
http://code.google.com/p/cssmin/wiki/MinifierFilterSortRulesetProperties to fix 
the example (silver to #000) and mention that it improves gzip compression :)

Original comment by rowanb@gmail.com on 19 Aug 2011 at 10:35

GoogleCodeExporter commented 8 years ago
Good point; will do ;)

Original comment by joe.scylla on 19 Aug 2011 at 1:43