In Drupal 7, how can I include a CSS file only when the front page is being viewed?
Try this:

function mytheme_preprocess_page (&amp;$variables)
{
  if (drupal_is_front_page()) {
    drupal_add_css(drupal_get_path('theme','mytheme'). '/css/front.css');
  } 
}


See template_preprocess_page and drupal_is_front_page for more info.