Created
April 13, 2015 11:46
-
-
Save manfromanotherland/ee43885baf1ece580d5b to your computer and use it in GitHub Desktop.
SASS: Manage responsive breakpoints #snippet
This file contains hidden or 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
// Manage responsive breakpoints | |
// @require $mobile | |
// @example | |
// .element { | |
// /* default styles */ | |
// @include respond-to(mobile) { /* styles just for mobile */ } | |
// @include respond-to(desktop) { /* styles just for desktop */ } | |
// } | |
@mixin respond-to($media) { | |
@if $media == mobile { | |
@media (max-width: $mobile) { | |
@content; | |
} | |
} | |
@else if $media == desktop { | |
@media (min-width: $mobile + 1) { | |
@content; | |
} | |
} | |
} | |
$mobile: 320px; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment