Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save helloluis/1183106 to your computer and use it in GitHub Desktop.
Save helloluis/1183106 to your computer and use it in GitHub Desktop.
How to get HTML5 Boilerplate-style Conditional Comments Working in Slim
doctype html
/[if lt IE 7]
| <html class="ie6">
/[if IE 7]
| <html class="ie7">
/[if IE 8]
| <html class="ie8">
/[if IE 9]
| <html class="ie9">
| <!--[if (gte IE 9)|!(IE)]<!--> <html> <!--<![endif]-->
head
/ various head stuff
body
/ various body stuff
| </html>
@wesbos
Copy link

wesbos commented Jul 22, 2014

Even simpler, just use the /! for an HTML comment:

doctype html
/[if IE 8]
  | <html class="ie8 lt-ie9" lang="en">
/[if IE 9]
  | <html class="ie9" lang="en">
/! [if (gte IE 9)|!(IE)]<!--> <html lang="en"> <!--<![endif]

@arxpoetica
Copy link

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