Removing or overriding standard CSS files
Sometimes it is necessary to change or remove standard CSS files: system.css, defaults.css, or system-menus.css. Of course, we can modify these files, but during Drupal updates we might forget about these changes and overwrite them again. To prevent this, you need to exclude these files from the list of CSS files output by Drupal, and if you need some CSS from these files, you can copy them into your theme's style.css and edit them there. This way you protect your CSS code from possible deletion.
So, create a file template.php in your theme folder, it might already exist. Insert the following code into this file:
function phptemplate_preprocess_page(&$vars) { $css = $vars['css']; unset($css['all']['module']['modules/system/system.css']); unset($css['all']['module']['modules/system/defaults.css']); unset($css['all']['module']['modules/system/system-menus.css']); $vars['styles'] = drupal_get_css($css); }
Now the CSS code from these files can be copied into the style.css file and edited.
The same applies to CSS files of the Nice Menus module, which is often used to create dropdown menus. It is preferable to change the CSS in the style.css file. Insert this code to remove the Nice Menus module CSS files from output:
function phptemplate_preprocess_page(&$vars) { $css = $vars['css']; unset($css['all']['module']['modules/system/system.css']); unset($css['all']['module']['modules/system/defaults.css']); unset($css['all']['module']['modules/system/system-menus.css']); unset($css['all']['module']['sites/all/modules/nice_menus/nice_menus.css']); unset($css['all']['module']['sites/all/modules/nice_menus/nice_menus_default.css']); $vars['styles'] = drupal_get_css($css); }
It is worth noting that nice_menus/nice_menus_default.css is the path to the file; in this case, the Nice Menus module lies in the Nice_menus folder without the module version.