Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
There are two methods to removing drupal.css from your theme in phptemplate.
The first cuts out the link from the $head variable. In page.tpl.php, replace your print $head
print str_replace('<style type="text/css" media="all">@import "misc/drupal.css";</style>', '', $head);
The other method requires overriding the stylesheet import themable function. Simply add this to your theme's template.php file:
function phptemplate_stylesheet_import($path, $media = 'all') {
if ($path != base_path() .'misc/drupal.css') {
return '<style type="text/css" media="'. $media .'">@import "'. $path .'";</style>';
}
}
Replace the leading 'phptemplate' of above function with your theme's name if you are using this code in a plain PHP theme.