theme_add_style

Versions
4.6
theme_add_style($style = '')
4.7
theme_add_style($path = '', $media = 'all')

Add a theme stylesheet to be included later. This is handled separately from drupal_set_html_head() to enforce the correct CSS cascading order.

▾ 2 functions call theme_add_style()

init_theme in includes/theme.inc
Initialize the theme system by loading the theme.
theme_get_styles in includes/theme.inc
Return the HTML for a theme's stylesheets.

Code

includes/theme.inc, line 330

<?php
function theme_add_style($path = '', $media = 'all') {
  static $styles = array();

  if ($path && !isset($styles["$media:$path"])) {
    $style = new stdClass();
    $style->path = base_path() . $path;
    $style->media = $media;
    $styles["$media:$path"] = $style;
  }
  return $styles;
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.