override core stylesheets
Overriding the core and module stylesheets
Now, why would you want this? Hacking on files outside your theme directory is bad practice. It complicates maintenance and you end up with bugs that are hard to track. Another reason is that adding tons of styles into your "style.css" file can eventually make it unwieldy and error prone.
There are two approaches to overriding styles sheets outside the theme directory. One is to automatically load a modified version with drupal_add_css() and setting a 'theme' parameter so the cascading order overrides them. ("Theme" styles always print out after "module" styles.) The other is to manipulate the PHPTemplate variable $css directly so it depends entirely on your modified version.
The following code should be inside your template.php file and rename MYTHEME to the name of your theme.
First approach:
The function:
<?php
/**
* Used to detect styles outside the theme folder and attach a modified version.
*/
function MYTHEME_attach_module_styles($css) {
foreach ($css as $media => $types) {
foreach ($types['module'] as $file => $preprocess) {
// modified version detected here. basename() returns the file name.
if (file_exists($attach = path_to_theme() .'/styles/mod-'. basename($file))) {
