Skip to content

Instantly share code, notes, and snippets.

@kmaida
Created April 3, 2015 16:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kmaida/16479bab18bcd6a01f01 to your computer and use it in GitHub Desktop.
Save kmaida/16479bab18bcd6a01f01 to your computer and use it in GitHub Desktop.
Sass media query mixin that accepts media query string as argument
/*-- Media query variables --*/
$mq-small: 'media and (max-width: 767px)';
$mq-large: 'media and (min-width: 768px)';
/*-- Media query mixin --*/
@mixin mq($mqString) {
@media #{$mqString} {
@content;
}
}
// Usage: @include mq($mq-large) { /* CSS rules */ }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment