Drupal Answers is a question and answer site for Drupal developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
which version of drupal are you using? – xurshid29 Aug 26 '14 at 9:37
Drupal version 7.31 – davewilly Aug 26 '14 at 9:44
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 '14 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);
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 '14 at 9:48

Your Answer


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.