Created
March 11, 2018 07:33
-
-
Save as3k/29490878c440cc09e51ab324de422ba8 to your computer and use it in GitHub Desktop.
Responsive Media Query LESS Mixin
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
// Media query breakpoints | |
@screen-xs-min: 48rem; | |
@screen-sm-min: 76.8rem; | |
@screen-md-min: 99.2rem; | |
@screen-lg-min: 120rem; | |
// Media query function creates a media query | |
// when these are used. | |
.media(@min, @styles) { | |
@media only screen and (min-width: @min) { | |
@styles(); | |
} | |
} | |
// Breakpoints | |
.bpsm(@styles) {.media(@screen-xs-min, @styles)} | |
.bpmd(@styles) {.media(@screen-sm-min, @styles)} | |
.bplg(@styles) {.media(@screen-md-min, @styles)} | |
.bpxl(@styles) {.media(@screen-lg-min, @styles)} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment