conditional_styles.module in Conditional Stylesheets 7.2
File
conditional_styles.module
View source
<?php
function conditional_styles_preprocess_html(&$vars, $hook) {
$themes = $GLOBALS['base_theme_info'];
$themes[] = $GLOBALS['theme_info'];
foreach (array_keys($themes) as $key) {
$theme_path = dirname($themes[$key]->filename) . '/';
if (isset($themes[$key]->info['stylesheets-conditional'])) {
foreach (array_keys($themes[$key]->info['stylesheets-conditional']) as $condition) {
foreach (array_keys($themes[$key]->info['stylesheets-conditional'][$condition]) as $media) {
foreach ($themes[$key]->info['stylesheets-conditional'][$condition][$media] as $stylesheet) {
drupal_add_css($theme_path . $stylesheet, array(
'group' => CSS_THEME,
'browsers' => array(
'IE' => $condition,
'!IE' => strpos($condition, '!IE') === FALSE ? FALSE : TRUE,
),
'weight' => 999,
'every_page' => TRUE,
));
}
}
}
}
}
}
function conditional_styles_preprocess_maintenance_page(&$vars, $hook) {
conditional_styles_preprocess_html($vars, $hook);
}