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.
I noticed @JohnAlbin added an arguments to _base.scss, which enable underscore & star hacks in various locations based on whether or not the user wishes to support legacy IE versions.
Is this in an effort to rid Zen of conditional stylesheets?
We could move the standard IE conditional CSS files over to underscore/star hacks if that's the direction we're going. But perhaps it's just in an effort to provide the best Sass/Compass experience possible.
Perhaps ie classes should be moved to the html element:
http://paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-ne...
Comment | File | Size | Author |
---|---|---|---|
#11 | remove-ie-conditional-stylesheets-1239390-8.patch | 19.01 KB | KrisBulman |
#8 | conditional-html-class-1239390-8.patch | 2.2 KB | JohnAlbin |
#2 | conditional-html-class-1239390-2.patch | 1006 bytes | JohnAlbin |
Comments
Comment #1
JohnAlbinI dislike CSS hacks. However, I added those into the Sass stylesheets because there was no way to add IE support into a single mixin. To use conditional stylesheets with Sass would require having parallel mixins for IE stylesheets. That just underscore how awkward separate conditional stylesheets are.
Here are our options:
Imagine this:
:-(
But I just realized that the RDF namespaces only need to be on the non-IE conditional HTML tag and not on any of the others. An RDF consumer would not be using IE's rendering engine to parse the HTML.
Shall we make Zen use Paul Irish's method then? :-)
Comment #2
JohnAlbinA patch, perhaps?
Comment #3
hansyg CreditAttribution: hansyg commented+1 I think this is the best solution
Comment #4
dcmouyard CreditAttribution: dcmouyard commented+1
Definitely go with #3, à la HTML5 Boilerplate.
Comment #5
KrisBulman CreditAttribution: KrisBulman commentedpatch applied
view source
Comment #6
JohnAlbinI missed something in the patch. The "-->" is rendered in IE9.
Glad to see favorable responses so far. Anyone else? :-)
Comment #7
JohnAlbinJust discovered the reason for the bug. See http://en.wikipedia.org/wiki/Conditional_comment#Downlevel-revealed_cond...
Re-rolling the patch now and cleaning up some of the conditions.
Comment #7.0
JohnAlbinupdated name
Comment #8
JohnAlbinI just committed this patch. Which fixes the earlier bug and adds a couple additional IE-specific classes.
But we need follow-up work to convert the Sass IE CSS hacks to use these new html classes. And to remove the bits of Zen that supported conditional stylesheets. (If you still want to use them, you can download the Conditional Stylesheets module.)
Comment #9
KrisBulman CreditAttribution: KrisBulman commentedGreat! should we open a new ticket to submit patches as the stylesheets are fixed up, or add to this one.
Comment #10
JohnAlbin@Kris, you can just submit to this one. :-)
Also, the conditions that I used are based on my research into 320 and up. However, I think there's some logic errors in that code, so I fixed it, committed it to Zen and posted a patch to 320 and up. Discussion of my proposed improvements are at: https://github.com/malarkey/320andup/pull/4
Comment #11
KrisBulman CreditAttribution: KrisBulman commentedok, this should take care of the ie6 & ie7 stylesheets, while retaining support for adding/removing ie support via keyword arguments in _base.scss. It also updates the css stylessheets and disables them from the .info file
I wasn't sure how to handle the clearfix, element-invisible or unpublished div in _base, please provide direction.
Comment #12
JohnAlbinThanks, Kris!
BTW, the zen-columns-fixed mixin already had IE6/7 support in it, so we didn't need to create a new mixin for it. I did convert its ie6/7 CSS hacks to proper .ie6-7/.ie6 classes instead.
I've taken what you've done and reviewed, modified and committed it in chunks to make it easier to see what is going on.
http://drupalcode.org/project/zen.git/commit/a28855c
http://drupalcode.org/project/zen.git/commit/9534687
http://drupalcode.org/project/zen.git/commit/82f2d85
http://drupalcode.org/project/zen.git/commit/12af091
http://drupalcode.org/project/zen.git/commit/83d51b9
Comment #13
KrisBulman CreditAttribution: KrisBulman commentednice.. first, and hopefully not last, mention in a drupal commit!
thanks for the info, pulling apart the mixin taught me a lot about how it worked anyway, so it was worth the effort.
Comment #15
JohnAlbinUpdated the conditions based on further conversation in https://github.com/malarkey/320andup/pull/4
Comment #15.0
JohnAlbinCorrected my wording when referring to Paul Irish's method