Sha256: f7a987ebba39cefbcf96e8e404acb1a4013d1bcd2ce1f522cd51775b560efe5a

Contents?: true

Size: 1.15 KB

Versions: 3

Compression:

Stored size: 1.15 KB

Contents

// Math Validation
// ===============

// Valid Columns
// -------------
// Check that a column setting is valid.
@function valid-columns(
  $columns,
  $silent: false
) {
  $type: type-of($columns);
  $return: null;

  @if $type == number and unitless($columns) {
    $return: $columns;
  } @else if $type == list {
    $fail: false;
    @each $col in $columns {
      $number: if(type-of($col == number), true, null);
      $fail: $fail or if($number and unitless($col), null, true);
    }
    $return: if($fail, $return, $columns);
  }

  @if $return != $columns and not $silent {
    $return: null;
    $warn: '$columns must be a unitless number or list of unitless numbers.';
    @warn $warn + ' Current value [#{$type}]: #{$columns}';
  }

  @return $return;
}

// Valid Gutters
// -------------
// Check that a gutter setting is valid.
@function valid-gutters(
  $gutters,
  $silent: false
) {
  $type: type-of($gutters);
  $return: null;

  @if $type == number and unitless($gutters) {
    $return: $gutters;
  } @else if not $silent {
    $warn: '$gutters must be a unitless number.';
    @warn $warn + ' Current value [#{$type}]: #{$gutters}';
  }

  @return $return;
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
susy-2.0.0 sass/susy/math/_validation.scss
susy-2.0.0.rc.2 sass/susy/math/_validation.scss
susy-2.0.0.rc.1 sass/susy/math/_validation.scss