-
-
Save kmiyashiro/1140425 to your computer and use it in GitHub Desktop.
!!! 5 | |
//if lt IE 7 | |
html(class="no-js ie6 oldie", lang="en") | |
//if IE 7 | |
html(class="no-js ie7 oldie", lang="en") | |
//if IE 8 | |
html(class="no-js ie8 oldie", lang="en") | |
// [if gt IE 8] <! | |
html(class="no-js", lang="en") | |
// <![endif] | |
head | |
title= title | |
body!= body |
@guioconnor: The one from David is correct. By using literal tags it stops Jade from attempting to auto close the tag, like yours is doing.
You do need to remember to use a literal close at the end of your Jade document though.
Here's another take using comments and literals: https://gist.github.com/3879867
I recommend the following since jade renders a closing html tag
!!! 5
//if lt IE 7
<html class="no-js lt-ie9 lt-ie8 lt-ie7">
//if IE 7
<html class="no-js lt-ie9 lt-ie8">
//if IE 8
<html class="no-js lt-ie9">
// [if gt IE 8] <!
html(class="no-js", lang="en")
// <![endif]
head
Nice improvement @jwerre -- have you attempted to remove the unwanted white space between these at all? I'm fairly confident there isn't really a way to do it, but if there is I'd love to find out as I'm completely OCD about stuff like that :)
please do note that this behaviour has been ripped out of jade now...
Now, you have to just use this:
<!--[if lt IE 8]>
link(rel='stylesheet', href='style-ie8.css')
<![endif]-->
Can you please define 'now'?
Which versions are concerned by the // IE 8
syntax and which are not?
Thanks.
HI David, that explains. The Jade on your last comment is more or less how I'm doing it at the moment and it does work but this is not the same code as the original one because all you are doing is writing literal HTML for the opening tag. The original code, on the other hand, instructs Jade to create a
<html>
element that Jade automatically closes. Or am I missing something?