Search code examples
cssviewdrupal-7

how to disable drupal7 system css files?


I've created a new view and changed some styles in view.css. But when I load the page, my styles are overridden by style.css and system.theme.css.

Is there a way to set my css "before" the system css?


Solution

  • Add to your theme's template.php file:

    function THEMENAME_css_alter(&$css) {
        unset($css[drupal_get_path('module','system').'/system.theme.css']);
        unset($css[drupal_get_path('module','system').'/system.base.css']);
        unset($css[drupal_get_path('module','system').'/system.menus.css']);
    }
    

    This is a pretty extreme option. In many instances you may want to just override with more specific CSS as Rory suggests. Or use a combination of the techniques.

    solution from: http://drupal.org/node/592636#comment-4370580