Skip to content

Instantly share code, notes, and snippets.

@robertmagnusson
Created February 11, 2014 15:27
Show Gist options
  • Save robertmagnusson/8937038 to your computer and use it in GitHub Desktop.
Save robertmagnusson/8937038 to your computer and use it in GitHub Desktop.
Breakpoint mixin
@mixin breakpoint($point) {
@if $point == large {
@media (min-width: 64.375em) { @content; }
}
@else if $point == medium {
@media (min-width: 50em) { @content; }
}
@else if $point == small {
@media (min-width: 37.5em) { @content; }
}
}
.page-wrap {
width: 75%;
}
@media (min-width: 64.375em) {
.page-wrap {
width: 60%;
}
}
@media (min-width: 50em) {
.page-wrap {
width: 80%;
}
}
@media (min-width: 37.5em) {
.page-wrap {
width: 95%;
}
}
.page-wrap {
width: 75%;
@include breakpoint(large) { width: 60%; }
@include breakpoint(medium) { width: 80%; }
@include breakpoint(small) { width: 95%; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment