Drupal 6: Remove unnecessary CSS files

Creating a new Drupal theme is fairly simple, but its really annoying when the overly ambitious CSS selectors from "system.css", "node.css", "defaults.css" and "user.css" start messing up your layout.

To get rid of them, override phptemplate_preprocess_page() in your theme "template.php" file and append:

function phptemplate_preprocess_page(&$vars) {
// Remove the stupid Drupal css stuff from being added
unset($vars['css']['all']['module']['modules/node/node.css']);

unset($vars['css']['all']['module']['modules/system/defaults.css']);
unset($vars['css']['all']['module']['modules/system/system.css']);
unset($vars['css']['all']['module']['modules/system/system-menus.css']);
unset($vars['css']['all']['module']['modules/user/user.css']);

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

This code was ported from John Forsythe's Drupal 5 post.

[ Source ]

 
Copyright © Twig's Tech Tips
Theme by BloggerThemes & TopWPThemes Sponsored by iBlogtoBlog