Apply IE conditional classes to html tag (instead of body) #44

Closed
imdario opened this Issue Aug 11, 2010 · 5 comments

Projects

None yet

4 participants

@imdario
imdario commented Aug 11, 2010

This is not really an issue but based on http://paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/#comment-33260 would be nice to change the IE conditional classes to html tag.

As said, that will not block the download and save some bytes from the empty conditional comment at http://github.com/paulirish/html5-boilerplate/blob/master/index.html#L7

Thanks for your time!

@paulirish
Member

The downside is that it'll get much bigger...

from

<!--[if lt IE 7 ]> <body class="ie6"> <![endif]-->
<!--[if IE 7 ]>    <body class="ie7"> <![endif]-->
<!--[if IE 8 ]>    <body class="ie8"> <![endif]-->
<!--[if IE 9 ]>    <body class="ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <body> <!--<![endif]-->

to

<!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->
<!--[if IE 7 ]>    <html lang="en" class="no-js ie7"> <![endif]-->
<!--[if IE 8 ]>    <html lang="en" class="no-js ie8"> <![endif]-->
<!--[if IE 9 ]>    <html lang="en" class="no-js ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en" class="no-js"> <!--<![endif]-->

thoughts anyone?

@nimbupani
Member

I would prefer the IE classes on html because CMSes like Drupal/WP almost always have a bodyclasses function on the body opening tag. It makes it less of a hassle to edit for various custom CMSes.

@adeelejaz
Contributor

Also, imagine a scenario where you have ids and classes on body like:

<body id="cart" class="shopping ie6">

You cannot really get this to work in ie6:

.shopping.ie6 p { padding-left: 2px }

Putting it on html tag gives the liberty to do something like:

.ie6 .shopping p { padding-left: 2px }
@paulirish
Member

Good usecases, adeel and divya. I think we can make this change.

@nimbupani
Member

IE conditional classes moved to html tag. Closed by 35ababe

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment