Deprecate the span mixin in favor of the span-fluid() function in the blueprint fluid grid.

This commit is contained in:
Chris Eppstein 2011-01-04 19:20:00 -08:00
parent 0fee93ff5b
commit df756b194c

View File

@ -55,8 +55,7 @@ $blueprint-liquid-grid-push-pull: -($blueprint-liquid-grid-margin + $blueprint-l
@include container; } @include container; }
// Use these classes (or mixins) to set the width of a column. // Use these classes (or mixins) to set the width of a column.
@for $n from 1 to $blueprint-liquid-grid-columns + 1 { @for $n from 1 to $blueprint-liquid-grid-columns + 1 {
.span-#{$n} { .span-#{$n} { width: span-fluid($n); }
@include span($n); }
div { div {
&.span-#{$n} { &.span-#{$n} {
@include column($n, $n == $blueprint-liquid-grid-columns); } } } @include column($n, $n == $blueprint-liquid-grid-columns); } } }
@ -86,9 +85,15 @@ $blueprint-liquid-grid-push-pull: -($blueprint-liquid-grid-margin + $blueprint-l
margin: 0 auto; margin: 0 auto;
@include clearfix; } @include clearfix; }
@mixin span($n, $override: false) { // Return the width of `$n` columns in percents.
$width: $blueprint-liquid-grid-width * $n + $blueprint-liquid-grid-margin * ($n - 1); @function span-fluid($n) {
@if $override { @return $blueprint-liquid-grid-width * $n + $blueprint-liquid-grid-margin * ($n - 1);
}
@mixin span($n, $important: false) {
@warn "The span mixin is deprecated. Please use the span-fluid function instead. E.g. width: span-fluid(#{$n})";
$width: span-fluid($n);
@if $important {
width: $width !important; } width: $width !important; }
@else { @else {
width: $width; } } width: $width; } }
@ -99,7 +104,7 @@ $blueprint-liquid-grid-push-pull: -($blueprint-liquid-grid-margin + $blueprint-l
@mixin column($n, $last: false) { @mixin column($n, $last: false) {
@include float-left; @include float-left;
overflow: hidden; overflow: hidden;
@include span($n); width: span-fluid($n);
@if $last { @if $last {
@include last; } @include last; }
@else { @else {