autoprefixer 9.7.1 → 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 CHANGED
@@ -1,6 +1,10 @@
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
+
4
8
  ## 9.7.1
5
9
  * Avoid unnecessary transitions in prefixed selectors (by Andrey Alexandrov).
6
10
  * Fix `fit-content` for Firefox.
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
 
@@ -622,16 +624,53 @@ to increase performance.
622
624
  * `no-autoplace`: enable Autoprefixer grid translations
623
625
  but *exclude* autoplacement support.
624
626
 
625
- Environment variables is useful, when you can change Autoprefixer options.
626
- For instance, in Create React App.
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.
627
629
 
628
- Add variable before CLI command, which will build your CSS:
630
+ [Create React App]: (https://reactjs.org/docs/create-a-new-react-app.html#create-react-app)
629
631
 
630
- ```sh
631
- AUTOPREFIXER_GRID=autoplace npm build
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
+ },
632
667
  ```
633
668
 
634
- See also [Browserslist environment variables].
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.
635
674
 
636
675
  [Browserslist environment variables]: https://github.com/browserslist/browserslist#environment-variables
637
676
 
@@ -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/package.json CHANGED
@@ -1,8 +1,12 @@
1
1
  {
2
2
  "name": "autoprefixer",
3
- "version": "9.7.1",
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,12 +14,12 @@
10
14
  "node": ">=6.0.0"
11
15
  },
12
16
  "dependencies": {
13
- "browserslist": "^4.7.2",
14
- "caniuse-lite": "^1.0.30001006",
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.21",
22
+ "postcss": "^7.0.23",
19
23
  "postcss-value-parser": "^4.0.2"
20
24
  },
21
25
  "bin": {