Skip to content

Instantly share code, notes, and snippets.

@georgebyte
Last active March 6, 2017 06:38
Show Gist options
  • Save georgebyte/ca79c201580cebc1646d to your computer and use it in GitHub Desktop.
Save georgebyte/ca79c201580cebc1646d to your computer and use it in GitHub Desktop.
CSS, Sass: Flexible media query mixin
//base font
$bf: 16;
@mixin bp($bp, $min-max: min-width) {
$em: $bp/$bf;
@media(#{$min-max}: #{$em}em) { @content; }
}
//including the mixin
.element {
@include bp(600) {
...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment