This simple little php script (less than 50 lines!) takes a list of your css files that you use on every page of your design, combines them and minifies them. This accomplishes 2 things: it cuts your http requests for css files to 1 and it cuts the size of the request considerably.
I’m using CSS Combine on the blog template, if you look in my code you’ll see I’m only calling one style sheet, even though there are actually 4 needed for the full style- including 1 sheet for the jQuery plugin fancybox. Together those sheets amount to 16.5 kb, but with CSS Combine they come in at 9.8kb!
Now you can keep your css organized and readable, without that guilty, unoptimized feeling! And hey, if you wanna take your optimization to the extreme, you can call your one super css file 0.css.
- Download it
- add the line to your htaccess
- add your css files you wanna combine
- specify your css directory
- rock out.
Download from Google Code