// ------------------------------------------ // BLOCK GRID // Based heavily on ZURB's Foundation // ------------------------------------------ $max-blocks : 12 !default; $block-distance : 15px !default; @mixin block-grid-calc ( $per-row : false, $distance : em($block-distance), $collapse : false, $for-base : true ) { @if $per-row { width : 100% / $per-row; &:nth-of-type(n) { clear: none; } &:nth-of-type(#{$per-row}n+1) { clear: both; } } @else { @if $collapse { padding : 0; } @else { padding : 0 ($distance / 2); } } } @mixin block-grid ( $per-row : false, $distance : em($block-distance), $collapse : false, $for-base : true ) { // For base class @if $for-base { display : block; padding : 0; @if $collapse { margin : 0; } @else { margin : 0 (-$distance / 2); } @include clearfix; & > li { position: relative; display : block; height : auto; float : $default-float; @include block-grid-calc($distance:$distance, $collapse:$collapse); } } @if $per-row { & > li { @include block-grid-calc($per-row:$per-row); } } } @if $include-block-grid { /* --------------- EDGE Block Grid --------------- */ [class*="block-grid-"] { @include block-grid(); &.collapse { @include block-grid($collapse:true); } } @for $i from 1 through $max-blocks { .large-block-grid-#{$i} { @include block-grid($per-row:$i, $for-base:false ); } } @include small { // Make large-block-grid 100% width, but only on responsive site body:not(.not-responsive) { [class*="large-block-grid-"] > li { width: 100%; } @for $i from 1 through $max-blocks { .small-block-grid-#{$i} { @include block-grid($per-row:$i, $for-base:false ); } } } // Remove large grid clearing @for $i from 1 through $max-blocks { .large-block-grid-#{$i} > li:nth-of-type(#{$i}n+1) { clear: none; } } } } // include-block-grid