Disable theme css via module I'm using Drupal 7.  

I want to disable css defined by theme because I want to use my custom css that is defined by my custom module. What I mean is, I want to disable sites/all/themes/custom_theme/css/custom.css and use sites/all/modules/custom_module/css/custom.css instead.

Is there any way to do that?

Thanks!
Yes.

What you want is to include call drupal_add_css() for example:

drupal_add_css(drupal_get_path('module', 'your_module') . '/css/custom.css', array('group' =&gt; CSS_DEFAULT, 'every_page' =&gt; TRUE));


What that does is that it adds the css file on every page load. You can read more about adding css files here: https://api.drupal.org/api/drupal/includes%21common.inc/function/drupal_add_css/7

In your theme's .info file you will find a section describing where to find the css file e.g:

stylesheets[all][] = css/style.css

simply switch it off by placing a ; at the start of that line. This works particularly well if your theme is a subtheme, that is based off some other theme that you don't want to change directly in case you may need to upgrade it later.

Lastly, should you decide to remove the css file from your template.php file or module, you can do that via hook_css_alter() 

for example:

function hook_css_alter (&amp;$css) {

    if (isset ($css[path_to_theme() . '/css/custom.css'])) {
        unset ($css[path_to_theme() . '/css/custom.css']);
    }

}


Hope it helps.