Debian Codegraph @

debian/missing-sources/bourbon/app/assets/stylesheets/helpers/_linear-gradient-parser.scss

raw
1 @function _linear-gradient-parser($image) {
2 @if $output-bourbon-deprecation-warnings == true {
3 @warn "[Bourbon] [Deprecation] `_linear-gradient-parser` is " +
4 "deprecated and will be removed in 5.0.0.";
5 }
6
7 $user-deprecation-warnings-setting: $output-bourbon-deprecation-warnings;
8 $output-bourbon-deprecation-warnings: false !global;
9
10 $image: unquote($image);
11 $gradients: ();
12 $start: str-index($image, "(");
13 $end: str-index($image, ",");
14 $first-val: str-slice($image, $start + 1, $end - 1);
15
16 $prefix: str-slice($image, 1, $start);
17 $suffix: str-slice($image, $end, str-length($image));
18
19 $has-multiple-vals: str-index($first-val, " ");
20 $has-single-position: unquote(_position-flipper($first-val) + "");
21 $has-angle: is-number(str-slice($first-val, 1, 1));
22
23 @if $has-multiple-vals {
24 $gradients: _linear-side-corner-parser($image, $first-val, $prefix, $suffix, $has-multiple-vals);
25 }
26
27 @else if $has-single-position != "" {
28 $pos: unquote($has-single-position + "");
29
30 $gradients: (
31 webkit-image: -webkit- + $image,
32 spec-image: $prefix + "to " + $pos + $suffix
33 );
34 }
35
36 @else if $has-angle {
37 // Rotate degree for webkit
38 $gradients: _linear-angle-parser($image, $first-val, $prefix, $suffix);
39 }
40
41 @else {
42 $gradients: (
43 webkit-image: -webkit- + $image,
44 spec-image: $image
45 );
46 }
47
48 $output-bourbon-deprecation-warnings: $user-deprecation-warnings-setting !global;
49
50 @return $gradients;
51 }