@import "compass/utilities"; // Configure grid coordinates $grid-columns: 12 !default; $grid-width: 60px !default; $grid-gutter-width: 20px !default; @mixin grid-coordinates { /* Grid-Coordinates by Adam Stacoviak * Fork me: http://adamstac.com/grid-coordinates */ .grid-container { margin: 0 auto; overflow: hidden; width: $grid-columns * $grid-width + $grid-columns * $grid-gutter-width; } .nested-grid-container { display: inline-block; margin: { left: -$grid-gutter-width / 2; right: -$grid-gutter-width / 2; }; overflow: hidden; width: auto; } .grid-block { @include float-left; overflow: hidden; margin: 0 $grid-gutter-width / 2; } @for $i from 1 through $grid-columns { .grid-#{$i} { @include grid($i); @extend .grid-block; } } .grid-full { @include grid($grid-columns); } @for $i from 1 through $grid-columns - 1 { .grid-prefix-#{$i} { @include grid-prefix($i); } } @for $i from 1 through $grid-columns - 1 { .grid-suffix-#{$i} { @include grid-suffix($i); } } } @mixin grid($grid-columns) { @include grid-width($grid-columns); } @mixin grid-width($grid-columns) { @if $grid-columns == 1 { width: $grid-width; } @else { width: $grid-columns * $grid-width + $grid-columns * $grid-gutter-width - $grid-gutter-width; } } @mixin grid-prefix($grid-columns) { @if $grid-columns == 1 { padding-left: $grid-width + $grid-gutter-width; } @else { padding-left: $grid-columns * $grid-width + $grid-columns * $grid-gutter-width; } } @mixin grid-suffix($grid-columns) { @if $grid-columns == 1 { padding-right: $grid-width + $grid-gutter-width; } @else { padding-right: $grid-columns * $grid-width + $grid-columns * $grid-gutter-width; } }