Last active
April 9, 2018 10:04
-
-
Save samcus/f81230ca558c74e968737f8f3560a713 to your computer and use it in GitHub Desktop.
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
// Define Breakpoints | |
$mobile: 480px; | |
$tablet: 960px; | |
$desktop: 1280px; | |
@mixin respond-to($media) { | |
@if $media == small-mobile { | |
@media (max-width: $mobile) { @content; } | |
} | |
@else if $media == mobile { | |
@media (min-width: $mobile ) { @content; } | |
} | |
@else if $media == tablet { | |
@media (min-width: $tablet ){ @content; } | |
} | |
@else if $media == desktop { | |
@media (min-width: $desktop) { @content; } | |
} | |
} | |
/* Example Usage | |
body{ | |
background: white; | |
@include respond-to(mobile){ | |
background: red; | |
} @include respond-to(tablet){ | |
background: green; | |
} @include respond-to(desktop){ | |
background: blue; | |
} | |
} | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment