Sha256: abc8431cbf734b552d43403941778185bc1dd07bad58e45277102aaacb6dcec5

Contents?: true

Size: 672 Bytes

Versions: 4

Compression:

Stored size: 672 Bytes

Contents

// Used to create create columns in a row that span the width of multiple columns in another row.
// See the readme for more details on usage.
@mixin col-span($span: $columns of $total-columns, $gutter: 0) {
  $columns: nth($span, 1);
  $container-columns: nth($span, 3);

  @if ($gutter != 0 and unit($gutter) != "%") {
    @error "The col-span mixin can only be used if there is no gutter or the gutter's unit is %";
  }

  $single-column-width: (100% - ($gutter * ($container-columns - 1))) / $container-columns;
  $spanned-width: $single-column-width * $columns;
  $spanned-gutters-width: $gutter * ($columns - 1);

  width: $spanned-width + $spanned-gutters-width;
}

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
codelation_ui-1.0.57 app/assets/stylesheets/codelation_ui/_base_resources/mixins/col_span.scss
codelation_ui-1.0.1 app/assets/stylesheets/codelation_ui/_base_resources/mixins/col_span.scss
codelation_ui-1.0.0 app/assets/stylesheets/codelation_ui/_base_resources/mixins/col_span.scss
codelation_assets-0.5.0 app/assets/stylesheets/codelation/mixins/col_span.scss