Created
April 20, 2016 04:00
-
-
Save amandasaffer/881363637707ccc20f385ec5c1073523 to your computer and use it in GitHub Desktop.
Dependency-free breakpoint mixin
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
/*============================================================================ | |
Dependency-free breakpoint mixin | |
- http://blog.grayghostvisuals.com/sass/sass-media-query-mixin/ | |
==============================================================================*/ | |
$min: min-width; | |
$max: max-width; | |
$small: 480px; | |
$medium: 768px; | |
$large: 1200px; | |
@mixin at-query ($constraint, $viewport1, $viewport2:null) { | |
@if $constraint == $min { | |
@media screen and ($min: $viewport1) { | |
@content; | |
} | |
} @else if $constraint == $max { | |
@media screen and ($max: $viewport1) { | |
@content; | |
} | |
} @else { | |
@media screen and ($min: $viewport1) and ($max: $viewport2) { | |
@content; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment