Skip to content

Instantly share code, notes, and snippets.

@procload
Created November 14, 2014 19:38
Show Gist options
  • Select an option

  • Save procload/9f597e45f04cc521d9b0 to your computer and use it in GitHub Desktop.

Select an option

Save procload/9f597e45f04cc521d9b0 to your computer and use it in GitHub Desktop.
// Assumes you want IE 8 and below to use largest screen size
@mixin respond-to($viewport-width, $fallback: false, $ie-version: 'lt-ie9') {
@media only screen and (min-width: $viewport-width) {
@content;
}
@if $fallback == true {
@if $ie-version == 'lt-ie9' {
html.lt-ie9 & { // Using Paul Irish's conditional comments
@content;
}
}
@else if $ie-version == 'lt-ie8' {
html.lt-ie8 & { // Using Paul Irish's conditional comments
@content;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment