Skip to content

Instantly share code, notes, and snippets.

@ethanmuller
Last active December 17, 2015 21:29
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 ethanmuller/1ef5d97dd9f851ec22b4 to your computer and use it in GitHub Desktop.
Save ethanmuller/1ef5d97dd9f851ec22b4 to your computer and use it in GitHub Desktop.
Examples for sb-media Foundry post
@import "mixins"; // contains sb-media mixin
@import "box";
.box {
background-color: blue;
@include sb-media(45em) {
background-color: purple;
}
}
$no-mq-support: false !default;
$serve-to-nomq-max-width: 60em;
@mixin sb-media($query) {
@if $no-mq-support{
@if $query < $serve-to-nomq-max-width {
@content;
}
} @else {
@media ( 'min-width:' + $query ) {
@content;
}
}
}
/* I'm rendered CSS */
.box {
background-color: blue;
@media (min-width: 45em) {
background-color: purple;
}
}
@import "base";
/* I'm rendered CSS */
.box {
background-color: blue;
background-color: purple;
}
$no-mq-support: true;
@import "base";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment