Created
October 23, 2014 13:37
-
-
Save wujekbogdan/baf293816c856dab6bb9 to your computer and use it in GitHub Desktop.
Breakpoints matcher
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
breakpoints = { | |
sizes: { | |
'xs': 480, | |
'sm': 768, | |
'md': 992, | |
'lg': 1200 | |
}, | |
upTo: function( to ) { | |
var _to = this.sizes[to]; | |
return 'only screen and (max-width:' + _to + 'px)'; | |
}, | |
between: function( from, to ) { | |
var _from = this.sizes[from]; | |
var _to = this.sizes[to]; | |
return 'only screen and (min-width:' + _from + 'px) and (max-width:' + (_to - 1) + 'px)'; | |
}, | |
greaterThan: function( from ) { | |
var _from = this.sizes[from]; | |
return 'only screen and (min-width:' + _from + 'px)'; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment