p0c-website

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

_render-gradients.scss (845B)


      1 // User for linear and radial gradients within background-image or border-image properties
      2 
      3 @function _render-gradients($gradient-positions, $gradients, $gradient-type, $vendor: false) {
      4   $pre-spec: null;
      5   $spec: null;
      6   $vendor-gradients: null;
      7   @if $gradient-type == linear {
      8     @if $gradient-positions {
      9       $pre-spec: nth($gradient-positions, 1);
     10       $spec:     nth($gradient-positions, 2);
     11     }
     12   }
     13   @else if $gradient-type == radial {
     14     $pre-spec: nth($gradient-positions, 1);
     15     $spec:     nth($gradient-positions, 2);
     16   }
     17 
     18   @if $vendor {
     19     $vendor-gradients: -#{$vendor}-#{$gradient-type}-gradient(#{$pre-spec} $gradients);
     20   }
     21   @else if $vendor == false {
     22     $vendor-gradients: "#{$gradient-type}-gradient(#{$spec} #{$gradients})";
     23     $vendor-gradients: unquote($vendor-gradients);
     24   }
     25   @return $vendor-gradients;
     26 }