Last active
December 15, 2015 13:58
-
-
Save mrakowski0/5271060 to your computer and use it in GitHub Desktop.
Nested 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
| @mixin respond-to($media, $direction: max) { | |
| @if $media == mobile { | |
| @media only screen and (max-width: 320px) { @content; } | |
| } | |
| @else if $media == tablet { | |
| @media only screen and (min-width: 768px) { @content; } | |
| } | |
| @else if $media == desktop { | |
| @media only screen and (min-width: 1024px) { @content; } | |
| } | |
| @else if $media == large { | |
| @media only screen and (min-width: 1400px) { @content; } | |
| } | |
| @else { | |
| @media only screen and (#{$direction}-width: #{$media}) { @content; } | |
| } | |
| } |
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
| body { | |
| font-size: 14px; | |
| font-family: "Open Sans", sans-serif; | |
| @include respond-to(tablet) { font-size: 16px; } | |
| @include respond-to(desktop) { font-size: 18px; } | |
| @include respond-to(large) { font-size: 20px; } | |
| } | |
| #gallery { | |
| li { | |
| margin: 0 20px; | |
| @include respond-to(desktop) { float: left; width:50%;} | |
| @include respond-to(1400px, min) { width:33.33%; } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment