| 1 |
// Render Deprecated Webkit Gradient - Linear || Radial |
| 2 |
//************************************************************************// |
| 3 |
@function _deprecated-webkit-gradient($type, |
| 4 |
$deprecated-pos1, $deprecated-pos2, |
| 5 |
$full, |
| 6 |
$deprecated-radius1: false, $deprecated-radius2: false) { |
| 7 |
$gradient-list: (); |
| 8 |
$gradient: false; |
| 9 |
$full-length: length($full); |
| 10 |
$percentage: false; |
| 11 |
$gradient-type: $type; |
| 12 |
|
| 13 |
@for $i from 1 through $full-length { |
| 14 |
$gradient: nth($full, $i); |
| 15 |
|
| 16 |
@if length($gradient) == 2 { |
| 17 |
$color-stop: color-stop(nth($gradient, 2), nth($gradient, 1)); |
| 18 |
$gradient-list: join($gradient-list, $color-stop, comma); |
| 19 |
} |
| 20 |
@else if $gradient != null { |
| 21 |
@if $i == $full-length { |
| 22 |
$percentage: 100%; |
| 23 |
} |
| 24 |
@else { |
| 25 |
$percentage: ($i - 1) * (100 / ($full-length - 1)) + "%"; |
| 26 |
} |
| 27 |
$color-stop: color-stop(unquote($percentage), $gradient); |
| 28 |
$gradient-list: join($gradient-list, $color-stop, comma); |
| 29 |
} |
| 30 |
} |
| 31 |
|
| 32 |
@if $type == radial { |
| 33 |
$gradient: -webkit-gradient(radial, $deprecated-pos1, $deprecated-radius1, $deprecated-pos2, $deprecated-radius2, $gradient-list); |
| 34 |
} |
| 35 |
@else if $type == linear { |
| 36 |
$gradient: -webkit-gradient(linear, $deprecated-pos1, $deprecated-pos2, $gradient-list); |
| 37 |
} |
| 38 |
@return $gradient; |
| 39 |
} |