1
votes

Is it possible to remove the module/system/default.css file. I'd like to do this in the .module file and not in the template.php file.

My goal is to disable this style in my drupal website without manipulating a template/theme.

Is it possible?

Thanks in advance,

Bat

1

1 Answers

5
votes

This is possible. You can use template_preprocess_page in your custom module to whack Drupal's default CSS:

function mymodule_preprocess_page(&$vars) {
  // Get CSS array and remove selected stylesheets
  $css = drupal_add_css(); 
  unset($css['all']['module']['modules/system/defaults.css']);

  // Override Drupal styles
  $vars['styles'] = drupal_get_css($css);
}

Because of Drupal's architecture, you'll almost certainly need to set the module weight to something greater than your other installed modules to ensure that your preprocessor runs last and no other module will be adding CSS.