| 1 |
// Private function for linear-gradient-parser |
| 2 |
@function _linear-angle-parser($image, $first-val, $prefix, $suffix) { |
| 3 |
@if $output-bourbon-deprecation-warnings == true { |
| 4 |
@warn "[Bourbon] [Deprecation] `_linear-angle-parser` is " + |
| 5 |
"deprecated and will be removed in 5.0.0."; |
| 6 |
} |
| 7 |
|
| 8 |
$offset: null; |
| 9 |
$unit-short: str-slice($first-val, str-length($first-val) - 2, str-length($first-val)); |
| 10 |
$unit-long: str-slice($first-val, str-length($first-val) - 3, str-length($first-val)); |
| 11 |
|
| 12 |
@if ($unit-long == "grad") or |
| 13 |
($unit-long == "turn") { |
| 14 |
$offset: if($unit-long == "grad", -100grad * 3, -0.75turn); |
| 15 |
} |
| 16 |
|
| 17 |
@else if ($unit-short == "deg") or |
| 18 |
($unit-short == "rad") { |
| 19 |
$offset: if($unit-short == "deg", -90 * 3, 1.6rad); |
| 20 |
} |
| 21 |
|
| 22 |
@if $offset { |
| 23 |
$user-deprecation-warnings-setting: $output-bourbon-deprecation-warnings; |
| 24 |
$output-bourbon-deprecation-warnings: false !global; |
| 25 |
|
| 26 |
$num: _str-to-num($first-val); |
| 27 |
|
| 28 |
$output-bourbon-deprecation-warnings: $user-deprecation-warnings-setting !global; |
| 29 |
|
| 30 |
@return ( |
| 31 |
webkit-image: -webkit- + $prefix + ($offset - $num) + $suffix, |
| 32 |
spec-image: $image |
| 33 |
); |
| 34 |
} |
| 35 |
} |