Using a slightly different syntax, it's possible to add conditional comments for non-IE browsers.
Examples:
<!--[if !IE]>
IE8
<![endif]-->
<!--[if !IE]><!-->
Not IE
<!--<![endif]-->
<!--[if (!IE)|(IE 8)]><!-->
Not IE or IE8
<!--<![endif]-->It should be quite easy to implement by making a small change to the _conditional_styles_theme function:
if ($output) {
// When targeting non-IE browsers.
if (stristr($condition, '!IE') !== FALSE) {
$conditional_styles .= "<!--[$condition]><!-->\n$output<!--<![endif]-->\n";
}
// When only targeting IE.
else {
$conditional_styles .= "<!--[$condition]>\n$output<![endif]-->\n";
}
}| Comment | File | Size | Author |
|---|---|---|---|
| non-ie.patch | 736 bytes | thulstrup |
Comments
Comment #1
bc commentedsubscribing. also, this is useful for defining mobile css rules (media="only screen and (max-width: 480px)" breaks IE).
Comment #2
johnalbinDuplicate. See #580440: Add support for Downlevel-revealed Conditional Comments