Created
July 17, 2014 09:38
-
-
Save wrongkitchen/3e5d7da0d4f1e137035b to your computer and use it in GitHub Desktop.
Responsive mixin
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
$tabletMaxWidth: 1024px - 40px; //1020px - 40px; //980px | |
$mobileMaxWidth: 640px - 40px; //600px | |
@mixin respond-to($media) { | |
@if $media == mobile { | |
@media screen and (max-width: $mobileMaxWidth) { | |
@content; | |
} | |
} | |
@else if $media == tablet { | |
@media screen and (min-width: $mobileMaxWidth + 1) and (max-width: $tabletMaxWidth - 1) { | |
@content; | |
} | |
} | |
@else if $media == mix { | |
@media screen and (max-width: $tabletMaxWidth - 1) { | |
@content; | |
} | |
} | |
@else { | |
@media screen and (max-width: $media) { | |
@content; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment