autoprefixer 10.5.4 → 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/README.md +9 -6
- package/lib/hacks/gradient.js +24 -7
- package/lib/resolution.js +4 -2
- package/lib/value.js +2 -2
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Autoprefixer
|
|
1
|
+
# Autoprefixer
|
|
2
2
|
|
|
3
3
|
<img align="right" width="94" height="71"
|
|
4
4
|
src="https://postcss.github.io/autoprefixer/logo.svg"
|
|
@@ -41,13 +41,16 @@ of Autoprefixer.
|
|
|
41
41
|
|
|
42
42
|
Twitter account for news and releases: [@autoprefixer].
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
</a>
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
<img src="https://cdn.evilmartians.com/badges/logo-no-label.svg" alt="" width="22" height="16" /> Autoprefixer is built by <b><a href="https://evilmartians.com/">Evil Martians</a></b>, an American design and engineering consultancy for <b>developer tools, AI, and cybersecurity startups</b>.
|
|
47
|
+
|
|
48
|
+
---
|
|
47
49
|
|
|
48
50
|
[interactive demo]: https://autoprefixer.github.io/
|
|
49
51
|
[@autoprefixer]: https://twitter.com/autoprefixer
|
|
50
52
|
[Can I Use]: https://caniuse.com/
|
|
51
|
-
[cult-img]: https://cultofmartians.com/assets/badges/badge.svg
|
|
52
53
|
[PostCSS]: https://github.com/postcss/postcss
|
|
53
|
-
|
|
54
|
+
|
|
55
|
+
## Docs
|
|
56
|
+
Read full docs **[here](https://github.com/postcss/autoprefixer#readme)**.
|
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/resolution.js
CHANGED
|
@@ -3,8 +3,10 @@ let FractionJs = require('fraction.js')
|
|
|
3
3
|
let Prefixer = require('./prefixer')
|
|
4
4
|
let utils = require('./utils')
|
|
5
5
|
|
|
6
|
-
const REGEXP =
|
|
7
|
-
|
|
6
|
+
const REGEXP =
|
|
7
|
+
/(min|max)-resolution\s*:\s*(?:\d+(?:\.\d+)?|\.\d+)(dppx|dpcm|dpi|x)/gi
|
|
8
|
+
const SPLIT =
|
|
9
|
+
/(min|max)-resolution(\s*:\s*)(\d+(?:\.\d+)?|\.\d+)(dppx|dpcm|dpi|x)/i
|
|
8
10
|
|
|
9
11
|
class Resolution extends Prefixer {
|
|
10
12
|
/**
|
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
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "autoprefixer",
|
|
3
|
-
"version": "10.5.
|
|
3
|
+
"version": "10.5.6",
|
|
4
4
|
"description": "Parse CSS and add vendor prefixes to CSS rules using values from the Can I Use website",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"autoprefixer",
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"main": "lib/autoprefixer.js",
|
|
34
34
|
"types": "lib/autoprefixer.d.ts",
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"browserslist": "^4.28.
|
|
37
|
-
"caniuse-lite": "^1.0.
|
|
36
|
+
"browserslist": "^4.28.9",
|
|
37
|
+
"caniuse-lite": "^1.0.30001810",
|
|
38
38
|
"fraction.js": "^5.3.4",
|
|
39
39
|
"picocolors": "^1.1.1",
|
|
40
40
|
"postcss-value-parser": "^4.2.0"
|