drupal_add_css()

  • When you write a custom module, a lot of times you also need to add a stylesheet. The safest place to do this, is in your implementation of hook_init(). But sometimes, you have to wait until your phptemplate_preprocess_page() kicks in before deciding what stylesheets to add. In that case, there a few things you should take into account, otherwise you might overwrite the stylesheet changes done by other modules.