_render-gradients.scss 845 B

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