Last active
December 19, 2015 18:29
-
-
Save cadoo/5999206 to your computer and use it in GitHub Desktop.
Breakpoint mixin breakpoints
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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