Skip to content

Instantly share code, notes, and snippets.

@sugarenia
Created December 12, 2013 07:50
Show Gist options
  • Save sugarenia/7924548 to your computer and use it in GitHub Desktop.
Save sugarenia/7924548 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.3.0.rc.1)
// Compass (v0.13.alpha.10)
// ----
$breakpoints: (
sm: 30em,
med: 50em,
lrg: 80em
);
@mixin bp($bp) {
@each $breakpoint, $value in $breakpoints {
@if $breakpoint == $bp {
@media screen and (min-width: $value) {
@content;
}
}
}
}
div {
background-color: blue;
@include bp(sm) {
background-color: red;
}
@include bp(med) {
background-color: green;
}
@include bp(lrg) {
background-color: yellow;
}
}
div {
background-color: blue;
}
@media screen and (min-width: 30em) {
div {
background-color: red;
}
}
@media screen and (min-width: 50em) {
div {
background-color: green;
}
}
@media screen and (min-width: 80em) {
div {
background-color: yellow;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment