| 1 |
@function _radial-arg-parser($g1, $g2, $pos, $shape-size) { |
| 2 |
@if $output-bourbon-deprecation-warnings == true { |
| 3 |
@warn "[Bourbon] [Deprecation] `_radial-arg-parser` is " + |
| 4 |
"deprecated and will be removed in 5.0.0."; |
| 5 |
} |
| 6 |
|
| 7 |
@each $value in $g1, $g2 { |
| 8 |
$first-val: nth($value, 1); |
| 9 |
$pos-type: type-of($first-val); |
| 10 |
$spec-at-index: null; |
| 11 |
|
| 12 |
// Determine if spec was passed to mixin |
| 13 |
@if type-of($value) == list { |
| 14 |
$spec-at-index: if(index($value, at), index($value, at), false); |
| 15 |
} |
| 16 |
@if $spec-at-index { |
| 17 |
@if $spec-at-index > 1 { |
| 18 |
@for $i from 1 through ($spec-at-index - 1) { |
| 19 |
$shape-size: $shape-size nth($value, $i); |
| 20 |
} |
| 21 |
@for $i from ($spec-at-index + 1) through length($value) { |
| 22 |
$pos: $pos nth($value, $i); |
| 23 |
} |
| 24 |
} |
| 25 |
@else if $spec-at-index == 1 { |
| 26 |
@for $i from ($spec-at-index + 1) through length($value) { |
| 27 |
$pos: $pos nth($value, $i); |
| 28 |
} |
| 29 |
} |
| 30 |
$g1: null; |
| 31 |
} |
| 32 |
|
| 33 |
// If not spec calculate correct values |
| 34 |
@else { |
| 35 |
@if ($pos-type != color) or ($first-val != "transparent") { |
| 36 |
@if ($pos-type == number) |
| 37 |
or ($first-val == "center") |
| 38 |
or ($first-val == "top") |
| 39 |
or ($first-val == "right") |
| 40 |
or ($first-val == "bottom") |
| 41 |
or ($first-val == "left") { |
| 42 |
|
| 43 |
$pos: $value; |
| 44 |
|
| 45 |
@if $pos == $g1 { |
| 46 |
$g1: null; |
| 47 |
} |
| 48 |
} |
| 49 |
|
| 50 |
@else if |
| 51 |
($first-val == "ellipse") |
| 52 |
or ($first-val == "circle") |
| 53 |
or ($first-val == "closest-side") |
| 54 |
or ($first-val == "closest-corner") |
| 55 |
or ($first-val == "farthest-side") |
| 56 |
or ($first-val == "farthest-corner") |
| 57 |
or ($first-val == "contain") |
| 58 |
or ($first-val == "cover") { |
| 59 |
|
| 60 |
$shape-size: $value; |
| 61 |
|
| 62 |
@if $value == $g1 { |
| 63 |
$g1: null; |
| 64 |
} |
| 65 |
|
| 66 |
@else if $value == $g2 { |
| 67 |
$g2: null; |
| 68 |
} |
| 69 |
} |
| 70 |
} |
| 71 |
} |
| 72 |
} |
| 73 |
@return $g1, $g2, $pos, $shape-size; |
| 74 |
} |