1

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.

Thanks

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.

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

3 Answers 3

0

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);  
}
1
  • I ended up using this hook, as I haven't time to work out why the .info file solution isn't working. Thanks.
    – davewilly
    Aug 26, 2014 at 12:47
1

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

1

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);
    unset($css[drupal_get_path('module','system').'/system.menus.css']);
}
1
  • 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
    Aug 26, 2014 at 9:48

Your Answer

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

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