Skip to content

Instantly share code, notes, and snippets.

@micahgodbolt
Last active December 16, 2015 08:38
Show Gist options
  • Save micahgodbolt/5406759 to your computer and use it in GitHub Desktop.
Save micahgodbolt/5406759 to your computer and use it in GitHub Desktop.
Respond-to Mixin with .ie8 fallback
@mixin respond-to($primary, $secondary:min-width) {
@if $secondary == max-width {
@media screen and (max-width: $primary - .001) { @content; }
}
@else if $secondary == min-width {
@media screen and (min-width: $primary) { @content; }
@if $primary == $large {
.ie8 &{
@content;
}
}
@if $primary == $medium {
.ie8 &{
@content;
}
}
}
@else {
@media screen and (min-width: $primary) and (max-width: $secondary - .001) { @content; }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment