Community & Support

Force ignoring Core, Contrib module CSS files for aggregation?

Just wondering if it's possible to force the Drupal to ignore the core and contrib CSS files, since I do not use them in my themes (have a preprocess override to nix them). The only CSS I wish to use is defined in the theme .info files. The aggregator/compressor currently disregards my theme settings and will aggregate all core and contrib css. Is there any way do avoid this?

I'm using the following snippet in my main theme (called mrt) to remove all unneeded CSS

<?php
function mrt_preprocess(&$vars, $hook) {
 
$css = $vars['css'];
  unset(
$css['all']['module']);
 
$vars['styles'] = drupal_get_css($css);
}
?>

However the aggreagator will still include core css, bulking the compressed CSS files. I'm guessing I need to go higher than the theme level?

Comments

Do I need to create a module

Do I need to create a module to override drupal_get_css ?

The call to drupal_get_css(),

The call to drupal_get_css(), whats your data structure of $css? Does it match up with drupal_add_css outputs?

It does, since it uses the

It does, since it uses the default call's organisation.

For some reason it started working how I wish, but I can't figure out what I did to make that occur. It may have been something as simple as clearing the theme cache.