Skip to content

Instantly share code, notes, and snippets.

@wrongkitchen
Created July 17, 2014 09:38
Show Gist options
  • Save wrongkitchen/3e5d7da0d4f1e137035b to your computer and use it in GitHub Desktop.
Save wrongkitchen/3e5d7da0d4f1e137035b to your computer and use it in GitHub Desktop.
Responsive mixin
$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