Skip to content

Instantly share code, notes, and snippets.

@wujekbogdan
Created October 23, 2014 13:37
Show Gist options
  • Save wujekbogdan/baf293816c856dab6bb9 to your computer and use it in GitHub Desktop.
Save wujekbogdan/baf293816c856dab6bb9 to your computer and use it in GitHub Desktop.
Breakpoints matcher
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