Closed (fixed)
Project:
Zen
Version:
6.x-1.x-dev
Component:
layout.css
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
12 Apr 2008 at 14:54 UTC
Updated:
27 Aug 2010 at 19:25 UTC
I humbly suggest you might change the conditional comment in page.tpl.php.
It now reads:
if IE
IE8 is currently in beta. To avoid problems with it and with future versions, and since we can't anticipate what the final IE8 version will fix (or not fix) I suggest that the conditional comment be change to read:
if lte IE 7
That will avoid any issues where hacks for earlier versions will break IE8 rendering.
Love the theme, btw, and I'm making good use of it.
Comments
Comment #1
dman commentedfecking good point.
Comment #2
johnalbinPrior to the release of IE7, all my sites had
if lt IE 7. I was being optimistic by hoping that IE7 would fix all the layout issues I was experiencing with IE6. However, IE7 turned out to be broken in different ways than IE6 was.But the
if lt IE 7actually turned out to be a problem for me. The sites would break under IE7, and the client would say “why isn't this ie.css file being included by the new IE 7?” If I had left it atif IE, I could have pointed the finger at IE 7.I think a better solution would be to make the IE conditional more flexible for developers to change, but I haven't decided how to do that.
Comment #3
johnalbinComment #4
doneinstyle commentedIf you use the "if less than or equal to IE7" language, as I initially stated, then people can put things that apply to both IE6 and IE7 in that stylesheet without any hacks, and things that apply to only IE6 and below by using the * html hack. And when IE8 comes out I'm sure the geniuses at css-discuss will come up with a loophole hack, the way they've done for every other version. :) I do this all the time with my other sites. One iestyle.css for all current versions of IE, and that has all the adjustments needed for both.
Comment #5
johnalbinOk. Figured it out.
The ideal way would be for themers to add conditional stylesheets to .info files, just like they do for standard stylesheets.
So placing the above text in your theme's .info file will automatically append the following to your $styles variable in the page.tpl.php template:
So I just committed the code that does this in Zen. Since this idea would be useful to other theme developers (outside the Zen world), I've spun off the code to its own module: http://drupal.org/project/conditional_styles
The Zen theme doesn't require that module, but it happily lets the module do the work if its installed.
Comment #6
talyia commentedSUBSCRIBING
Comment #7
johnalbinI assume you are just meaning to "bookmark" this. Since the feature is already fixed and available for public consumption. :-)
Comment #8
talyia commentedJohnAlbin,
Yes, I meant to just bookmark rather...I added that "subscribe" comment so I could have it in my list of recent posts:) (I am still a baby newbie around here and still have to get used to all the methods & lingo that all the other "Drupaleers" use around here;)
If you have a moment could you take a look at my other post at http://drupal.org/node/309414 and let me know if you have any ideas as to why I cannot get this to work with my website at http://www.lee-magazine.com?
Thanks a lot,
Christine
Comment #9
hass commentedNice idea to do this with .info. I'm currently doing this stuff inside template.php by calling drupal_get_css(), add the conditionals and than pushing the changed HTML back into $vars['styles']. This solution does not require to add extra conditional code to the page.tpl.php. See the YAML Theme at http://www.yaml-fuer-drupal.de/
Comment #10
johnalbinMy solution doesn't need any conditional code in the page.tpl.php either. In fact, it was because I hated the old PHP conditional code in Zen's page.tpl.php so much that drove me to find a better solution.
Putting it in the .info file allows sub-themes to replace/remove the styles in the base theme. And, my code only generates the IE conditional HTML when the theme registry is built and then stores it in the database, so its extremely memory efficient as the code that does the work is only included during the theme registry build. You can read the "technical details" section of http://drupal.org/project/conditional_styles for more info.
Comment #11
hass commentedYour conditional module does not allow inline CSS in conditionals :-(. I've opened a case about this over there... :-)
Comment #12
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #13
daniorama commentedAnyone could make the conditional stylesheets working? I installed the Conditional module but IE 6 is still having problems with png transparency. Any ideas?
Comment #14
johnalbinThis issue has nothing to do with png transparency. Please open a new support request and provide MUCH more information than "still having problems".
Comment #15
daniorama commentedJohn sorry, after reading and hacking the code a bit I supposed the ie.css will fix png transparency and some position issues. Really sorry. It seems Zen doesn't fix these problems. :( I wrote before other issue about this problem http://drupal.org/node/315345 but I thought it could be related with the Conditional Stylesheets no loading correctly.
Not willing to disrupt anyone, just trying to find answers.
Comment #16
robloachFor Drupal core: #522006: Conditional Styles in .info files, since drupal_add_css has it