stylesheets/singularitygs/math/_columns.scss in singularitygs-1.0.8 vs stylesheets/singularitygs/math/_columns.scss in singularitygs-1.1.0

- old
+ new

@@ -1,14 +1,18 @@ ////////////////////////////// // Find width, in percentages, of the column span ////////////////////////////// -@function column-span($span, $location, $grid: false, $gutter: false) { +@function column-span($span, $location, $grid: false, $gutter: false, $gutter-style: false) { // Find the grid and gutters $grid: find-grid($grid); $gutter: find-gutter($gutter); + @if fixed-gutter($grid, $gutter, $gutter-style) { + $gutter: 0; + } + // @debug $grid; // @debug $gutter; // Combine the grid and gutters $grid-and-gutters: column-sum($grid, $gutter); @@ -47,18 +51,31 @@ ////////////////////////////// // Find the total sum of the grid ////////////////////////////// @function column-sum($grid, $gutter) { + $split: if(index(find-gutter-style(), split), true, false); + @if type-of($grid) == 'number' or length($grid) == 1 { - @return nth($grid, 1) + ((column-count(nth($grid, 1)) - 1) * nth($gutter, 1)); + @if $split { + @return nth($grid, 1) + ((column-count(nth($grid, 1))) * nth($gutter, 1)); + } + @else { + @return nth($grid, 1) + ((column-count(nth($grid, 1)) - 1) * nth($gutter, 1)); + } + } @else if type-of($grid) == 'list' { $sum: 0; @each $column in $grid { $sum: $sum + nth($column, 1); } - $sum: $sum + (column-count($grid) - 1) * nth($gutter, 1); + @if $split { + $sum: $sum + (column-count($grid)) * nth($gutter, 1); + } + @else { + $sum: $sum + (column-count($grid) - 1) * nth($gutter, 1); + } @return $sum; } } ////////////////////////////// \ No newline at end of file