Sha256: 41ac566b63342b9894e6c01f82ce569e1bde870461082b0de86aa3a8eba466cf

Contents?: true

Size: 892 Bytes

Versions: 2

Compression:

Stored size: 892 Bytes

Contents

@function linear-gradient($pos: top, $G1: false, $G2: false,
                       $G3: false, $G4: false,
                       $G5: false, $G6: false,
                       $G7: false, $G8: false,
                       $G9: false, $G10: false) {

  // Detect what type of value exists in $pos
  $pos-type: type-of(nth($pos, 1));

  // If $pos is missing from mixin, reassign vars and add default position
  @if $pos-type == color or transparent {
    $G10: $G9; $G9: $G8; $G8: $G7; $G7: $G6; $G6: $G5;
     $G5: $G4; $G4: $G3; $G3: $G2; $G2: $G1; $G1: $pos;
    $pos: top; // Default position
  }

  $full: compact($G1, $G2, $G3, $G4, $G5, $G6, $G7, $G8, $G9, $G10);

  //If position was included in the mixin/function
  @if type-of(nth($full, 1)) != color or transparent {
    @return $full;
  }

  //Else add the default position
  @else {
    @return join($pos, $full, comma);
  }
}

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
bourbon-0.1.2 app/assets/stylesheets/functions/_linear-gradient.css.scss
bourbon-0.1.1 app/assets/stylesheets/functions/_linear-gradient.css.scss