You are here

function advagg_css_compress_yui_cssmin in Advanced CSS/JS Aggregation 6

Same name and namespace in other branches
  1. 7.2 advagg_css_compress/advagg_css_compress.advagg.inc \advagg_css_compress_yui_cssmin()

Use the CSSmin library from YUI to compress the CSS.

1 call to advagg_css_compress_yui_cssmin()
advagg_css_compress_advagg_css_alter in advagg_css_compress/advagg_css_compress.module
Implement hook_advagg_css_alter.

File

advagg_css_compress/advagg_css_compress.module, line 165
Advanced aggregation css compression module.

Code

function advagg_css_compress_yui_cssmin(&$contents) {

  // Include CSSmin from YUI.
  $filename = drupal_get_path('module', 'advagg_css_compress') . '/yui/CSSMin.inc';
  include_once $filename;
  $cssmin = new CSSmin();

  // Compress the CSS splitting lines after 4k of text
  $contents = $cssmin
    ->run($contents, 4096);
}