cssmin: CSS Minification Library (ported from Minify) - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: cssmin: CSS Minification Library (ported from Minify) (/showthread.php?tid=15001) |
cssmin: CSS Minification Library (ported from Minify) - El Forum - 01-23-2009 [eluser]tonydewan[/eluser] Similar to the JSMin port I did, this is a CSS minification library ported from the awesome Minify App. Basically, I took the Minify_CSS component class and added a simple wrapper class to make it play nice with CodeIgniter. The library expects a string and returns a string. You load the library as normal: Code: $this->load->library('cssmin'); Minify a string like so: Code: $this->cssmin->minify( file_get_contents('styles.css') ); There are two options: preserveComments Boolean flag for preserving comments. Only comments starting with /*! are preserved. Defaults to true. relativePath String that will be prepended to all relative URIs in import/url declarations. Defaults to null. The options can either be set globally using the config function: Code: $cssmin_options = array( Or on individual calls to the minify function: Code: $this->cssmin->minify( $string, FALSE, $path ); Global settings override settings in individual calls. Note: just like the jsmin library, cssmin is PHP5. cssmin: CSS Minification Library (ported from Minify) - El Forum - 01-28-2009 [eluser]tonydewan[/eluser] New version: nothing has really changed. I just updated documentation to be more accurate, and added some notes on usage. cssmin: CSS Minification Library (ported from Minify) - El Forum - 01-28-2009 [eluser]tonydewan[/eluser] I've used this library in a full fledged asset management library called Carabiner. Check it out! cssmin: CSS Minification Library (ported from Minify) - El Forum - 03-03-2012 [eluser]bobbob[/eluser] I know this is an old post but is his library still available as the link to the zip is no longer working? Hoping to making use of carabiner. cssmin: CSS Minification Library (ported from Minify) - El Forum - 05-21-2012 [eluser]kolxoznik1[/eluser] no one download link do not work ( Please upload library cssmin: CSS Minification Library (ported from Minify) - El Forum - 05-21-2012 [eluser]kanjimaster[/eluser] You can get it from github. |