Skip to content

Instantly share code, notes, and snippets.

@egil
Created January 15, 2012 17:14
Show Gist options
  • Save egil/1616481 to your computer and use it in GitHub Desktop.
Save egil/1616481 to your computer and use it in GitHub Desktop.
Drupal: Removes all stylesheets except those added by the theme. Should be added to your template.php file. More info can be found here: http://api.drupal.org/api/drupal/modules--system--system.api.php/function/hook_css_alter/7
function THEME_css_alter(&$css) {
foreach ($css as $key => $value) {
if ($value['group'] != CSS_THEME) {
$exclude[$key] = FALSE;
}
}
$css = array_diff_key($css, $exclude);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment