### Block Grids
-The block grid from Foundation 5 has been merged into the main grid. Add a class of the format `[size]-up-[n]` to change the size of all columns within the row. By default, the max number of columns you can use with block grid are 8.
+Block grids are a shorthand way to create equally-sized columns. Add a class of the format `.[size]-up-[n]` to change the number of columns within the row. By default, the max number of columns you can use with block grid are 8. Adding the `.block-grid-column` class to columns will apply a bottom margin equal to the width of gutters.
```html_example
-<div class="row small-up-1 medium-up-2 large-up-4">
- <div class="column">
- <img src="//placehold.it/300x300" class="thumbnail" alt="">
+<div class="row small-up-2 medium-up-3 large-up-4">
+ <div class="column block-grid-column">
+ <img src="//placehold.it/600x600" class="thumbnail" alt="">
</div>
- <div class="column">
- <img src="//placehold.it/300x300" class="thumbnail" alt="">
+ <div class="column block-grid-column">
+ <img src="//placehold.it/600x600" class="thumbnail" alt="">
</div>
- <div class="column">
- <img src="//placehold.it/300x300" class="thumbnail" alt="">
+ <div class="column block-grid-column">
+ <img src="//placehold.it/600x600" class="thumbnail" alt="">
</div>
- <div class="column">
- <img src="//placehold.it/300x300" class="thumbnail" alt="">
+ <div class="column block-grid-column">
+ <img src="//placehold.it/600x600" class="thumbnail" alt="">
</div>
- <div class="column">
- <img src="//placehold.it/300x300" class="thumbnail" alt="">
+ <div class="column block-grid-column">
+ <img src="//placehold.it/600x600" class="thumbnail" alt="">
</div>
- <div class="column">
- <img src="//placehold.it/300x300" class="thumbnail" alt="">
+ <div class="column block-grid-column">
+ <img src="//placehold.it/600x600" class="thumbnail" alt="">
</div>
</div>
```
$uncollapse: 'uncollapse',
$offset: 'offset',
$end: 'end',
- $expanded: 'expanded'
+ $expanded: 'expanded',
+ $block-grid: 'block-grid'
) {
// Row
.#{$row} {
}
}
+ // Block grid columns
+ .#{$block-grid}-#{$column} {
+ @include block-grid-column;
+ }
+
@if $column == 'column' {
.columns {
// scss-lint:disable PlaceholderInExtend
@warn 'This mixin is being replaced by grid-col-gutter(). grid-col-uncollapse() will be removed in Foundation 6.4.';
@include grid-column-uncollapse($gutter);
}
+
+/// Sets bottom marin on block grid columns to match gutters
+/// @param {Number|Keyword} $margin [auto]
+/// The bottom margin on block grid columns, accepts multiple values:
+/// - A single value will make the margin that exact size.
+/// - A breakpoint name will make the margin the corresponding size in the $gutters map.
+/// - "auto" will make the margin responsive, using the $gutters map values.
+/// @param {Number|Map} $margins [$grid-column-gutter] - Gutter map or single value to use. Responsive gutter settings by default.
+@mixin block-grid-column (
+ $margin: auto,
+ $margins: $grid-column-gutter
+) {
+ @if $margin == auto and type-of($margins) == 'map' {
+ // "auto"
+ @each $breakpoint, $value in $margins {
+ @include breakpoint($breakpoint) {
+ @include block-grid-column($value);
+ }
+ }
+ } @else {
+ // breakpoint name
+ @if type-of($margin) == 'string' {
+ $margin: grid-column-gutter($margin, $margins);
+ }
+
+ // single value
+ $margin-bottom: rem-calc($margin);
+
+ margin-bottom: $margin-bottom;
+ > :last-child {
+ margin-bottom: 0;
+ }
+ }
+}