Sha256: 10cabf18ca44502e207e879c2a1215b40633fac65ea870464c6c977206a7aca7

Contents?: true

Size: 1.34 KB

Versions: 8

Compression:

Stored size: 1.34 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 $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

8 entries across 8 versions & 2 rubygems

Version Path
bourbon-compass-2.1.3 stylesheets/bourbon/functions/_deprecated-webkit-gradient.scss
bourbon-2.1.3 app/assets/stylesheets/functions/_deprecated-webkit-gradient.scss
bourbon-compass-2.1.2 stylesheets/bourbon/functions/_deprecated-webkit-gradient.scss
bourbon-2.1.2 app/assets/stylesheets/functions/_deprecated-webkit-gradient.scss
bourbon-compass-2.1.1.0 stylesheets/bourbon/functions/_deprecated-webkit-gradient.scss
bourbon-2.1.1 app/assets/stylesheets/functions/_deprecated-webkit-gradient.scss
bourbon-2.1.0 app/assets/stylesheets/functions/_deprecated-webkit-gradient.scss
bourbon-2.0.0.rc1 app/assets/stylesheets/functions/_deprecated-webkit-gradient.scss