views:

108

answers:

2

The interface should look like this

+box(optional_padding_value_in_columns)

It shouldn't break the grid. (If placed in column that spans 7 units, then the box should stay within the 7 units.)

Compass _scaffolding.sass actually includes this little number:

// Mixin +box to create a padded box inside a column.
=box
  :padding 1.5em
  :margin-bottom 1.5em
  :background #E5ECF9

But the padding blows up the grid.

A: 
Try this:

// You can supply one padding value or all 4
=padded_column(!n, !p1, !p2=!p1, !p3=!p1, !p4=!p1)
  +column(!n)
  :padding= !p1 !p2 !p3 !p4
  !width = !blueprint_grid_width * !n + (!blueprint_grid_margin * (!n - 1)) - !p2 - !p4

.padded_box
  +padded_column(!two_columns_secondary, 10px, 0, 5px, 15px)
  :background #f0f0f0

Hope that helps - Steve

Steve Leung
A: 

The +box mixin is meant for a block element used inside a column. The 1.5em padding is not proportional to the blueprint column width so putting it on a column element will break the layout.

Andrew Vit