Created
December 23, 2012 15:10
-
-
Save davidmerrique/4363870 to your computer and use it in GitHub Desktop.
Apply-to media query.
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
// Custom media Query | |
// Use: If you want to a media query to apply to anything less-than or greater-than a specific width. | |
// Example: | |
// @include apply-to(less-than, 1200px) {} | |
// Will apply to anything smaller than 1200px | |
@mixin apply-to($maxmin, $size) { | |
$extrema: null; | |
@if $maxmin == less-than { | |
$extrema: max; | |
} @if $maxmin == greater-than { | |
$extrema: min; | |
} | |
@media only screen and (#{$extrema}-width: $size) { @content; } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment