_linear-side-corner-parser.scss 916 B

12345678910111213141516171819202122232425262728293031
  1. // Private function for linear-gradient-parser
  2. @function _linear-side-corner-parser($image, $first-val, $prefix, $suffix, $has-multiple-vals) {
  3. $val-1: str-slice($first-val, 0, $has-multiple-vals - 1 );
  4. $val-2: str-slice($first-val, $has-multiple-vals + 1, str-length($first-val));
  5. $val-3: null;
  6. $has-val-3: str-index($val-2, " ");
  7. @if $has-val-3 {
  8. $val-3: str-slice($val-2, $has-val-3 + 1, str-length($val-2));
  9. $val-2: str-slice($val-2, 0, $has-val-3 - 1);
  10. }
  11. $pos: _position-flipper($val-1) _position-flipper($val-2) _position-flipper($val-3);
  12. $pos: unquote($pos + "");
  13. // Use old spec for webkit
  14. @if $val-1 == "to" {
  15. @return (
  16. webkit-image: -webkit- + $prefix + $pos + $suffix,
  17. spec-image: $image
  18. );
  19. }
  20. // Bring the code up to spec
  21. @else {
  22. @return (
  23. webkit-image: -webkit- + $image,
  24. spec-image: $prefix + "to " + $pos + $suffix
  25. );
  26. }
  27. }