Created
August 13, 2019 06:35
-
-
Save steveebenezer/b5d03aa64e26f3676ec58d086ce35404 to your computer and use it in GitHub Desktop.
Sass responsive media query mixin
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
| // Widths | |
| $lap-start: 720px!default; | |
| $desk-start: 930px!default; | |
| $desk-normal-start: 1024px!default; | |
| $desk-wide-start: 1170px!default; | |
| $palm-end: $lap-start - 1px; | |
| $lap-end: $desk-start - 1px; | |
| @mixin media-query($media-query){ | |
| @if $media-query == palm{ | |
| @media only screen and (max-width:$palm-end) { @content; } | |
| } | |
| @if $media-query == lap{ | |
| @media only screen and (min-width:$lap-start) and (max-width:$lap-end) { @content; } | |
| } | |
| @if $media-query == lap-and-up{ | |
| @media only screen and (min-width:$lap-start) { @content; } | |
| } | |
| @if $media-query == portable{ | |
| @media only screen and (max-width:$lap-end) { @content; } | |
| } | |
| @if $media-query == desk{ | |
| @media only screen and (min-width:$desk-start) { @content; } | |
| } | |
| @if $media-query == desk-wide{ | |
| @media only screen and (min-width: $desk-wide-start) { @content; } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment