Skip to content

Commit

Permalink
Fix gradients cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
ai committed Sep 20, 2022
1 parent 2d286dd commit 542bd85
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions lib/hacks/gradient.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<angle>` values are allowed in CSS gradients and transforms.
Expand Down Expand Up @@ -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})`,
Expand Down

0 comments on commit 542bd85

Please sign in to comment.