Minifies CSS requirements using Minify (http://code.google.com/p/minify/)
This module replaces part of the Requirements system to compress CSS files using http://code.google.com/p/minify/.
The idea and implementation are basically stolen from Tonyair (http://www.silverstripe.org/general-questions/show/14206)
Nathan Cox ([email protected])
Check out the SS-3.0 branch for a version compatible with SS 3.0
The module will automatically replace the Requirements backend with a custom subclass, so you don't need to do anything differently.
Just use combine_files to include your CSS as normal:
<?php $themeFolder = $this->ThemeDir(); $files = array( $themeFolder . '/css/layout.css', $themeFolder . '/css/typography.css', $themeFolder . '/css/form.css' ); Requirements::combine_files("common.min.css", $files);
By default relative urls in the CSS files (eg background-image:url('../images/background.png');) will be rewritten so the combined CSS file can be kept in assets (eg to background-image:url('/themes/mytheme/images/background.png');) but you can turn this behaviour off by putting the following line in your _config.php:
<?php Config::inst()->update('Minify_Requirements_Backend', 'rewrite_uris', false);
Module rating system helping users find modules that are well supported. For more on how the rating system works visit Module standards
Score not correct? Let us know there is a problem