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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

JohnAlbin’s picture

Marked #860828: Add support for non-IE browsers as a duplicate of this one.

ansorg’s picture

How would one do this for the Drupal 7 version where there is no "conditional_styles.theme.inc" to modify?

quicksketch’s picture

Here'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:

stylesheets-conditional[(gte IE 9)|(gt IEMobile 7)|(!IE)][all][] = css/style.css

This will result in output like this:

<!--[if (gte IE 9)|(gt IEMobile 7)|(!IE)]><!-->
<style>@import url("http://example.com/sites/all/themes/example/css/style.css?mf27lk");</style>
<!--<![endif]-->

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.

Status: Needs review » Needs work

The last submitted patch, conditional_styles_not_ie-580440.patch, failed testing.

JohnAlbin’s picture

Version: 6.x-1.x-dev » 7.x-2.x-dev
Status: Needs work » Needs review

I didn't even know the test bot would test these. Manually testing now.

JohnAlbin’s picture

Status: Needs review » Needs work

The last submitted patch, conditional_styles_not_ie-580440.patch, failed testing.

JohnAlbin’s picture

Version: 7.x-2.x-dev » 6.x-1.x-dev
Status: Needs work » Needs review

Fixed in 7.x-2.x.

  • Commit 64f20b2 on 7.x-2.x, 8.x-1.x authored by quicksketch, committed by JohnAlbin:
    Issue #580440: Add support for Downlevel-revealed Conditional Comments