Skip to content

Instantly share code, notes, and snippets.

@samueljseay
Created June 4, 2015 08:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samueljseay/6f9ad74ecd156775e85c to your computer and use it in GitHub Desktop.
Save samueljseay/6f9ad74ecd156775e85c to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
<div class='color'></div>
<div class='color-dark'></div>
<div class='color-darker'></div>
// ----
// Sass (v3.4.13)
// Compass (v1.0.3)
// Bourbon (v4.2.3)
// Neat (v1.6.0)
// ----
@import "bourbon/bourbon";
@import "neat/neat";
$mobile: min-width 320px max-width 720px;
$custom: max-width 720px;
$blah: min-width 320px max-width 720px;
$queries: (
query: ('feature': null,'value': null)
);
@mixin multiplemedia($queries...) {
@each $query in $queries {
$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;
}
}
}
.foo {
@include multiplemedia($mobile, $custom, $blah) {
font-size: 20px;
};
}
//example usage
// .foo {
// @include multiplemedia($mobile, $custom) {
// font-size: 20px;
// }
// }
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
@media screen and (min-width: 320px) and (max-width: 720px) {
.foo {
font-size: 20px;
}
}
@media screen and (max-width: 720px) {
.foo {
font-size: 20px;
}
}
@media screen and (min-width: 320px) and (max-width: 720px) {
.foo {
font-size: 20px;
}
}
<div class='color'></div>
<div class='color-dark'></div>
<div class='color-darker'></div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment