Created
March 14, 2019 16:14
-
-
Save jgcarlson/2b51ac441a2eda06629b7218d2cbf6ab to your computer and use it in GitHub Desktop.
SCSS Media Queries
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
| /* MEDIA QUERIES */ | |
| $breakpoints: ( xs: 576px, sm: 768px, md: 992px, lg: 1200px); | |
| $bp-xs: map-get($breakpoints, xs); // < 576px | |
| $bp-sm: map-get($breakpoints, sm); // < 768px | |
| $bp-md: map-get($breakpoints, md); // < 992px | |
| $bp-lg: map-get($breakpoints, lg); // < 1200px | |
| $bp-xl: map-get($breakpoints, xl); // > 1200px | |
| // from 0 -> 575px | |
| @mixin mobile() { | |
| @media (max-width: $bp-xs - 1) { | |
| @content; | |
| } | |
| } | |
| // from 576px+ | |
| @mixin tablet() { | |
| @media (min-width: $bp-xs) { | |
| @content; | |
| } | |
| } | |
| // from 1200px+ | |
| @mixin desktop() { | |
| @media (min-width: $bp-lg) { | |
| @content; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment