Skip to content

Instantly share code, notes, and snippets.

@birkestroem
Created April 30, 2014 13:18
Show Gist options
  • Save birkestroem/133f03eca808a244e9cd to your computer and use it in GitHub Desktop.
Save birkestroem/133f03eca808a244e9cd to your computer and use it in GitHub Desktop.
/**
* TODO: Optimize the MQ's logic to produce one statement.
*/
@mixin breakpoint($point, $media: all) {
@if index($point, "xs") != null {
@media only #{$media} and (max-width: #{$screen-xs-max}) {
@content;
}
}
@if index($point, "sm") != null {
@media only #{$media} and (min-width: #{$screen-sm}) and (max-width: #{$screen-sm-max}) {
@content;
}
}
@if index($point, "md") != null {
@media only #{$media} and (min-width: #{$screen-md}) and (max-width: #{$screen-md-max}) {
@content;
}
}
@if index($point, "lg") != null {
@media only #{$media} and (min-width: #{$screen-lg}) {
@content;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment