Created
April 24, 2013 18:21
-
-
Save mindmergedesign/5454314 to your computer and use it in GitHub Desktop.
Remove Drupal core stylesheets with hook_css_alter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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