From 542bd8529904adb867e2608dd093f798ce790618 Mon Sep 17 00:00:00 2001 From: Andrey Sitnik Date: Wed, 21 Sep 2022 00:57:09 +0200 Subject: [PATCH] Fix gradients cleaning --- lib/hacks/gradient.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/lib/hacks/gradient.js b/lib/hacks/gradient.js index 48103e64f..48e13328b 100644 --- a/lib/hacks/gradient.js +++ b/lib/hacks/gradient.js @@ -72,7 +72,10 @@ class Gradient extends Value { nodes[0].value = `${num}deg` } - if (gradientName === 'linear-gradient' || gradientName === 'repeating-linear-gradient') { + if ( + gradientName === 'linear-gradient' || + gradientName === 'repeating-linear-gradient' + ) { let direction = nodes[0].value // Unitless zero for `` values are allowed in CSS gradients and transforms. @@ -365,7 +368,16 @@ class Gradient extends Value { */ old(prefix) { if (prefix === '-webkit-') { - let type = this.name === 'linear-gradient' ? 'linear' : 'radial' + let type + if (this.name === 'linear-gradient') { + type = 'linear' + } else if (this.name === 'repeating-linear-gradient') { + type = 'repeating-linear' + } else if (this.name === 'repeating-radial-gradient') { + type = 'repeating-radial' + } else { + type = 'radial' + } let string = '-gradient' let regexp = utils.regexp( `-webkit-(${type}-gradient|gradient\\(\\s*${type})`,