Skip to content

Instantly share code, notes, and snippets.

@davidmerrique
Created December 23, 2012 15:10
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 davidmerrique/4363870 to your computer and use it in GitHub Desktop.
Save davidmerrique/4363870 to your computer and use it in GitHub Desktop.
Apply-to media query.
// 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