Skip to content

Instantly share code, notes, and snippets.

@rdmurphy
Created September 12, 2014 00:04
Show Gist options
  • Select an option

  • Save rdmurphy/8583950bb4704b7f6cd4 to your computer and use it in GitHub Desktop.

Select an option

Save rdmurphy/8583950bb4704b7f6cd4 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// 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);
}
}
.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