Created
September 19, 2012 09:57
-
-
Save paulmsmith/3748794 to your computer and use it in GitHub Desktop.
amended respond-min and respond-max from @jaffathecake
This file contains 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
@mixin respond-min($width, $fix-mqs: $fix-mqs) { | |
// If we're outputting for a fixed media query set... | |
@if $fix-mqs { | |
// ...and if we should apply these rules... | |
@if $fix-mqs >= $width { | |
// ...output the content the user gave us. | |
@content; | |
} | |
} | |
@else { | |
// Otherwise, output it using a regular media query | |
@media screen and (min-width: $width) { | |
@content; | |
} | |
} | |
} | |
@mixin respond-max($width, $fix-mqs: $fix-mqs) { | |
// If we're outputting for a fixed media query set... | |
@if $fix-mqs { | |
// ...and if we should apply these rules... | |
@if $fix-mqs <= $width { | |
// ...output the content the user gave us. | |
@content; | |
} | |
} | |
@else { | |
// Otherwise, output it using a regular media query | |
@media screen and (max-width: $width) { | |
@content; | |
} | |
} | |
} | |
// being able to pass in false for the hopefully rare cases you need to not have it output to IE stylesheet. | |
// for example when using something like bootstrap's .hide-desktop, etc | |
@include respond-max($breakPointC, $fix-mqs: false) { | |
.foo { | |
display: block; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment