Skip to content

Instantly share code, notes, and snippets.

@leebrandt
Created July 21, 2015 19:57
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 leebrandt/7a01aa40162ab61899d6 to your computer and use it in GitHub Desktop.
Save leebrandt/7a01aa40162ab61899d6 to your computer and use it in GitHub Desktop.
/**
* Media Queries
* Allows you to use inline media queries.
* @link http://jakearchibald.github.com/sass-ie/
* @param {String} $breakpoint - breakpoint
* @param {String} $query (min-width) - query type
* @param {String} $type (screen) - media type
* @example scss
* .foobar { @include mq(20em) { ... } }
*/
@mixin mq($breakpoint, $query: 'min-width', $type: 'screen') { // breakpoint can be a variable
// if media queries are not supported
@if $fix-mqs {
@if $fix-mqs >= $breakpoint { // ...and if the fixed breakpoint is greater than query...
@content; // ...output the content the user gave us.
}
}
// Otherwise, output it using a regular media query
@else {
@media #{$type} and (#{$query}: #{$breakpoint}) { @content; }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment