I have tried adding conditional CSS in Responsive Bartik and also a custom subtheme of Responsive Bartik with no success:
/*A*/
function responsive_bartik_preprocess_html(&$variables) {
// Add conditional stylesheets for IE
drupal_add_css(path_to_theme() . '/css/lte_ie8.css', array('group' => CSS_THEME, 'browsers' => array('IE' => 'lte IE 8', '!IE' => FALSE), 'preprocess' => FALSE));
}
/*B*/
function responsive_bartik_preprocess_html(&$variables) {
drupal_add_css(drupal_get_path('theme', 'responsive_bartik') . '/css/lte_ie8.css', array(
'group' => CSS_THEME,
'browsers' => array(
'IE' => 'lte IE 8',
'!IE' => FALSE
),
'preprocess' => FALSE
));
}
I have also tried to add this to .info-file
C
ie_stylesheets[screen][lte IE 8][] = css/lte_ie8.css
For now I am not sure if this is a bug report or support request. Feel free to change category if there is a working solution for this. (I would like to avoid using another module.) I have used solution A several times in other D7 themes like Bartik without problems.
(Using Drupal 7.25)
Comments
Comment #1
mjohnq3 commentedI cannot reproduce this problem. The following code appears to work correctly:
drupal_add_css(path_to_theme() . '/css/lte_ie8.css', array('group' => CSS_THEME, 'browsers' => array('IE' => 'lte IE 8', '!IE' => FALSE), 'preprocess' => FALSE));