Last active
August 29, 2015 14:04
-
-
Save yankeyhotel/be4ec9d1b6e33b772f70 to your computer and use it in GitHub Desktop.
A nicer way of doing @media queriers in Less
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
// @media queries vars | |
// @mq-xxs - [ 0px - 480px] | |
// @mq-xs - [ 481px - 767px] | |
// @mq-sm - [ 768px - 991px] | |
// @mq-md - [ 992px - 1199px] | |
// @mq-lg - [1200px +] | |
@mq-xxs: ~"only screen and (max-width: @{screen-xs})"; | |
@mq-xs: ~"only screen and (min-width: @{screen-xs} + 1) and (max-width: @{screen-xs-max})"; | |
@mq-sm: ~"only screen and (min-width: @{screen-sm}) and (max-width: @{screen-sm-max})"; | |
@mq-md: ~"only screen and (min-width: @{screen-md}) and (max-width: @{screen-md-max})"; | |
@mq-lg: ~"only screen and (min-width: @{screen-lg})"; | |
@mq-xs-plus: ~"only screen and (min-width: @{screen-xs})"; // 480px + | |
@mq-sm-plus: ~"only screen and (min-width: @{screen-sm})"; // 768px + | |
@mq-md-plus: ~"only screen and (min-width: @{screen-md})"; // 992px + | |
// how to use | |
@media @mq-xs { | |
color: red; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment