Created
September 12, 2014 00:04
-
-
Save rdmurphy/8583950bb4704b7f6cd4 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
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
| // ---- | |
| // libsass (v2.0.0) | |
| // ---- | |
| $em-base: 16px; | |
| @function em($pxval, $base: $em-base) { | |
| @if unitless($pxval) { | |
| $pxval: $pxval * 1px | |
| } | |
| @if unitless($base) { | |
| $base: $base * 1px; | |
| } | |
| @return ($pxval / $base) * 1em; | |
| } | |
| @mixin media($query:$feature $value) { | |
| $loop-to: length($query); | |
| $media-query: 'screen and '; | |
| $i: 1; | |
| @while $i <= $loop-to { | |
| $media-query: $media-query + '(' + nth($query, $i) + ': ' + nth($query, $i + 1) + ') '; | |
| @if ($i + 1) != $loop-to { | |
| $media-query: $media-query + 'and '; | |
| } | |
| $i: $i + 2; | |
| } | |
| @media #{$media-query} { | |
| @content; | |
| } | |
| } | |
| .moose { | |
| font-size: 1em / 2px; | |
| } | |
| $hi: (min-width em(480) max-width em(768)); | |
| .container { | |
| @include media($hi) { | |
| background-color: rgb(0, 255, 240); | |
| } | |
| } |
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
| .moose { | |
| font-size: 1em/2px; } | |
| @media screen and (min-width: 30em) and (max-width: 48em) { | |
| .container { | |
| background-color: #00fff0; } } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment