Skip to content

Instantly share code, notes, and snippets.

@dvessel
Last active December 12, 2015 02:59
Show Gist options
  • Save dvessel/4703336 to your computer and use it in GitHub Desktop.
Save dvessel/4703336 to your computer and use it in GitHub Desktop.
ie mixins
/**
* To minimize bloat, compile IE styles into their own style sheets.
*
* http://nicolasgallagher.com/mobile-first-css-sass-and-ie/
*
* Expanded on these selector hack mixins from Chris Eppstein.
*
* https://gist.github.com/1215856#file_6_media_queries.scss
*
* Create your own... Or not. Don't go overboard. These are most likely good
* enough.
*
* http://paulirish.com/2009/browser-specific-css-hacks/
*
* Recycling the `$legacy-support-for-ieX` settings from compass also results
* in leaner rulesets for modern browsers since they can be pushed to the IE
* specific styles. (If you are using Compass which you most likely are.)
*
* Set all of `$legacy-support-for-ieX` to `false` for your main style sheet and
* enable them for the IE specific style sheet. Disabling all the experimental
* support for browsers that isn't IE would be a good idea as well for the IE6-8
* specific styles. Even IE will get less bloat without more maintenance.
*
* http://compass-style.org/reference/compass/support/
*
*/
$legacy-support-for-ie6: false !default;
$legacy-support-for-ie7: true !default;
@mixin ie6 {
@if $legacy-support-for-ie6 {
* html & {
/* IE6 */
@content;
}
}
}
@mixin ie7 {
@if $legacy-support-for-ie7 {
*+html & {
/* IE7 */
@content;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment