Last updated July 17, 2013. Created by mortendk on April 17, 2012.
Edited by starchild, batigolix, Kendall Totten, lslinnet. Log in to edit this page.

A popular technique to remove a CSS file is to use the "foad" (F*** off and Die) technique.

The trick is to tell Drupal to load a CSS file with the same name as the stylesheet you'd like to remove. Do this by editing the themename.info file within your theme. You need not create an actual empty stylesheet file, simply list the css filename in the .info file.

Drupal will try to load the stylesheet you've listed instead of the stylesheet from the module, but it will come up empty-handed. Thus the styles from the module stylesheet are not loaded at all.

  1. Open the themename.info file
  2. Add the filenames to the stylesheets[all][] list
  3. Save your .info file and clear the Drupal site cache

For example, to override the system.messages.css, comment.css, and node.css to remove their default styling:
themename.info

;-------------- CSS FOAD -------------
stylesheets[all][] = system.messages.css
stylesheets[all][] = comment.css
stylesheets[all][] = node.css

Voila! You never have to overwrite those styles again.

More information about this is avaible at Overriding style sheets from modules and base themes

Looking for support? Visit the Drupal.org forums, or join #drupal-support in IRC.

Comments

yes it is

Wouldn't this hurt performance since a check for the file still needs to be made?