Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This module currently only supports Downlevel-hidden Conditional Comments and not Downlevel-revealed Conditional Comments, so currently, we can't hide stuff from (certain versions of) IE (e.g. some advanced stylesheet,) while keeping it visible for the (latest IE versions and) other browsers.
This patch should add this feature to this module.
Comment | File | Size | Author |
---|---|---|---|
#3 | conditional_styles_not_ie-580440.patch | 578 bytes | quicksketch |
conditional_styles-downlevel-revealed.patch | 1019 bytes | alexanderpas | |
Comments
Comment #1
JohnAlbinMarked #860828: Add support for non-IE browsers as a duplicate of this one.
Comment #2
ansorg CreditAttribution: ansorg commentedHow would one do this for the Drupal 7 version where there is no "conditional_styles.theme.inc" to modify?
Comment #3
quicksketchHere's a patch that does (presumably) the same thing for Drupal 7. If your stylesheets-conditional declaration in your .info file contains the string "!IE" then it will generate a conditional style that is loaded for all other browsers except IE. If you use a conditional like this, you can add CSS for both newer versions of IE and all non-IE browsers:
This will result in output like this:
Which basically means, "If this browser is a new version of IE, or not IE at all" load this content. The closing comment
<!-->
ensures this stylesheet gets added by non-IE browsers which don't understand conditional comments. Since Drupal core supports this functionality, the patch is quite trivial. We'll just need to update our documentation to explain how this functionality works.Comment #5
JohnAlbinI didn't even know the test bot would test these. Manually testing now.
Comment #6
JohnAlbin#3: conditional_styles_not_ie-580440.patch queued for re-testing.
Comment #8
JohnAlbinFixed in 7.x-2.x.