autoprefixer 9.6.5 → 9.7.3
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-template-areas.js +1 -1
- package/lib/hacks/grid-utils.js +4 -4
- package/lib/hacks/intrinsic.js +1 -1
- package/lib/hacks/text-decoration.js +1 -1
- package/lib/hacks/transform-decl.js +2 -2
- package/lib/hacks/user-select.js +38 -0
- package/lib/prefixes.js +19 -18
- package/lib/processor.js +27 -18
- package/lib/selector.js +1 -1
- package/lib/transition.js +29 -1
- package/lib/utils.js +1 -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.3
|
|
5
|
+
* Fix compatibility with PostCSS Modules.
|
|
6
|
+
|
|
7
|
+
## 9.7.2
|
|
8
|
+
* Add `-ms-user-select: element` support.
|
|
9
|
+
* Add funding link for `npm fund`.
|
|
10
|
+
|
|
11
|
+
## 9.7.1
|
|
12
|
+
* Avoid unnecessary transitions in prefixed selectors (by Andrey Alexandrov).
|
|
13
|
+
* Fix `fit-content` for Firefox.
|
|
14
|
+
|
|
15
|
+
## 9.7 “Ad Victoriam”
|
|
16
|
+
* Add `AUTOPREFIXER_GRID` env variable to enable Grid Layout polyfill for IE.
|
|
17
|
+
* Fix `Cannot read property 'grid' of undefined` error.
|
|
18
|
+
|
|
4
19
|
## 9.6.5
|
|
5
20
|
* Fix selector prefixing (by Andrey Alexandrov).
|
|
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
|
|
@@ -18,7 +18,7 @@ var _require = require('./grid-utils'),
|
|
|
18
18
|
inheritGridGap = _require.inheritGridGap;
|
|
19
19
|
|
|
20
20
|
function getGridRows(tpl) {
|
|
21
|
-
return tpl.trim().slice(1, -1).split(/['
|
|
21
|
+
return tpl.trim().slice(1, -1).split(/["']\s*["']?/g);
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
var GridTemplateAreas =
|
package/lib/hacks/grid-utils.js
CHANGED
|
@@ -235,7 +235,7 @@ function parseGridAreas(_ref6) {
|
|
|
235
235
|
|
|
236
236
|
|
|
237
237
|
function testTrack(node) {
|
|
238
|
-
return node.type === 'word' && /^\[
|
|
238
|
+
return node.type === 'word' && /^\[.+]$/.test(node.value);
|
|
239
239
|
}
|
|
240
240
|
|
|
241
241
|
function verifyRowSize(result) {
|
|
@@ -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
|
@@ -60,7 +60,7 @@ function (_Declaration) {
|
|
|
60
60
|
|
|
61
61
|
var func = _ref;
|
|
62
62
|
|
|
63
|
-
if (decl.value.
|
|
63
|
+
if (decl.value.includes(func + "(")) {
|
|
64
64
|
return true;
|
|
65
65
|
}
|
|
66
66
|
}
|
|
@@ -76,7 +76,7 @@ function (_Declaration) {
|
|
|
76
76
|
decl = _Declaration.prototype.set.call(this, decl, prefix);
|
|
77
77
|
|
|
78
78
|
if (prefix === '-ms-') {
|
|
79
|
-
decl.value = decl.value.replace(/
|
|
79
|
+
decl.value = decl.value.replace(/rotatez/gi, 'rotate');
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
return decl;
|
|
@@ -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'));
|
|
@@ -97,8 +98,8 @@ function () {
|
|
|
97
98
|
this.processor = new Processor(this);
|
|
98
99
|
}
|
|
99
100
|
/**
|
|
100
|
-
|
|
101
|
-
|
|
101
|
+
* Return clone instance to remove all prefixes
|
|
102
|
+
*/
|
|
102
103
|
|
|
103
104
|
|
|
104
105
|
var _proto = Prefixes.prototype;
|
|
@@ -118,8 +119,8 @@ function () {
|
|
|
118
119
|
return this.cleanerCache;
|
|
119
120
|
}
|
|
120
121
|
/**
|
|
121
|
-
|
|
122
|
-
|
|
122
|
+
* Select prefixes from data, which is necessary for selected browsers
|
|
123
|
+
*/
|
|
123
124
|
;
|
|
124
125
|
|
|
125
126
|
_proto.select = function select(list) {
|
|
@@ -195,8 +196,8 @@ function () {
|
|
|
195
196
|
return selected;
|
|
196
197
|
}
|
|
197
198
|
/**
|
|
198
|
-
|
|
199
|
-
|
|
199
|
+
* Sort vendor prefixes
|
|
200
|
+
*/
|
|
200
201
|
;
|
|
201
202
|
|
|
202
203
|
_proto.sort = function sort(prefixes) {
|
|
@@ -212,8 +213,8 @@ function () {
|
|
|
212
213
|
});
|
|
213
214
|
}
|
|
214
215
|
/**
|
|
215
|
-
|
|
216
|
-
|
|
216
|
+
* Cache prefixes data to fast CSS processing
|
|
217
|
+
*/
|
|
217
218
|
;
|
|
218
219
|
|
|
219
220
|
_proto.preprocess = function preprocess(selected) {
|
|
@@ -435,8 +436,8 @@ function () {
|
|
|
435
436
|
}
|
|
436
437
|
}
|
|
437
438
|
/**
|
|
438
|
-
|
|
439
|
-
|
|
439
|
+
* Return unprefixed version of property
|
|
440
|
+
*/
|
|
440
441
|
;
|
|
441
442
|
|
|
442
443
|
_proto.unprefixed = function unprefixed(prop) {
|
|
@@ -449,16 +450,16 @@ function () {
|
|
|
449
450
|
return value;
|
|
450
451
|
}
|
|
451
452
|
/**
|
|
452
|
-
|
|
453
|
-
|
|
453
|
+
* Normalize prefix for remover
|
|
454
|
+
*/
|
|
454
455
|
;
|
|
455
456
|
|
|
456
457
|
_proto.normalize = function normalize(prop) {
|
|
457
458
|
return this.decl(prop).normalize(prop);
|
|
458
459
|
}
|
|
459
460
|
/**
|
|
460
|
-
|
|
461
|
-
|
|
461
|
+
* Return prefixed version of property
|
|
462
|
+
*/
|
|
462
463
|
;
|
|
463
464
|
|
|
464
465
|
_proto.prefixed = function prefixed(prop, prefix) {
|
|
@@ -466,8 +467,8 @@ function () {
|
|
|
466
467
|
return this.decl(prop).prefixed(prop, prefix);
|
|
467
468
|
}
|
|
468
469
|
/**
|
|
469
|
-
|
|
470
|
-
|
|
470
|
+
* Return values, which must be prefixed in selected property
|
|
471
|
+
*/
|
|
471
472
|
;
|
|
472
473
|
|
|
473
474
|
_proto.values = function values(type, prop) {
|
|
@@ -482,8 +483,8 @@ function () {
|
|
|
482
483
|
}
|
|
483
484
|
}
|
|
484
485
|
/**
|
|
485
|
-
|
|
486
|
-
|
|
486
|
+
* Group declaration by unprefixed property to check them
|
|
487
|
+
*/
|
|
487
488
|
;
|
|
488
489
|
|
|
489
490
|
_proto.group = function group(decl) {
|
package/lib/processor.js
CHANGED
|
@@ -360,20 +360,24 @@ function () {
|
|
|
360
360
|
|
|
361
361
|
var unprefixed = _this.prefixes.unprefixed(decl.prop);
|
|
362
362
|
|
|
363
|
-
|
|
364
|
-
var _ref3;
|
|
363
|
+
var list = _this.prefixes.values('add', unprefixed);
|
|
365
364
|
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
_ref3
|
|
369
|
-
} else {
|
|
370
|
-
_i3 = _iterator3.next();
|
|
371
|
-
if (_i3.done) break;
|
|
372
|
-
_ref3 = _i3.value;
|
|
373
|
-
}
|
|
365
|
+
if (Array.isArray(list)) {
|
|
366
|
+
for (var _iterator3 = list, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) {
|
|
367
|
+
var _ref3;
|
|
374
368
|
|
|
375
|
-
|
|
376
|
-
|
|
369
|
+
if (_isArray3) {
|
|
370
|
+
if (_i3 >= _iterator3.length) break;
|
|
371
|
+
_ref3 = _iterator3[_i3++];
|
|
372
|
+
} else {
|
|
373
|
+
_i3 = _iterator3.next();
|
|
374
|
+
if (_i3.done) break;
|
|
375
|
+
_ref3 = _i3.value;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
var value = _ref3;
|
|
379
|
+
if (value.process) value.process(decl, result);
|
|
380
|
+
}
|
|
377
381
|
}
|
|
378
382
|
|
|
379
383
|
Value.save(_this.prefixes, decl);
|
|
@@ -482,11 +486,8 @@ function () {
|
|
|
482
486
|
}
|
|
483
487
|
|
|
484
488
|
var checker = _ref5;
|
|
485
|
-
|
|
486
|
-
if (!checker.check(decl.value))
|
|
487
|
-
continue;
|
|
488
|
-
}
|
|
489
|
-
|
|
489
|
+
if (!checker.check) continue;
|
|
490
|
+
if (!checker.check(decl.value)) continue;
|
|
490
491
|
unprefixed = checker.unprefixed;
|
|
491
492
|
|
|
492
493
|
var _notHack = _this2.prefixes.group(decl).down(function (other) {
|
|
@@ -739,8 +740,16 @@ function () {
|
|
|
739
740
|
} else {
|
|
740
741
|
value = isParentGrid;
|
|
741
742
|
}
|
|
742
|
-
} else {
|
|
743
|
+
} else if (typeof this.prefixes.options.grid !== 'undefined') {
|
|
743
744
|
value = this.prefixes.options.grid;
|
|
745
|
+
} else if (typeof process.env.AUTOPREFIXER_GRID !== 'undefined') {
|
|
746
|
+
if (process.env.AUTOPREFIXER_GRID === 'autoplace') {
|
|
747
|
+
value = 'autoplace';
|
|
748
|
+
} else {
|
|
749
|
+
value = true;
|
|
750
|
+
}
|
|
751
|
+
} else {
|
|
752
|
+
value = false;
|
|
744
753
|
}
|
|
745
754
|
}
|
|
746
755
|
|
package/lib/selector.js
CHANGED
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/lib/utils.js
CHANGED
package/package.json
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "autoprefixer",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.7.3",
|
|
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.
|
|
14
|
-
"caniuse-lite": "^1.0.
|
|
17
|
+
"browserslist": "^4.8.0",
|
|
18
|
+
"caniuse-lite": "^1.0.30001012",
|
|
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
|
},
|