Skip to content

Instantly share code, notes, and snippets.

@necolas
Last active December 29, 2024 13:09
Show Gist options
  • 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