Sha256: b4a861d4ab0137fe14c2e48ec1e445223958fdcd63cc9dc375cacc66b8391a0d

Contents?: true

Size: 1.47 KB

Versions: 4

Compression:

Stored size: 1.47 KB

Contents

//
// Block Grid Variables
//

// We use this to control the maximum number of block grid elements per row
$block-grid-elements: 12 !default;
$block-grid-default-spacing: 10px !default;


//
// Block Grid Mixins
//

// We use this mixin to create different block-grids. You can apply per-row and spacing options.
// Setting $base-style to false will ommit default styles.
@mixin block-grid($per-row:false, $spacing:$block-grid-default-spacing, $base-style:true) {

  @if $base-style {
    display: block;
    overflow: hidden;
    padding: 0;
    margin: 0 (-$spacing);

    &>li {
      display: block;
      height: auto;
      float: $default-float;
      padding: 0 $spacing $spacing;
    }
  }

  @if $per-row {
    &>li {
      width: 100%/$per-row;
      padding: 0 $spacing $spacing;
    }
    &:nth-of-type(#{$per-row}n+1) { clear: both; }
  }

}


/* Foundation Block Grids for below small breakpoint */
@media only screen {
  [class*="block-grid-"] { @include block-grid; }

  @for $i from 2 through $block-grid-elements {
    .small-block-grid-#{($i)} {
      @include block-grid($i,$block-grid-default-spacing,false);
    }
  }
}

/* Foundation Block Grids for above small breakpoint */
@media #{$small} {
  @for $i from 2 through $block-grid-elements {
    .large-block-grid-#{($i)} {
      @if      $i == 2 { @include block-grid(2,15px,false); }
      @else if $i == 3 { @include block-grid(3,12px,false); }
      @else { @include block-grid($i,$block-grid-default-spacing,false); }
    }
  }
}

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
zurb-foundation-4.0.2 scss/foundation/components/_block-grid.scss
zurb-foundation-4.0.1 scss/foundation/components/_block-grid.scss
zurb-foundation-4.0.0 scss/foundation/components/_block-grid.scss
zurb-foundation-4.0.0.rc1 scss/foundation/components/_block-grid.scss