Skip to content

Commit

Permalink
Make a span() function for blueprint that returns the width in pixels…
Browse files Browse the repository at this point in the history
… of $n columns.
  • Loading branch information
chriseppstein committed Jan 2, 2011
1 parent 068ee42 commit d67a43a
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions frameworks/blueprint/stylesheets/blueprint/_grid.scss
Original file line number Diff line number Diff line change
Expand Up @@ -108,16 +108,20 @@ $blueprint-container-size: $blueprint-grid-outer-width * $blueprint-grid-columns
@include column-base($last);
@include span($n); }

// Return the width of `$n` columns.
@function span($n) {
@return $blueprint-grid-width * $n + $blueprint-grid-margin * ($n - 1);
}

// Set only the width of an element to align it with the grid.
// Most of the time you'll want to use `+column` instead.
//
// This mixin is especially useful for aligning tables to the grid.
@mixin span($n, $override: false) {
$width: $blueprint-grid-width * $n + $blueprint-grid-margin * ($n - 1);
@if $override {
width: $width !important; }
@mixin span($n, $important: false) {
@if $important {
width: span($n) !important; }
@else {
width: $width; } }
width: span($n); } }

// The basic set of styles needed to make an element
// behave like a column:
Expand Down

0 comments on commit d67a43a

Please sign in to comment.