The Advanced CSS/JS Aggregation module offers quite a bit. hook_advagg_css_pre_alter() is the hook to use in order to do this. The nice thing about doing it this way is it's cached so you don't get a performance hit for using the hook on subsequent requests.

/**
 * Implement hook_advagg_css_pre_alter.
 */
function advagg_advagg_css_pre_alter(&$css, $preprocess_css, $public_downloads) {
  foreach ($css as $media => $types) {
    foreach ($types as $type => $files) {
      foreach ($files as $file => $preprocess) {
        if (_unset_css_match($file)) {
          unset($css[$media][$type][$file]);
        }
      }
    }
  }
}

Comments

kaleworsley’s picture

Status: Active » Fixed

Added the hook in http://drupal.org/commitlog/commit/30432/5077f85a834a4c14e2cf4b008344fe7....

Advanced CSS/JS Aggregation is an awesome module by the way. Great work!

Cheers,
Kale

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.