I am trying to remove nice menus css, as per the notes in my Zen theme .info file. I have added the below to the info file, and I haven't provided replacements in my theme so they should be removed.

stylesheets[all][] = nice_menus.css
stylesheets[all][] = nice_menus_default.css

However they are still being imported. Cache cleared.


enter image description here

EDIT: I'm aware this can be achieved using hooks, but would like to do it at theme .info file level, unless I am mistaken and it is not possible to remove contrib module .css in the theme .info file.

  • which version of drupal are you using?
    – xurshid29
    Commented Aug 26, 2014 at 9:37
  • Drupal version 7.31
    – davewilly
    Commented Aug 26, 2014 at 9:44

3 Answers 3


You can remove the css file of particular module

function MY_MODULE_css_alter(&$css) {   
unset($css[drupal_get_path('module', 'views') . '/css/views.css']);
$css = array_diff_key($css, $exclude);  
  • I ended up using this hook, as I haven't time to work out why the .info file solution isn't working. Thanks.
    – davewilly
    Commented Aug 26, 2014 at 12:47

Try disable/enable theme. Yes it likes a trick. It seems info files are parsed when modules/themes are enabled/disabled.


you can remove(alter) css files with hook_css_alter, here is a simple example:

function MY_MODULE_OR_THEME_css_alter(&$css) {
    // dpm($css);
  • Thanks yes I am aware of that but I don't want to load it, just to unload it. I'd rather not load it in the first place, which can be done in .info file.
    – davewilly
    Commented Aug 26, 2014 at 9:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.