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

dman’s picture

fecking good point.

JohnAlbin’s picture

Category: bug » feature
Status: Active » Postponed (maintainer needs more info)

Prior 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 7 actually 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 at if 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.

JohnAlbin’s picture

Title: IE conditional comment and coming advent of IE8 » Make adding IE conditional comments more flexible
Status: Postponed (maintainer needs more info) » Active
doneinstyle’s picture

If 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.

JohnAlbin’s picture

Title: Make adding IE conditional comments more flexible » Add IE conditional stylesheets to .info file
Assigned: Unassigned » JohnAlbin
Priority: Minor » Normal
Status: Active » Fixed

Ok. Figured it out.

The ideal way would be for themers to add conditional stylesheets to .info files, just like they do for standard stylesheets.

; Set the conditional stylesheets that are processed by IE.
conditional-stylesheets[if lt IE 7][all][] = ie6-and-below.css
conditional-stylesheets[if IE 7][all][] = ie7.css

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:

<!--[if lt IE 7]>
  <link type="text/css" rel="stylesheet" media="all" href="ie6-and-below.css" />
<![endif]-->
<!--[if IE 7]>
  <link type="text/css" rel="stylesheet" media="all" href="ie7.css" />
<![endif]-->

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.

talyia’s picture

SUBSCRIBING

JohnAlbin’s picture

I assume you are just meaning to "bookmark" this. Since the feature is already fixed and available for public consumption. :-)

talyia’s picture

JohnAlbin,
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

hass’s picture

Nice 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/

JohnAlbin’s picture

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.

My 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.

hass’s picture

Your conditional module does not allow inline CSS in conditionals :-(. I've opened a case about this over there... :-)

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

daniorama’s picture

Anyone could make the conditional stylesheets working? I installed the Conditional module but IE 6 is still having problems with png transparency. Any ideas?

JohnAlbin’s picture

I installed the Conditional module but IE 6 is still having problems with png transparency.

This issue has nothing to do with png transparency. Please open a new support request and provide MUCH more information than "still having problems".

daniorama’s picture

John 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.

RobLoach’s picture

Component: Code » layout.css