Skip to content

Instantly share code, notes, and snippets.

@mattstauffer
Created August 6, 2012 20:57
Show Gist options
  • Save mattstauffer/3278397 to your computer and use it in GitHub Desktop.
Save mattstauffer/3278397 to your computer and use it in GitHub Desktop.
Complex Sass breakpoint declaration
@function column-width($cols) {
@return 90px * $cols;
}
@function column-under-width($cols) {
@return (90px * $cols) - 1;
}
@function over-mq($w) {
@return "screen and (min-width: #{$w})";
}
@function under-mq($w) {
@return "screen and (max-width: #{$w})";
}
// 15 cols: 1350px
$break-15: column-width(15);
$break-15-mq: over-mq($break-15);
$break-under-15: column-under-width(15);
$break-under-15-mq: under-mq($break-under-15);
// 13 cols: 1170px
$break-13: column-width(13);
$break-13-mq: over-mq($break-13);
$break-under-13: column-under-width(13);
$break-under-13-mq: under-mq($break-under-13);
// 11 cols: 990px
$break-11: column-width(11);
$break-11-mq: over-mq($break-11);
$break-under-11: column-under-width(11);
$break-under-11-mq: under-mq($break-under-11);
// 9 cols: 810px
$break-9: column-width(9);
$break-9-mq: over-mq($break-9);
$break-under-9: column-under-width(9);
$break-under-9-mq: under-mq($break-under-9);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment