Skip to content

Instantly share code, notes, and snippets.

@mindmergedesign
Created April 24, 2013 18:21
Show Gist options
  • Save mindmergedesign/5454314 to your computer and use it in GitHub Desktop.
Save mindmergedesign/5454314 to your computer and use it in GitHub Desktop.
Remove Drupal core stylesheets with hook_css_alter
<?php
/**
* Remove Drupal's core system stylesheets.
*/
function THEMENAME_css_alter(&$css)
{
$path_system = drupal_get_path('module', 'system');
$remove = array(
$path_system . '/system.base.css',
$path_system . '/system.menus.css',
$path_system . '/system.messages.css',
$path_system . '/system.theme.css',
);
// Remove stylesheets which match our remove array.
foreach ($css as $stylesheet => $options) {
if (in_array($stylesheet, $remove)) {
unset($css[$stylesheet]);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment