Skip to content

Instantly share code, notes, and snippets.

@VitorLuizC
Created March 16, 2017 18:15
Show Gist options
  • Save VitorLuizC/d8f7de8511fe100866e6f9d68d931561 to your computer and use it in GitHub Desktop.
Save VitorLuizC/d8f7de8511fe100866e6f9d68d931561 to your computer and use it in GitHub Desktop.
HTML IE Conditionals + Pug / Jade
mixin ie(method, version)
-
version = (typeof version === 'number') ? `IE ${version}` : 'IE';
method = method || '==';
var condition = '';
switch (method) {
case '==':
condition = version;
break;
case '!=':
condition = `!${version}`;
break;
case '>':
condition = `gt ${version}`;
break;
case '>=':
condition = `gte ${version}`;
break;
case '<':
condition = `lt ${version}`;
break;
case '<=':
condition = `lte ${version}`;
break;
}
<!--[if #{condition}]>
block
<![endif]-->
include ie
+ie('<=', 8)
body.no-supported
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment