Skip to content

Instantly share code, notes, and snippets.

@cfarm
Created November 11, 2013 23:55
Show Gist options
  • Select an option

  • Save cfarm/7422766 to your computer and use it in GitHub Desktop.

Select an option

Save cfarm/7422766 to your computer and use it in GitHub Desktop.
Mixin with Fallback CSS for No Media Queries Support
$supported: true !default; // this makes this stylesheet output media queries from our mixin
@mixin breakpoint($screenWidth: 400px, $support: $supported) {
@if $support == true {
// output the mixin content inside of a media query
@media screen and (min-width: $screenWidth) { @content; }
}
@else {
// output ALL the style content inside the mixin, without a media query
@content;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment