Closed (works as designed)
Project:
Omega
Version:
7.x-3.0
Component:
Feature Request
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
1 Dec 2011 at 21:38 UTC
Updated:
28 Sep 2012 at 11:57 UTC
Jump to comment: Most recent file
Comments
Comment #1
finex commentedWhy not add the class on the
bodyusinghook_preprocess_html()?Comment #2
jwilson3Because body classes are often used as valid directives and older versions of ie do not support chaining... The following example wouldn't work in IE6, the background would still be shown red.
It is an unwritten rule of thumb to place "user agent compatibility support" classes on the html tag. For example, core uses
html.jsto flag browsers that have javascript support.Comment #3
jwilson3Now, for a proper review...
The proposal in the OP uses server-side browser sniffing to decide when to print the extra conditional elements. This causes problems when your site sits behind a reverse proxy cache like varnish. If you need this in your theme, I would just override html.tpl.php (eg the one from alpha) to include the following code (I've stripped out the xml namespaces for clarity:
Here is a patch that does the above on the alpha/templates/html.tpl.php, though I don't necessarily recommend that the module support this out of the box, you could use the patch as a starting point for overriding this in your own theme.
Comment #4
jwilson3As there are no stylesheet changes accompanying this feature request and no real need out of the box to support this, I'm gonna go out on a limb to guess that the maintainers probably won't want to add this to the theme by default. This is a perfect example of why we have the template file structure and override system: for implementing your specific needs in your own sub-theme.
UPDATE: rewrote the first sentence for clarity.
Comment #5
TelFiRE commentedHow is there no need to support this out of the box? Has anyone here ever worked on a website that didn't need a ie-specific style? I would be surprised because I've done hundreds of them and never come across that.
Comment #6
jwilson3If you actually read the CSS of Omega, it does contain IE-specific fixes embedded directly within its CSS. There hasn't been a need to target the browser using HTML-level classes for the theme itself to function, and thus it is left up to the site builder/themer as to which way s/he wants to handle IE theming. Of the many possible ways, this is just one.