autoprefixer 10.5.5 → 10.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/hacks/gradient.js +24 -7
- package/lib/value.js +2 -2
- package/package.json +1 -1
package/lib/hacks/gradient.js
CHANGED
|
@@ -10,11 +10,11 @@ class Gradient extends Value {
|
|
|
10
10
|
/**
|
|
11
11
|
* Do not add non-webkit prefixes for list-style and object
|
|
12
12
|
*/
|
|
13
|
-
add(decl, prefix) {
|
|
13
|
+
add(decl, prefix, prefixes, result) {
|
|
14
14
|
let p = decl.prop
|
|
15
15
|
if (p.includes('mask')) {
|
|
16
16
|
if (prefix === '-webkit-' || prefix === '-webkit- old') {
|
|
17
|
-
return super.add(decl, prefix)
|
|
17
|
+
return super.add(decl, prefix, prefixes, result)
|
|
18
18
|
}
|
|
19
19
|
} else if (
|
|
20
20
|
p === 'list-style' ||
|
|
@@ -22,10 +22,10 @@ class Gradient extends Value {
|
|
|
22
22
|
p === 'content'
|
|
23
23
|
) {
|
|
24
24
|
if (prefix === '-webkit-' || prefix === '-webkit- old') {
|
|
25
|
-
return super.add(decl, prefix)
|
|
25
|
+
return super.add(decl, prefix, prefixes, result)
|
|
26
26
|
}
|
|
27
27
|
} else {
|
|
28
|
-
return super.add(decl, prefix)
|
|
28
|
+
return super.add(decl, prefix, prefixes, result)
|
|
29
29
|
}
|
|
30
30
|
return undefined
|
|
31
31
|
}
|
|
@@ -328,7 +328,7 @@ class Gradient extends Value {
|
|
|
328
328
|
/**
|
|
329
329
|
* Convert to old webkit syntax
|
|
330
330
|
*/
|
|
331
|
-
oldWebkit(node) {
|
|
331
|
+
oldWebkit(node, decl, result) {
|
|
332
332
|
let { nodes } = node
|
|
333
333
|
let string = parser.stringify(node.nodes)
|
|
334
334
|
|
|
@@ -361,6 +361,23 @@ class Gradient extends Value {
|
|
|
361
361
|
}
|
|
362
362
|
|
|
363
363
|
this.oldDirection(params)
|
|
364
|
+
for (let param of params.slice(1)) {
|
|
365
|
+
let tokens = param.filter(i => i.type === 'word' || i.type === 'function')
|
|
366
|
+
if (
|
|
367
|
+
tokens.length === 1 &&
|
|
368
|
+
((tokens[0].type === 'word' && parser.unit(tokens[0].value)) ||
|
|
369
|
+
(tokens[0].type === 'function' &&
|
|
370
|
+
/^(calc|min|max|clamp)$/i.test(tokens[0].value)))
|
|
371
|
+
) {
|
|
372
|
+
if (decl && result) {
|
|
373
|
+
decl.warn(
|
|
374
|
+
result,
|
|
375
|
+
'Gradient color hints are not supported by old WebKit'
|
|
376
|
+
)
|
|
377
|
+
}
|
|
378
|
+
return false
|
|
379
|
+
}
|
|
380
|
+
}
|
|
364
381
|
this.colorStops(params)
|
|
365
382
|
|
|
366
383
|
node.nodes = []
|
|
@@ -380,7 +397,7 @@ class Gradient extends Value {
|
|
|
380
397
|
/**
|
|
381
398
|
* Change degrees for webkit prefix
|
|
382
399
|
*/
|
|
383
|
-
replace(string, prefix) {
|
|
400
|
+
replace(string, prefix, decl, result) {
|
|
384
401
|
let ast = parser(string)
|
|
385
402
|
for (let node of ast.nodes) {
|
|
386
403
|
let gradientName = this.name // gradient name
|
|
@@ -388,7 +405,7 @@ class Gradient extends Value {
|
|
|
388
405
|
node.nodes = this.newDirection(node.nodes)
|
|
389
406
|
node.nodes = this.normalize(node.nodes, gradientName)
|
|
390
407
|
if (prefix === '-webkit- old') {
|
|
391
|
-
let changes = this.oldWebkit(node)
|
|
408
|
+
let changes = this.oldWebkit(node, decl, result)
|
|
392
409
|
if (!changes) {
|
|
393
410
|
return false
|
|
394
411
|
}
|
package/lib/value.js
CHANGED
|
@@ -61,7 +61,7 @@ class Value extends Prefixer {
|
|
|
61
61
|
/**
|
|
62
62
|
* Save values with next prefixed token
|
|
63
63
|
*/
|
|
64
|
-
add(decl, prefix) {
|
|
64
|
+
add(decl, prefix, prefixes, result) {
|
|
65
65
|
if (!decl._autoprefixerValues) {
|
|
66
66
|
decl._autoprefixerValues = {}
|
|
67
67
|
}
|
|
@@ -70,7 +70,7 @@ class Value extends Prefixer {
|
|
|
70
70
|
let before
|
|
71
71
|
do {
|
|
72
72
|
before = value
|
|
73
|
-
value = this.replace(value, prefix)
|
|
73
|
+
value = this.replace(value, prefix, decl, result)
|
|
74
74
|
if (value === false) return
|
|
75
75
|
} while (value !== before)
|
|
76
76
|
|