Skip to content

Instantly share code, notes, and snippets.

@cadoo
Last active December 19, 2015 18:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cadoo/5999206 to your computer and use it in GitHub Desktop.
Save cadoo/5999206 to your computer and use it in GitHub Desktop.
Breakpoint mixin breakpoints
// Breakpoint mixin breakpoints
$breakpoint-small: 768px;
$breakpoint-medium: 1004px;
$breakpoint-large: 1230px;
// Responsive helpers
@mixin breakpoint($point) {
@if $point == wide {
@media (min-width: $breakpoint-large) { @content; }
}
@else if $point == landscape {
@media (min-width: $breakpoint-medium) { @content; }
}
@else if $point == portrait {
@media (min-width: $breakpoint-small) { @content; }
}
}
// Example
.class {
margin-right: 0;
@include breakpoint(portrait) {
margin-right: em(48);
}
@include breakpoint(landscape) {
margin-right: em(170);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment