Last active
August 16, 2016 10:13
-
-
Save imjared/9b59c2db295acaefaac5 to your computer and use it in GitHub Desktop.
scss breakpoint helpers based on bootstrap
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
// breakpoint helpers based on bootstrap's breakpoints | |
@mixin xs { | |
@media #{screen} and (max-width: #{$screen-xs-max}) { | |
@content; | |
} | |
} | |
@mixin sm { | |
@media #{screen} and (min-width: #{$screen-sm-min}) and (max-width: #{$screen-sm-max}) { | |
@content; | |
} | |
} | |
@mixin md { | |
@media #{screen} and (min-width: #{$screen-md-min}) and (max-width: #{$screen-md-max}) { | |
@content; | |
} | |
} | |
@mixin lg { | |
@media #{screen} and (min-width: #{$screen-lg-min}) { | |
@content; | |
} | |
} | |
// inclusive mixins | |
@mixin sm-and-down { | |
@media #{screen} and (max-width: #{$screen-sm-max}) { | |
@content; | |
} | |
} | |
@mixin sm-and-up { | |
@media #{screen} and (min-width: #{$screen-sm-min}) { | |
@content; | |
} | |
} | |
@mixin md-and-down { | |
@media #{screen} and (max-width: #{$screen-md-max}) { | |
@content; | |
} | |
} | |
@mixin md-and-up { | |
@media #{screen} and (min-width: #{$screen-md-min}) { | |
@content; | |
} | |
} | |
// specific | |
@mixin breakpoint-max($w) { | |
@media #{$screen} and (max-width: $w) { | |
@content; | |
} | |
} | |
@mixin breakpoint-min($w) { | |
@media #{$screen} and (min-width: $w) { | |
@content; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment