| 1 |
// Requires Sass 3.1+ |
| 2 |
@mixin radial-gradient($g1, $g2, |
| 3 |
$g3: null, $g4: null, |
| 4 |
$g5: null, $g6: null, |
| 5 |
$g7: null, $g8: null, |
| 6 |
$g9: null, $g10: null, |
| 7 |
$pos: null, |
| 8 |
$shape-size: null, |
| 9 |
$fallback: null) { |
| 10 |
@include _bourbon-deprecate-for-prefixing("radial-gradient"); |
| 11 |
|
| 12 |
$data: _radial-arg-parser($g1, $g2, $pos, $shape-size); |
| 13 |
$g1: nth($data, 1); |
| 14 |
$g2: nth($data, 2); |
| 15 |
$pos: nth($data, 3); |
| 16 |
$shape-size: nth($data, 4); |
| 17 |
|
| 18 |
$full: $g1, $g2, $g3, $g4, $g5, $g6, $g7, $g8, $g9, $g10; |
| 19 |
|
| 20 |
// Strip deprecated cover/contain for spec |
| 21 |
$shape-size-spec: _shape-size-stripper($shape-size); |
| 22 |
|
| 23 |
// Set $g1 as the default fallback color |
| 24 |
$first-color: nth($full, 1); |
| 25 |
$fallback-color: nth($first-color, 1); |
| 26 |
|
| 27 |
@if (type-of($fallback) == color) or ($fallback == "transparent") { |
| 28 |
$fallback-color: $fallback; |
| 29 |
} |
| 30 |
|
| 31 |
// Add Commas and spaces |
| 32 |
$shape-size: if($shape-size, "#{$shape-size}, ", null); |
| 33 |
$pos: if($pos, "#{$pos}, ", null); |
| 34 |
$pos-spec: if($pos, "at #{$pos}", null); |
| 35 |
$shape-size-spec: if(($shape-size-spec != " ") and ($pos == null), "#{$shape-size-spec}, ", "#{$shape-size-spec} "); |
| 36 |
|
| 37 |
background-color: $fallback-color; |
| 38 |
background-image: -webkit-radial-gradient(#{$pos}#{$shape-size}#{$full}); |
| 39 |
background-image: radial-gradient(#{$shape-size-spec}#{$pos-spec}#{$full}); |
| 40 |
} |