p0c-website

Proof of concepts for fun and profit
git clone https://git.in0rdr.ch/p0c-website.git
Log | Files | Refs | Pull requests |Archive | README | LICENSE

_linear-angle-parser.scss (757B)


      1 // Private function for linear-gradient-parser
      2 @function _linear-angle-parser($image, $first-val, $prefix, $suffix) {
      3   $offset: null;
      4   $unit-short:  str-slice($first-val, str-length($first-val) - 2, str-length($first-val));
      5   $unit-long:   str-slice($first-val, str-length($first-val) - 3, str-length($first-val));
      6 
      7   @if ($unit-long == "grad") or
      8       ($unit-long == "turn") {
      9     $offset: if($unit-long == "grad", -100grad * 3, -0.75turn);
     10   }
     11 
     12   @else if ($unit-short == "deg") or
     13            ($unit-short == "rad") {
     14     $offset: if($unit-short == "deg", -90 * 3, 1.6rad);
     15   }
     16 
     17   @if $offset {
     18     $num: _str-to-num($first-val);
     19 
     20     @return (
     21       webkit-image: -webkit- + $prefix + ($offset - $num) + $suffix,
     22       spec-image: $image
     23     );
     24   }
     25 }