Last active
May 2, 2018 17:00
-
-
Save Anderson-Juhasc/350547234cc35940472845c64b8873cb 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
$breakpoints: "palm" "(max-width: 480px)", "lap" "(min-width: 481px)", "portable" "(max-width: 1023px)", "desk" "(min-width: 1024px)", "desk-wide" "(min-width: 1200px)" !default | |
=media-query($media-query) | |
$breakpoint-found: false | |
@each $breakpoint in $breakpoints | |
$name: nth($breakpoint, 1) | |
$declaration: nth($breakpoint, 2) | |
@if $media-query == $name and $declaration | |
$breakpoint-found: true | |
@media only screen and #{$declaration} | |
@content | |
@if $breakpoint-found == false | |
@warn "Breakpoint '#{$media-query}' does not exist" | |
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
$breakpoints = "palm" "(max-width: 480px)", "lap" "(min-width: 481px)", "portable" "(max-width: 1023px)", "desk" "(min-width: 1024px)", "desk-wide" "(min-width: 1200px)" | |
media-query($break) | |
for $breakpoint in $breakpoints | |
$name = $breakpoint[0] | |
$declaration = $breakpoint[1] | |
$expression = "only screen and " + $declaration | |
if $break == $name | |
@media $expression | |
{block} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment