Sha256: a8b4278a2616fcb3a79aca98fe2c9ed458b273eef18dfdc2b64c1f6fa63adc3b

Contents?: true

Size: 1.36 KB

Versions: 7

Compression:

Stored size: 1.36 KB

Contents

// Render Deprecated Webkit Gradient - Linear || Radial
//************************************************************************//
@function deprecated-webkit-gradient($type,
                                     $deprecated-pos1, $deprecated-pos2,
                                     $full,
                                     $deprecated-radius1: false, $deprecated-radius2: false) {
  $gradient-list: ();
  $gradient: false;
  $full-length: length($full);
  $percentage: false;
  $gradient-type: $type;

  @for $i from 1 through $full-length {
    $gradient: nth($full, $i);

    @if length($gradient) == 2 {
      $color-stop: color-stop(nth($gradient, 2), nth($gradient, 1));
      $gradient-list: join($gradient-list, $color-stop, comma);
    }

    @else if $gradient != null {
      @if $i == $full-length {
        $percentage: 100%;
      }

      @else {
        $percentage: ($i - 1) * (100 / ($full-length - 1)) + "%";
      }

      $color-stop: color-stop(unquote($percentage), $gradient);
      $gradient-list: join($gradient-list, $color-stop, comma);
    }
  }

  @if $type == radial {
    $gradient: -webkit-gradient(radial, $deprecated-pos1, $deprecated-radius1, $deprecated-pos2, $deprecated-radius2, $gradient-list);
  }

  @else if $type == linear {
    $gradient: -webkit-gradient(linear, $deprecated-pos1, $deprecated-pos2, $gradient-list);
  }

  @return $gradient;
}

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
bourbon-compass-3.1.1 stylesheets/bourbon/functions/_deprecated-webkit-gradient.scss
bourbon-3.1.1 app/assets/stylesheets/functions/_deprecated-webkit-gradient.scss
bourbon-compass-3.1.0 stylesheets/bourbon/functions/_deprecated-webkit-gradient.scss
bourbon-3.1.0 app/assets/stylesheets/functions/_deprecated-webkit-gradient.scss
bourbon-compass-3.0.1 stylesheets/bourbon/functions/_deprecated-webkit-gradient.scss
bourbon-3.0.1 app/assets/stylesheets/functions/_deprecated-webkit-gradient.scss
bourbon-3.0.0 app/assets/stylesheets/functions/_deprecated-webkit-gradient.scss