Created
July 21, 2015 19:57
-
-
Save leebrandt/7a01aa40162ab61899d6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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