Skip to content

Instantly share code, notes, and snippets.

@alexmattorr
Forked from krambuhl/grid.scss
Created August 9, 2014 20:22
Show Gist options
  • Save alexmattorr/7f1fb76f158557d7d7ef to your computer and use it in GitHub Desktop.
Save alexmattorr/7f1fb76f158557d7d7ef to your computer and use it in GitHub Desktop.
$grid-max: 12;
$grid-column: 80px;
$grid-gutter: 0;
@function gridw ($span: $grid-max, $offset: 0) {
@if $span != -1 {
@return ($grid-column * $span) + ($grid-gutter * ($span - 1)) + $offset;
}
@return -1;
}
@mixin grid ($span: $grid-max, $offset: 0) {
width: gridw($span, $offset);
}
@mixin grid-respond ($min: -1, $max: -1, $media: "all") {
// mixin from respond.scss
// https://gist.github.com/krambuhl/9dd229f391aceb3012b4
@include respond(gridw($min), gridw($max), $media) { @content };
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment