Take the 2-minute tour ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

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.

share|improve this question
    
which version of drupal are you using? –  xurshid29 Aug 26 at 9:37
    
Drupal version 7.31 –  davewilly Aug 26 at 9:44

3 Answers 3

up vote 0 down vote accepted

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);  
}
share|improve this answer
    
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 at 12:47

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

share|improve this answer

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']);
}
share|improve this answer
    
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 at 9:48

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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