Sha256: c17417c75bfa5d0829213b104a9adc9509e3109423c12e0f9da21f4baada92d8

Contents?: true

Size: 1.3 KB

Versions: 2

Compression:

Stored size: 1.3 KB

Contents

// Location math
// =============

// Is Last
// -------
// Find if a span covers the last columns
// - $span        : <number>
// - $location    : first | last | <number>
// - [$columns]   : <number> | <list>
@function is-last(
  $span,
  $location,
  $columns: $columns
) {
  $is-last: false;

  @if $location == "last" or $location == "omega" {
    $is-last: true;
  } @else if $location + ($span - 1) == column-count($columns) {
    $is-last: true;
  }

  @return $is-last;
}

// Is First
// --------
// Find if a span covers the first columns
// - $location    : first | last | <number>
@function is-first(
  $location
) {
  @if $location == "first" or $location == "alpha" or $location == 1 {
    @return true;
  } @else {
    @return false;
  }
}

// Get Location Position
// ---------------------
// Return a numeric location, even if a first/last keyword is used
// - $span        : <number>
// - $location    : first | last | <number>
// - [$columns]   : <number> | <list>
@function get-location-position(
  $span,
  $location,
  $columns: $columns
) {
  @if type-of($location) == number {
    @return $location;
  } @else if $location == first or $location == alpha {
    @return 1;
  } @else if $location == last or $location == omega {
    @return column-count($columns) - $span + 1;
  } @else {
    @return false;
  }
}

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
susy-2.0.0.alpha.4 sass/susy/math/_location.scss
susy-2.0.0.alpha.3 sass/susy/math/_location.scss