Skip to content

Instantly share code, notes, and snippets.

@necolas
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save necolas/8969633 to your computer and use it in GitHub Desktop.
Save necolas/8969633 to your computer and use it in GitHub Desktop.
Generating isolated IE-specific stylesheet
.a {
background: red;
/* dropped linear gradient based on IE CSS support (like what autoprefixer does) */
zoom: 1;
}
.b {
background: green;
}
.a {
background: linear-gradient(red, orange);
}
.b {
background: green;
}
<!DOCTYPE html>
<!--[if (gt IE ?)]><!--><link rel="stylesheet" href="generated-not-ie.css"><!--<![endif]-->
<!--[if (lt IE ?)]><link rel="stylesheet" href="generated-ie.css"><![endif]-->
<div class="a b">
has GREEN background in all browsers
fewer HTTP requests for IE than https://gist.github.com/necolas/8969492
</div>
.a {
background: red;
background: linear-gradient(red, orange);
zoom: 1;
}
.b {
background: green;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment