autoprefixer 9.6.4 → 9.7.2
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/CHANGELOG.md +15 -0
- package/README.md +86 -16
- package/data/prefixes.js +13 -3
- package/lib/autoprefixer.js +0 -4
- package/lib/hacks/align-self.js +2 -2
- package/lib/hacks/background-size.js +1 -1
- package/lib/hacks/block-logical.js +2 -2
- package/lib/hacks/break-props.js +2 -2
- package/lib/hacks/filter.js +1 -1
- package/lib/hacks/flex-direction.js +2 -2
- package/lib/hacks/flex-flow.js +2 -2
- package/lib/hacks/gradient.js +5 -5
- package/lib/hacks/grid-column-align.js +1 -1
- package/lib/hacks/grid-row-align.js +1 -1
- package/lib/hacks/grid-rows-columns.js +5 -3
- package/lib/hacks/grid-start.js +1 -1
- package/lib/hacks/grid-utils.js +3 -3
- package/lib/hacks/intrinsic.js +1 -1
- package/lib/hacks/text-decoration.js +1 -1
- package/lib/hacks/transform-decl.js +1 -1
- package/lib/hacks/user-select.js +38 -0
- package/lib/prefixes.js +1 -0
- package/lib/processor.js +9 -1
- package/lib/selector.js +56 -16
- package/lib/transition.js +29 -1
- package/package.json +9 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
|
3
3
|
|
|
4
|
+
## 9.7.2
|
|
5
|
+
* Add `-ms-user-select: element` support.
|
|
6
|
+
* Add funding link for `npm fund`.
|
|
7
|
+
|
|
8
|
+
## 9.7.1
|
|
9
|
+
* Avoid unnecessary transitions in prefixed selectors (by Andrey Alexandrov).
|
|
10
|
+
* Fix `fit-content` for Firefox.
|
|
11
|
+
|
|
12
|
+
## 9.7 “Ad Victoriam”
|
|
13
|
+
* Add `AUTOPREFIXER_GRID` env variable to enable Grid Layout polyfill for IE.
|
|
14
|
+
* Fix `Cannot read property 'grid' of undefined` error.
|
|
15
|
+
|
|
16
|
+
## 9.6.5
|
|
17
|
+
* Fix selector prefixing (by Andrey Alexandrov).
|
|
18
|
+
|
|
4
19
|
## 9.6.4
|
|
5
20
|
* Now the real fix for `'startsWith' of undefined` error.
|
|
6
21
|
|
package/README.md
CHANGED
|
@@ -95,6 +95,8 @@ Twitter account for news and releases: [@autoprefixer].
|
|
|
95
95
|
- [Warnings](#warnings)
|
|
96
96
|
- [Disabling](#disabling)
|
|
97
97
|
- [Options](#options)
|
|
98
|
+
- [Environment variables](#environment-variables)
|
|
99
|
+
- [Using environment variables to support CSS Grid prefixes in Create React App](#using-environment-variables-to-support-css-grid-prefixes-in-create-react-app)
|
|
98
100
|
- [Grid Autoplacement support in IE](#grid-autoplacement-support-in-ie)
|
|
99
101
|
- [Debug](#debug)
|
|
100
102
|
|
|
@@ -113,10 +115,10 @@ that the config can be shared with other tools such as [babel-preset-env] and
|
|
|
113
115
|
|
|
114
116
|
See [Browserslist docs] for queries, browser names, config format, and defaults.
|
|
115
117
|
|
|
116
|
-
[Browserslist docs]: https://github.com/
|
|
118
|
+
[Browserslist docs]: https://github.com/browserslist/browserslist#queries
|
|
117
119
|
[babel-preset-env]: https://github.com/babel/babel/tree/master/packages/babel-preset-env
|
|
118
120
|
[Best Practices]: https://github.com/browserslist/browserslist#best-practices
|
|
119
|
-
[Browserslist]: https://github.com/
|
|
121
|
+
[Browserslist]: https://github.com/browserslist/browserslist
|
|
120
122
|
[Stylelint]: https://stylelint.io/
|
|
121
123
|
|
|
122
124
|
|
|
@@ -130,6 +132,8 @@ This is why it is disabled by default.
|
|
|
130
132
|
|
|
131
133
|
First, you need to enable Grid prefixes by using either the `grid: "autoplace"`
|
|
132
134
|
option or the `/* autoprefixer grid: autoplace */` control comment.
|
|
135
|
+
Also you can use environment variable to enable Grid:
|
|
136
|
+
`AUTOPREFIXER_GRID=autoplace npm build`.
|
|
133
137
|
|
|
134
138
|
Second, you need to test every fix with Grid in IE. It is not an enable and
|
|
135
139
|
forget feature, but it is still very useful.
|
|
@@ -307,7 +311,7 @@ module.exports = {
|
|
|
307
311
|
### CSS-in-JS
|
|
308
312
|
|
|
309
313
|
The best way to use PostCSS with CSS-in-JS is [`astroturf`].
|
|
310
|
-
Add
|
|
314
|
+
Add its loader to your `webpack.config.js`:
|
|
311
315
|
|
|
312
316
|
```js
|
|
313
317
|
module.exports = {
|
|
@@ -582,7 +586,7 @@ Available options are:
|
|
|
582
586
|
* `flexbox` (boolean|string): should Autoprefixer add prefixes for flexbox
|
|
583
587
|
properties. With `"no-2009"` value Autoprefixer will add prefixes only
|
|
584
588
|
for final and IE 10 versions of specification. Default is `true`.
|
|
585
|
-
* `grid` (false
|
|
589
|
+
* `grid` (false|`"autoplace"`|`"no-autoplace"`): should Autoprefixer
|
|
586
590
|
add IE 10-11 prefixes for Grid Layout properties?
|
|
587
591
|
* `false` (default): prevent Autoprefixer from outputting
|
|
588
592
|
CSS Grid translations.
|
|
@@ -608,16 +612,82 @@ Plugin object has `info()` method for debugging purpose.
|
|
|
608
612
|
You can use PostCSS processor to process several CSS files
|
|
609
613
|
to increase performance.
|
|
610
614
|
|
|
611
|
-
[usage statistics]: https://github.com/
|
|
615
|
+
[usage statistics]: https://github.com/browserslist/browserslist#custom-usage-data
|
|
612
616
|
[PostCSS API]: http://api.postcss.org
|
|
613
617
|
|
|
618
|
+
## Environment Variables
|
|
619
|
+
|
|
620
|
+
* `AUTOPREFIXER_GRID`: (`autoplace`|`no-autoplace`) should Autoprefixer
|
|
621
|
+
add IE 10-11 prefixes for Grid Layout properties?
|
|
622
|
+
* `autoplace`: enable Autoprefixer grid translations
|
|
623
|
+
and *include* autoplacement support.
|
|
624
|
+
* `no-autoplace`: enable Autoprefixer grid translations
|
|
625
|
+
but *exclude* autoplacement support.
|
|
626
|
+
|
|
627
|
+
Environment variables are useful, when you want to change Autoprefixer options but don't have access to config files.
|
|
628
|
+
[Create React App] is a good example of this.
|
|
629
|
+
|
|
630
|
+
[Create React App]: (https://reactjs.org/docs/create-a-new-react-app.html#create-react-app)
|
|
631
|
+
|
|
632
|
+
### Using environment variables to support CSS Grid prefixes in Create React App
|
|
633
|
+
|
|
634
|
+
1. Install the latest version of Autoprefixer and [cross-env](https://www.npmjs.com/package/cross-env):
|
|
635
|
+
|
|
636
|
+
```
|
|
637
|
+
npm install autoprefixer@latest cross-env --save-dev
|
|
638
|
+
```
|
|
639
|
+
|
|
640
|
+
2. Under `"browserslist"` > `"development"` in the package.json file, add `"last 1 ie version"`
|
|
641
|
+
|
|
642
|
+
```
|
|
643
|
+
"browserslist": {
|
|
644
|
+
"production": [
|
|
645
|
+
">0.2%",
|
|
646
|
+
"not dead",
|
|
647
|
+
"not op_mini all"
|
|
648
|
+
],
|
|
649
|
+
"development": [
|
|
650
|
+
"last 1 chrome version",
|
|
651
|
+
"last 1 firefox version",
|
|
652
|
+
"last 1 safari version",
|
|
653
|
+
"last 1 ie version"
|
|
654
|
+
]
|
|
655
|
+
}
|
|
656
|
+
```
|
|
657
|
+
|
|
658
|
+
3. Update `"scripts"` in the package.json file to the following:
|
|
659
|
+
|
|
660
|
+
```
|
|
661
|
+
"scripts": {
|
|
662
|
+
"start": "cross-env AUTOPREFIXER_GRID=autoplace react-scripts start",
|
|
663
|
+
"build": "cross-env AUTOPREFIXER_GRID=autoplace react-scripts build",
|
|
664
|
+
"test": "cross-env AUTOPREFIXER_GRID=autoplace react-scripts test",
|
|
665
|
+
"eject": "react-scripts eject"
|
|
666
|
+
},
|
|
667
|
+
```
|
|
668
|
+
|
|
669
|
+
Replace `autoplace` with `no-autoplace` in the above example if you prefer to disable Autoprefixer Grid autoplacement support.
|
|
670
|
+
|
|
671
|
+
Now when you run `npm start` you will see CSS Grid prefixes automatically being applied to your output CSS.
|
|
672
|
+
|
|
673
|
+
See also [Browserslist environment variables] for more examples on how to use environment variables in your project.
|
|
674
|
+
|
|
675
|
+
[Browserslist environment variables]: https://github.com/browserslist/browserslist#environment-variables
|
|
676
|
+
|
|
614
677
|
## Grid Autoplacement support in IE
|
|
615
678
|
|
|
616
|
-
If the `grid` option is set to `"autoplace"`, limited autoplacement support is added to Autoprefixers grid translations. You can also use
|
|
679
|
+
If the `grid` option is set to `"autoplace"`, limited autoplacement support is added to Autoprefixers grid translations. You can also use
|
|
680
|
+
the `/* autoprefixer grid: autoplace */` control comment or
|
|
681
|
+
`AUTOPREFIXER_GRID=autoplace npm build` environment variable.
|
|
617
682
|
|
|
618
|
-
Autoprefixer will only autoplace grid cells if both `grid-template-rows`
|
|
683
|
+
Autoprefixer will only autoplace grid cells if both `grid-template-rows`
|
|
684
|
+
and `grid-template-columns` has been set. If `grid-template`
|
|
685
|
+
or `grid-template-areas` has been set, Autoprefixer will use area based
|
|
686
|
+
cell placement instead.
|
|
619
687
|
|
|
620
|
-
Autoprefixer supports autoplacement by using `nth-child` CSS selectors.
|
|
688
|
+
Autoprefixer supports autoplacement by using `nth-child` CSS selectors.
|
|
689
|
+
It creates [number of columns] x [number of rows] `nth-child` selectors.
|
|
690
|
+
For this reason Autoplacement is only supported within the explicit grid.
|
|
621
691
|
|
|
622
692
|
```css
|
|
623
693
|
/* Input CSS */
|
|
@@ -734,9 +804,10 @@ grid-declaration rule:
|
|
|
734
804
|
}
|
|
735
805
|
```
|
|
736
806
|
|
|
737
|
-
The absolute best way to integrate autoplacement into already existing projects
|
|
738
|
-
to leave autoplacement turned off by default and then use a control
|
|
739
|
-
when needed. This method is far less likely to cause
|
|
807
|
+
The absolute best way to integrate autoplacement into already existing projects
|
|
808
|
+
though is to leave autoplacement turned off by default and then use a control
|
|
809
|
+
comment to enable it when needed. This method is far less likely to cause
|
|
810
|
+
something on the site to break.
|
|
740
811
|
|
|
741
812
|
```css
|
|
742
813
|
/* Disable autoplacement by default in old projects */
|
|
@@ -763,10 +834,10 @@ when needed. This method is far less likely to cause something on the site to br
|
|
|
763
834
|
```
|
|
764
835
|
|
|
765
836
|
Note that the `grid: "no-autoplace"` setting and the
|
|
766
|
-
`/* autoprefixer grid: no-autoplace */` control comment share identical
|
|
767
|
-
to the `grid: true` setting and the `/* autoprefixer grid: on */`
|
|
768
|
-
There is no need to refactor old code to use `no-autoplace`
|
|
769
|
-
`true` and `on` statements.
|
|
837
|
+
`/* autoprefixer grid: no-autoplace */` control comment share identical
|
|
838
|
+
functionality to the `grid: true` setting and the `/* autoprefixer grid: on */`
|
|
839
|
+
control comment. There is no need to refactor old code to use `no-autoplace`
|
|
840
|
+
in place of the old `true` and `on` statements.
|
|
770
841
|
|
|
771
842
|
### Autoplacement limitations
|
|
772
843
|
|
|
@@ -1020,7 +1091,6 @@ JS API is also available:
|
|
|
1020
1091
|
console.log(autoprefixer().info())
|
|
1021
1092
|
```
|
|
1022
1093
|
|
|
1023
|
-
|
|
1024
1094
|
## Security Contact
|
|
1025
1095
|
|
|
1026
1096
|
To report a security vulnerability, please use the [Tidelift security contact].
|
package/data/prefixes.js
CHANGED
|
@@ -374,9 +374,10 @@ f(require('caniuse-lite/data/features/css3-tabsize'), function (browsers) {
|
|
|
374
374
|
|
|
375
375
|
var intrinsic = require('caniuse-lite/data/features/intrinsic-width');
|
|
376
376
|
|
|
377
|
+
var sizeProps = ['width', 'min-width', 'max-width', 'height', 'min-height', 'max-height', 'inline-size', 'min-inline-size', 'max-inline-size', 'block-size', 'min-block-size', 'max-block-size', 'grid', 'grid-template', 'grid-template-rows', 'grid-template-columns', 'grid-auto-columns', 'grid-auto-rows'];
|
|
377
378
|
f(intrinsic, function (browsers) {
|
|
378
|
-
return prefix(['max-content', 'min-content'
|
|
379
|
-
props:
|
|
379
|
+
return prefix(['max-content', 'min-content'], {
|
|
380
|
+
props: sizeProps,
|
|
380
381
|
feature: 'intrinsic-width',
|
|
381
382
|
browsers: browsers
|
|
382
383
|
});
|
|
@@ -385,7 +386,16 @@ f(intrinsic, {
|
|
|
385
386
|
match: /x|\s#4/
|
|
386
387
|
}, function (browsers) {
|
|
387
388
|
return prefix(['fill', 'fill-available', 'stretch'], {
|
|
388
|
-
props:
|
|
389
|
+
props: sizeProps,
|
|
390
|
+
feature: 'intrinsic-width',
|
|
391
|
+
browsers: browsers
|
|
392
|
+
});
|
|
393
|
+
});
|
|
394
|
+
f(intrinsic, {
|
|
395
|
+
match: /x|\s#5/
|
|
396
|
+
}, function (browsers) {
|
|
397
|
+
return prefix(['fit-content'], {
|
|
398
|
+
props: sizeProps,
|
|
389
399
|
feature: 'intrinsic-width',
|
|
390
400
|
browsers: browsers
|
|
391
401
|
});
|
package/lib/autoprefixer.js
CHANGED
|
@@ -87,10 +87,6 @@ module.exports = postcss.plugin('autoprefixer', function () {
|
|
|
87
87
|
reqs = options.browsers;
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
if (typeof options.grid === 'undefined') {
|
|
91
|
-
options.grid = false;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
90
|
var brwlstOpts = {
|
|
95
91
|
ignoreUnknownVersions: options.ignoreUnknownVersions,
|
|
96
92
|
stats: options.stats
|
package/lib/hacks/align-self.js
CHANGED
|
@@ -22,8 +22,8 @@ function (_Declaration) {
|
|
|
22
22
|
var _proto = AlignSelf.prototype;
|
|
23
23
|
|
|
24
24
|
_proto.check = function check(decl) {
|
|
25
|
-
return decl.parent && decl.parent.
|
|
26
|
-
return
|
|
25
|
+
return decl.parent && !decl.parent.some(function (i) {
|
|
26
|
+
return i.prop && i.prop.startsWith('grid-');
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
@@ -25,7 +25,7 @@ function (_Declaration) {
|
|
|
25
25
|
_proto.set = function set(decl, prefix) {
|
|
26
26
|
var value = decl.value.toLowerCase();
|
|
27
27
|
|
|
28
|
-
if (prefix === '-webkit-' && value.
|
|
28
|
+
if (prefix === '-webkit-' && !value.includes(' ') && value !== 'contain' && value !== 'cover') {
|
|
29
29
|
decl.value = decl.value + ' ' + decl.value;
|
|
30
30
|
}
|
|
31
31
|
|
|
@@ -23,7 +23,7 @@ function (_Declaration) {
|
|
|
23
23
|
* Use old syntax for -moz- and -webkit-
|
|
24
24
|
*/
|
|
25
25
|
_proto.prefixed = function prefixed(prop, prefix) {
|
|
26
|
-
if (prop.
|
|
26
|
+
if (prop.includes('-start')) {
|
|
27
27
|
return prefix + prop.replace('-block-start', '-before');
|
|
28
28
|
}
|
|
29
29
|
|
|
@@ -35,7 +35,7 @@ function (_Declaration) {
|
|
|
35
35
|
;
|
|
36
36
|
|
|
37
37
|
_proto.normalize = function normalize(prop) {
|
|
38
|
-
if (prop.
|
|
38
|
+
if (prop.includes('-before')) {
|
|
39
39
|
return prop.replace('-before', '-block-start');
|
|
40
40
|
}
|
|
41
41
|
|
package/lib/hacks/break-props.js
CHANGED
|
@@ -31,11 +31,11 @@ function (_Declaration) {
|
|
|
31
31
|
;
|
|
32
32
|
|
|
33
33
|
_proto.normalize = function normalize(prop) {
|
|
34
|
-
if (prop.
|
|
34
|
+
if (prop.includes('inside')) {
|
|
35
35
|
return 'break-inside';
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
if (prop.
|
|
38
|
+
if (prop.includes('before')) {
|
|
39
39
|
return 'break-before';
|
|
40
40
|
}
|
|
41
41
|
|
package/lib/hacks/filter.js
CHANGED
|
@@ -24,7 +24,7 @@ function (_Declaration) {
|
|
|
24
24
|
*/
|
|
25
25
|
_proto.check = function check(decl) {
|
|
26
26
|
var v = decl.value;
|
|
27
|
-
return v.toLowerCase().
|
|
27
|
+
return !v.toLowerCase().includes('alpha(') && !v.includes('DXImageTransform.Microsoft') && !v.includes('data:image/svg+xml');
|
|
28
28
|
};
|
|
29
29
|
|
|
30
30
|
return Filter;
|
|
@@ -59,8 +59,8 @@ function (_Declaration) {
|
|
|
59
59
|
orient = v;
|
|
60
60
|
dir = v;
|
|
61
61
|
} else {
|
|
62
|
-
orient = v.
|
|
63
|
-
dir = v.
|
|
62
|
+
orient = v.includes('row') ? 'horizontal' : 'vertical';
|
|
63
|
+
dir = v.includes('reverse') ? 'reverse' : 'normal';
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
var cloned = this.clone(decl);
|
package/lib/hacks/flex-flow.js
CHANGED
|
@@ -53,8 +53,8 @@ function (_Declaration) {
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
var value = values[0];
|
|
56
|
-
var orient = value.
|
|
57
|
-
var dir = value.
|
|
56
|
+
var orient = value.includes('row') ? 'horizontal' : 'vertical';
|
|
57
|
+
var dir = value.includes('reverse') ? 'reverse' : 'normal';
|
|
58
58
|
var cloned = this.clone(decl);
|
|
59
59
|
cloned.prop = prefix + 'box-orient';
|
|
60
60
|
cloned.value = orient;
|
package/lib/hacks/gradient.js
CHANGED
|
@@ -149,7 +149,7 @@ function (_Value) {
|
|
|
149
149
|
nodes[0].value = this.normalizeUnit(nodes[0].value, 2 * Math.PI);
|
|
150
150
|
} else if (/-?\d+(.\d+)?turn/.test(nodes[0].value)) {
|
|
151
151
|
nodes[0].value = this.normalizeUnit(nodes[0].value, 1);
|
|
152
|
-
} else if (nodes[0].value.
|
|
152
|
+
} else if (nodes[0].value.includes('deg')) {
|
|
153
153
|
var num = parseFloat(nodes[0].value);
|
|
154
154
|
num = range.wrap(0, 360, num);
|
|
155
155
|
nodes[0].value = num + "deg";
|
|
@@ -249,7 +249,7 @@ function (_Value) {
|
|
|
249
249
|
if (params.length > 0) {
|
|
250
250
|
if (params[0].value === 'to') {
|
|
251
251
|
this.fixDirection(params);
|
|
252
|
-
} else if (params[0].value.
|
|
252
|
+
} else if (params[0].value.includes('deg')) {
|
|
253
253
|
this.fixAngle(params);
|
|
254
254
|
} else if (this.isRadial(params)) {
|
|
255
255
|
this.fixRadial(params);
|
|
@@ -362,11 +362,11 @@ function (_Value) {
|
|
|
362
362
|
return false;
|
|
363
363
|
}
|
|
364
364
|
|
|
365
|
-
if (nodes[0] && nodes[0].value.
|
|
365
|
+
if (nodes[0] && nodes[0].value.includes('deg')) {
|
|
366
366
|
return false;
|
|
367
367
|
}
|
|
368
368
|
|
|
369
|
-
if (string.
|
|
369
|
+
if (string.includes('px') || string.includes('-corner') || string.includes('-side')) {
|
|
370
370
|
return false;
|
|
371
371
|
}
|
|
372
372
|
|
|
@@ -558,7 +558,7 @@ function (_Value) {
|
|
|
558
558
|
_proto.add = function add(decl, prefix) {
|
|
559
559
|
var p = decl.prop;
|
|
560
560
|
|
|
561
|
-
if (p.
|
|
561
|
+
if (p.includes('mask')) {
|
|
562
562
|
if (prefix === '-webkit-' || prefix === '-webkit- old') {
|
|
563
563
|
return _Value.prototype.add.call(this, decl, prefix);
|
|
564
564
|
}
|
|
@@ -23,7 +23,7 @@ function (_Declaration) {
|
|
|
23
23
|
* Do not prefix flexbox values
|
|
24
24
|
*/
|
|
25
25
|
_proto.check = function check(decl) {
|
|
26
|
-
return decl.value.
|
|
26
|
+
return !decl.value.includes('flex-') && decl.value !== 'baseline';
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
29
|
* Change property name for IE
|
|
@@ -23,7 +23,7 @@ function (_Declaration) {
|
|
|
23
23
|
* Do not prefix flexbox values
|
|
24
24
|
*/
|
|
25
25
|
_proto.check = function check(decl) {
|
|
26
|
-
return decl.value.
|
|
26
|
+
return !decl.value.includes('flex-') && decl.value !== 'baseline';
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
29
|
* Change property name for IE
|
|
@@ -68,7 +68,9 @@ function (_Declaration) {
|
|
|
68
68
|
return false;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
var processor = new Processor({
|
|
71
|
+
var processor = new Processor({
|
|
72
|
+
options: {}
|
|
73
|
+
});
|
|
72
74
|
var status = processor.gridStatus(parent, result);
|
|
73
75
|
var gap = getGridGap(decl);
|
|
74
76
|
gap = inheritGridGap(decl, gap) || gap;
|
|
@@ -113,7 +115,7 @@ function (_Declaration) {
|
|
|
113
115
|
if (!rowDecl && hasGridTemplate) {
|
|
114
116
|
return undefined;
|
|
115
117
|
} else if (!rowDecl && !hasGridTemplate) {
|
|
116
|
-
decl.warn(result,
|
|
118
|
+
decl.warn(result, 'Autoplacement does not work without grid-template-rows property');
|
|
117
119
|
return undefined;
|
|
118
120
|
}
|
|
119
121
|
/**
|
|
@@ -126,7 +128,7 @@ function (_Declaration) {
|
|
|
126
128
|
});
|
|
127
129
|
|
|
128
130
|
if (!columnDecl && !hasGridTemplate) {
|
|
129
|
-
decl.warn(result,
|
|
131
|
+
decl.warn(result, 'Autoplacement does not work without grid-template-columns property');
|
|
130
132
|
}
|
|
131
133
|
/**
|
|
132
134
|
* Autoplace grid items
|
package/lib/hacks/grid-start.js
CHANGED
|
@@ -24,7 +24,7 @@ function (_Declaration) {
|
|
|
24
24
|
*/
|
|
25
25
|
_proto.check = function check(decl) {
|
|
26
26
|
var value = decl.value;
|
|
27
|
-
return value.
|
|
27
|
+
return !value.includes('/') || value.includes('span');
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
30
|
* Return a final spec property
|
package/lib/hacks/grid-utils.js
CHANGED
|
@@ -783,7 +783,7 @@ function warnTemplateSelectorNotFound(decl, result) {
|
|
|
783
783
|
}); // warn user if we didn't find template
|
|
784
784
|
|
|
785
785
|
if (!gridTemplateFound && duplicatesFound) {
|
|
786
|
-
decl.warn(result,
|
|
786
|
+
decl.warn(result, 'Autoprefixer cannot find a grid-template ' + ("containing the duplicate grid-area \"" + decl.value + "\" ") + ("with full selector matching: " + slicedSelectorArr.join(' ')));
|
|
787
787
|
}
|
|
788
788
|
}
|
|
789
789
|
}
|
|
@@ -800,14 +800,14 @@ function warnIfGridRowColumnExists(decl, result) {
|
|
|
800
800
|
var rule = decl.parent;
|
|
801
801
|
var decls = [];
|
|
802
802
|
rule.walkDecls(/^grid-(row|column)/, function (d) {
|
|
803
|
-
if (
|
|
803
|
+
if (!d.prop.endsWith('-end') && !d.value.startsWith('span')) {
|
|
804
804
|
decls.push(d);
|
|
805
805
|
}
|
|
806
806
|
});
|
|
807
807
|
|
|
808
808
|
if (decls.length > 0) {
|
|
809
809
|
decls.forEach(function (d) {
|
|
810
|
-
d.warn(result,
|
|
810
|
+
d.warn(result, 'You already have a grid-area declaration present in the rule. ' + ("You should use either grid-area or " + d.prop + ", not both"));
|
|
811
811
|
});
|
|
812
812
|
}
|
|
813
813
|
|
package/lib/hacks/intrinsic.js
CHANGED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
|
|
4
|
+
|
|
5
|
+
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _defaults(subClass, superClass); }
|
|
6
|
+
|
|
7
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
|
+
|
|
9
|
+
var Declaration = require('../declaration');
|
|
10
|
+
|
|
11
|
+
var UserSelect =
|
|
12
|
+
/*#__PURE__*/
|
|
13
|
+
function (_Declaration) {
|
|
14
|
+
_inheritsLoose(UserSelect, _Declaration);
|
|
15
|
+
|
|
16
|
+
function UserSelect() {
|
|
17
|
+
return _Declaration.apply(this, arguments) || this;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
var _proto = UserSelect.prototype;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Change prefixed value for IE
|
|
24
|
+
*/
|
|
25
|
+
_proto.set = function set(decl, prefix) {
|
|
26
|
+
if (prefix === '-ms-' && decl.value === 'contain') {
|
|
27
|
+
decl.value = 'element';
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return _Declaration.prototype.set.call(this, decl, prefix);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
return UserSelect;
|
|
34
|
+
}(Declaration);
|
|
35
|
+
|
|
36
|
+
_defineProperty(UserSelect, "names", ['user-select']);
|
|
37
|
+
|
|
38
|
+
module.exports = UserSelect;
|
package/lib/prefixes.js
CHANGED
|
@@ -41,6 +41,7 @@ Declaration.hack(require('./hacks/flex-basis'));
|
|
|
41
41
|
Declaration.hack(require('./hacks/mask-border'));
|
|
42
42
|
Declaration.hack(require('./hacks/mask-composite'));
|
|
43
43
|
Declaration.hack(require('./hacks/align-items'));
|
|
44
|
+
Declaration.hack(require('./hacks/user-select'));
|
|
44
45
|
Declaration.hack(require('./hacks/flex-shrink'));
|
|
45
46
|
Declaration.hack(require('./hacks/break-props'));
|
|
46
47
|
Declaration.hack(require('./hacks/color-adjust'));
|
package/lib/processor.js
CHANGED
|
@@ -739,8 +739,16 @@ function () {
|
|
|
739
739
|
} else {
|
|
740
740
|
value = isParentGrid;
|
|
741
741
|
}
|
|
742
|
-
} else {
|
|
742
|
+
} else if (typeof this.prefixes.options.grid !== 'undefined') {
|
|
743
743
|
value = this.prefixes.options.grid;
|
|
744
|
+
} else if (typeof process.env.AUTOPREFIXER_GRID !== 'undefined') {
|
|
745
|
+
if (process.env.AUTOPREFIXER_GRID === 'autoplace') {
|
|
746
|
+
value = 'autoplace';
|
|
747
|
+
} else {
|
|
748
|
+
value = true;
|
|
749
|
+
}
|
|
750
|
+
} else {
|
|
751
|
+
value = false;
|
|
744
752
|
}
|
|
745
753
|
}
|
|
746
754
|
|
package/lib/selector.js
CHANGED
|
@@ -4,6 +4,9 @@ function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaul
|
|
|
4
4
|
|
|
5
5
|
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _defaults(subClass, superClass); }
|
|
6
6
|
|
|
7
|
+
var _require = require('postcss'),
|
|
8
|
+
list = _require.list;
|
|
9
|
+
|
|
7
10
|
var OldSelector = require('./old-selector');
|
|
8
11
|
|
|
9
12
|
var Prefixer = require('./prefixer');
|
|
@@ -74,29 +77,66 @@ function (_Prefixer) {
|
|
|
74
77
|
;
|
|
75
78
|
|
|
76
79
|
_proto.prefixeds = function prefixeds(rule) {
|
|
80
|
+
var _this2 = this;
|
|
81
|
+
|
|
77
82
|
if (rule._autoprefixerPrefixeds) {
|
|
78
|
-
|
|
83
|
+
if (rule._autoprefixerPrefixeds[this.name]) {
|
|
84
|
+
return rule._autoprefixerPrefixeds;
|
|
85
|
+
}
|
|
86
|
+
} else {
|
|
87
|
+
rule._autoprefixerPrefixeds = {};
|
|
79
88
|
}
|
|
80
89
|
|
|
81
90
|
var prefixeds = {};
|
|
82
91
|
|
|
83
|
-
|
|
84
|
-
var
|
|
92
|
+
if (rule.selector.includes(',')) {
|
|
93
|
+
var ruleParts = list.comma(rule.selector);
|
|
94
|
+
var toProcess = ruleParts.filter(function (el) {
|
|
95
|
+
return el.includes(_this2.name);
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
var _loop = function _loop() {
|
|
99
|
+
if (_isArray) {
|
|
100
|
+
if (_i >= _iterator.length) return "break";
|
|
101
|
+
_ref = _iterator[_i++];
|
|
102
|
+
} else {
|
|
103
|
+
_i = _iterator.next();
|
|
104
|
+
if (_i.done) return "break";
|
|
105
|
+
_ref = _i.value;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
var prefix = _ref;
|
|
109
|
+
prefixeds[prefix] = toProcess.map(function (el) {
|
|
110
|
+
return _this2.replace(el, prefix);
|
|
111
|
+
}).join(', ');
|
|
112
|
+
};
|
|
85
113
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
if (
|
|
92
|
-
_ref = _i.value;
|
|
114
|
+
for (var _iterator = this.possible(), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
|
|
115
|
+
var _ref;
|
|
116
|
+
|
|
117
|
+
var _ret = _loop();
|
|
118
|
+
|
|
119
|
+
if (_ret === "break") break;
|
|
93
120
|
}
|
|
121
|
+
} else {
|
|
122
|
+
for (var _iterator2 = this.possible(), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
|
|
123
|
+
var _ref2;
|
|
124
|
+
|
|
125
|
+
if (_isArray2) {
|
|
126
|
+
if (_i2 >= _iterator2.length) break;
|
|
127
|
+
_ref2 = _iterator2[_i2++];
|
|
128
|
+
} else {
|
|
129
|
+
_i2 = _iterator2.next();
|
|
130
|
+
if (_i2.done) break;
|
|
131
|
+
_ref2 = _i2.value;
|
|
132
|
+
}
|
|
94
133
|
|
|
95
|
-
|
|
96
|
-
|
|
134
|
+
var prefix = _ref2;
|
|
135
|
+
prefixeds[prefix] = this.replace(rule.selector, prefix);
|
|
136
|
+
}
|
|
97
137
|
}
|
|
98
138
|
|
|
99
|
-
rule._autoprefixerPrefixeds = prefixeds;
|
|
139
|
+
rule._autoprefixerPrefixeds[this.name] = prefixeds;
|
|
100
140
|
return rule._autoprefixerPrefixeds;
|
|
101
141
|
}
|
|
102
142
|
/**
|
|
@@ -116,8 +156,8 @@ function (_Prefixer) {
|
|
|
116
156
|
|
|
117
157
|
var some = false;
|
|
118
158
|
|
|
119
|
-
for (var key in prefixeds) {
|
|
120
|
-
var prefixed = prefixeds[key];
|
|
159
|
+
for (var key in prefixeds[this.name]) {
|
|
160
|
+
var prefixed = prefixeds[this.name][key];
|
|
121
161
|
|
|
122
162
|
if (before.selector === prefixed) {
|
|
123
163
|
if (prefix === key) {
|
|
@@ -159,7 +199,7 @@ function (_Prefixer) {
|
|
|
159
199
|
}
|
|
160
200
|
|
|
161
201
|
var cloned = this.clone(rule, {
|
|
162
|
-
selector: prefixeds[prefix]
|
|
202
|
+
selector: prefixeds[this.name][prefix]
|
|
163
203
|
});
|
|
164
204
|
rule.parent.insertBefore(rule, cloned);
|
|
165
205
|
}
|
package/lib/transition.js
CHANGED
|
@@ -8,6 +8,8 @@ var vendor = require('postcss').vendor;
|
|
|
8
8
|
|
|
9
9
|
var list = require('postcss').list;
|
|
10
10
|
|
|
11
|
+
var Browsers = require('./browsers');
|
|
12
|
+
|
|
11
13
|
var Transition =
|
|
12
14
|
/*#__PURE__*/
|
|
13
15
|
function () {
|
|
@@ -28,7 +30,8 @@ function () {
|
|
|
28
30
|
|
|
29
31
|
var prefix, prop;
|
|
30
32
|
var add = this.prefixes.add[decl.prop];
|
|
31
|
-
var
|
|
33
|
+
var vendorPrefixes = this.ruleVendorPrefixes(decl);
|
|
34
|
+
var declPrefixes = vendorPrefixes || add && add.prefixes || [];
|
|
32
35
|
var params = this.parse(decl.value);
|
|
33
36
|
var names = params.map(function (i) {
|
|
34
37
|
return _this.findProp(i);
|
|
@@ -69,6 +72,12 @@ function () {
|
|
|
69
72
|
prefix = _i3.value;
|
|
70
73
|
}
|
|
71
74
|
|
|
75
|
+
if (vendorPrefixes && !vendorPrefixes.some(function (p) {
|
|
76
|
+
return prefix.includes(p);
|
|
77
|
+
})) {
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
80
|
+
|
|
72
81
|
var prefixed = this.prefixes.prefixed(prop, prefix);
|
|
73
82
|
|
|
74
83
|
if (prefixed !== '-ms-transform' && !names.includes(prefixed)) {
|
|
@@ -473,6 +482,25 @@ function () {
|
|
|
473
482
|
}
|
|
474
483
|
|
|
475
484
|
return undefined;
|
|
485
|
+
}
|
|
486
|
+
/**
|
|
487
|
+
* Check if transition prop is inside vendor specific rule
|
|
488
|
+
*/
|
|
489
|
+
;
|
|
490
|
+
|
|
491
|
+
_proto.ruleVendorPrefixes = function ruleVendorPrefixes(decl) {
|
|
492
|
+
var parent = decl.parent;
|
|
493
|
+
|
|
494
|
+
if (parent.type !== 'rule') {
|
|
495
|
+
return false;
|
|
496
|
+
} else if (!parent.selector.includes(':-')) {
|
|
497
|
+
return false;
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
var selectors = Browsers.prefixes().filter(function (s) {
|
|
501
|
+
return parent.selector.includes(':' + s);
|
|
502
|
+
});
|
|
503
|
+
return selectors.length > 0 ? selectors : false;
|
|
476
504
|
};
|
|
477
505
|
|
|
478
506
|
return Transition;
|
package/package.json
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "autoprefixer",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.7.2",
|
|
4
4
|
"description": "Parse CSS and add vendor prefixes to CSS rules using values from the Can I Use website",
|
|
5
5
|
"keywords": ["autoprefixer", "css", "prefix", "postcss", "postcss-plugin"],
|
|
6
|
+
"funding": {
|
|
7
|
+
"type": "tidelift",
|
|
8
|
+
"url": "https://tidelift.com/funding/github/npm/autoprefixer"
|
|
9
|
+
},
|
|
6
10
|
"author": "Andrey Sitnik <andrey@sitnik.ru>",
|
|
7
11
|
"license": "MIT",
|
|
8
12
|
"repository": "postcss/autoprefixer",
|
|
@@ -10,17 +14,18 @@
|
|
|
10
14
|
"node": ">=6.0.0"
|
|
11
15
|
},
|
|
12
16
|
"dependencies": {
|
|
13
|
-
"browserslist": "^4.7.
|
|
14
|
-
"caniuse-lite": "^1.0.
|
|
17
|
+
"browserslist": "^4.7.3",
|
|
18
|
+
"caniuse-lite": "^1.0.30001010",
|
|
15
19
|
"chalk": "^2.4.2",
|
|
16
20
|
"normalize-range": "^0.1.2",
|
|
17
21
|
"num2fraction": "^1.2.2",
|
|
18
|
-
"postcss": "^7.0.
|
|
22
|
+
"postcss": "^7.0.23",
|
|
19
23
|
"postcss-value-parser": "^4.0.2"
|
|
20
24
|
},
|
|
21
25
|
"bin": {
|
|
22
26
|
"autoprefixer": "./bin/autoprefixer"
|
|
23
27
|
},
|
|
28
|
+
"eslintIgnore": ["build/"],
|
|
24
29
|
"browser": {
|
|
25
30
|
"chalk": false
|
|
26
31
|
},
|