Posted by thulstrup on July 21, 2010 at 7:22pm
3 followers
Jump to:
| Project: | Conditional Stylesheets |
| Version: | 6.x-1.1 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (duplicate) |
Issue Summary
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";
}
}| Attachment | Size | Status | Test result | Operations |
|---|---|---|---|---|
| non-ie.patch | 736 bytes | Ignored: Check issue status. | None | None |
Comments
#1
subscribing. also, this is useful for defining mobile css rules (media="only screen and (max-width: 480px)" breaks IE).
#2
Duplicate. See #580440: Add support for Downlevel-revealed Conditional Comments