| 1 |
// Private function for linear-gradient-parser |
| 2 |
@function _linear-side-corner-parser($image, $first-val, $prefix, $suffix, $has-multiple-vals) { |
| 3 |
@if $output-bourbon-deprecation-warnings == true { |
| 4 |
@warn "[Bourbon] [Deprecation] `_linear-side-corner-parser` is " + |
| 5 |
"deprecated and will be removed in 5.0.0."; |
| 6 |
} |
| 7 |
|
| 8 |
$user-deprecation-warnings-setting: $output-bourbon-deprecation-warnings; |
| 9 |
$output-bourbon-deprecation-warnings: false !global; |
| 10 |
|
| 11 |
$val-1: str-slice($first-val, 1, $has-multiple-vals - 1); |
| 12 |
$val-2: str-slice($first-val, $has-multiple-vals + 1, str-length($first-val)); |
| 13 |
$val-3: null; |
| 14 |
$has-val-3: str-index($val-2, " "); |
| 15 |
|
| 16 |
@if $has-val-3 { |
| 17 |
$val-3: str-slice($val-2, $has-val-3 + 1, str-length($val-2)); |
| 18 |
$val-2: str-slice($val-2, 1, $has-val-3 - 1); |
| 19 |
} |
| 20 |
|
| 21 |
$pos: _position-flipper($val-1) _position-flipper($val-2) _position-flipper($val-3); |
| 22 |
$pos: unquote($pos + ""); |
| 23 |
|
| 24 |
$output-bourbon-deprecation-warnings: $user-deprecation-warnings-setting !global; |
| 25 |
|
| 26 |
// Use old spec for webkit |
| 27 |
@if $val-1 == "to" { |
| 28 |
@return ( |
| 29 |
webkit-image: -webkit- + $prefix + $pos + $suffix, |
| 30 |
spec-image: $image |
| 31 |
); |
| 32 |
} |
| 33 |
|
| 34 |
// Bring the code up to spec |
| 35 |
@else { |
| 36 |
@return ( |
| 37 |
webkit-image: -webkit- + $image, |
| 38 |
spec-image: $prefix + "to " + $pos + $suffix |
| 39 |
); |
| 40 |
} |
| 41 |
} |