Last active
April 27, 2017 15:03
-
-
Save ifcanduela/96465c2059b2185d62d9 to your computer and use it in GitHub Desktop.
Responsive breakpoints using LESS variables
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
/////////////////////////////////////////////////////////////////////////////// | |
// RESPONSIVE BREAKPOINTS | |
@xs: 640px; | |
@xs_plus_one: (@xs + 1px); | |
@sm: 768px; | |
@sm_plus_one: (@sm + 1px); | |
@md: 992px; | |
@md_plus_one: (@md + 1px); | |
@lg: 1200px; | |
@lg_plus_one: (@lg + 1px); | |
// main breakpoints | |
@to_xs: ~"(max-width: @{xs})"; | |
@from_xs: ~"(min-width: @{xs_plus_one})"; | |
@to_sm: ~"(max-width: @{sm})"; | |
@from_sm: ~"(min-width: @{sm_plus_one})"; | |
@to_md: ~"(max-width: @{md})"; | |
@from_md: ~"(min-width: @{md_plus_one})"; | |
@to_lg: ~"(max-width: @{lg})"; | |
@from_lg: ~"(min-width: @{lg_plus_one})"; | |
// ranges | |
@from_xs_to_sm: ~"@{from_xs} and @{to_sm}"; | |
@from_xs_to_md: ~"@{from_xs} and @{to_md}"; | |
@from_xs_to_lg: ~"@{from_xs} and @{to_lg}"; | |
@from_sm_to_md: ~"@{from_sm} and @{to_md}"; | |
@from_sm_to_lg: ~"@{from_sm} and @{to_lg}"; | |
@from_md_to_lg: ~"@{from_md} and @{to_lg}"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you! Bro!