autoprefixer 7.1.1 → 7.1.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 +3 -0
- package/README.md +24 -2
- package/data/prefixes.js +1 -1
- package/lib/hacks/text-decoration.js +41 -0
- package/lib/prefixes.js +2 -1
- package/lib/processor.js +2 -2
- package/package.json +14 -11
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -184,6 +184,28 @@ browsers list.
|
|
|
184
184
|
|
|
185
185
|
[`browserslist` config]: https://github.com/ai/browserslist#config-file
|
|
186
186
|
|
|
187
|
+
#### What is unprefixed version for `-webkit-min-device-pixel-ratio`?
|
|
188
|
+
|
|
189
|
+
```css
|
|
190
|
+
@media (min-resolution: 2dppx) {
|
|
191
|
+
.image {
|
|
192
|
+
background-image: url(image@2x.png);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
Will be compiled to:
|
|
198
|
+
|
|
199
|
+
```css
|
|
200
|
+
@media (-webkit-min-device-pixel-ratio: 2),
|
|
201
|
+
(-o-min-device-pixel-ratio: 2/1),
|
|
202
|
+
(min-resolution: 2dppx) {
|
|
203
|
+
.image {
|
|
204
|
+
background-image: url(image@2x.png);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
```
|
|
208
|
+
|
|
187
209
|
#### Does it add polyfills?
|
|
188
210
|
|
|
189
211
|
No. Autoprefixer only adds prefixes.
|
|
@@ -275,10 +297,10 @@ and [other PostCSS plugins].
|
|
|
275
297
|
```js
|
|
276
298
|
module.exports = {
|
|
277
299
|
module: {
|
|
278
|
-
|
|
300
|
+
rules: [
|
|
279
301
|
{
|
|
280
302
|
test: /\.css$/,
|
|
281
|
-
|
|
303
|
+
use: ["style-loader", "css-loader", "postcss-loader"]
|
|
282
304
|
}
|
|
283
305
|
]
|
|
284
306
|
}
|
package/data/prefixes.js
CHANGED
|
@@ -434,7 +434,7 @@ f(require('caniuse-lite/data/features/pointer.js'), function (browsers) {
|
|
|
434
434
|
var decoration = require('caniuse-lite/data/features/text-decoration.js');
|
|
435
435
|
|
|
436
436
|
f(decoration, function (browsers) {
|
|
437
|
-
return prefix(['text-decoration-style', 'text-decoration-color', 'text-decoration-line'], {
|
|
437
|
+
return prefix(['text-decoration-style', 'text-decoration-color', 'text-decoration-line', 'text-decoration'], {
|
|
438
438
|
feature: 'text-decoration',
|
|
439
439
|
browsers: browsers
|
|
440
440
|
});
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
4
|
+
|
|
5
|
+
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
6
|
+
|
|
7
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
8
|
+
|
|
9
|
+
var Declaration = require('../declaration');
|
|
10
|
+
|
|
11
|
+
var BASIC = ['none', 'underline', 'overline', 'line-through', 'blink', 'inherit', 'initial', 'unset'];
|
|
12
|
+
|
|
13
|
+
var TextDecoration = function (_Declaration) {
|
|
14
|
+
_inherits(TextDecoration, _Declaration);
|
|
15
|
+
|
|
16
|
+
function TextDecoration() {
|
|
17
|
+
_classCallCheck(this, TextDecoration);
|
|
18
|
+
|
|
19
|
+
return _possibleConstructorReturn(this, _Declaration.apply(this, arguments));
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Do not add prefixes for basic values.
|
|
24
|
+
*/
|
|
25
|
+
TextDecoration.prototype.check = function check(decl) {
|
|
26
|
+
return decl.value.split(/\s+/).some(function (i) {
|
|
27
|
+
return BASIC.indexOf(i) === -1;
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
return TextDecoration;
|
|
32
|
+
}(Declaration);
|
|
33
|
+
|
|
34
|
+
Object.defineProperty(TextDecoration, 'names', {
|
|
35
|
+
enumerable: true,
|
|
36
|
+
writable: true,
|
|
37
|
+
value: ['text-decoration']
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
module.exports = TextDecoration;
|
package/lib/prefixes.js
CHANGED
|
@@ -41,12 +41,13 @@ Declaration.hack(require('./hacks/block-logical'));
|
|
|
41
41
|
Declaration.hack(require('./hacks/grid-template'));
|
|
42
42
|
Declaration.hack(require('./hacks/inline-logical'));
|
|
43
43
|
Declaration.hack(require('./hacks/grid-row-align'));
|
|
44
|
-
Declaration.hack(require('./hacks/grid-column-align'));
|
|
45
44
|
Declaration.hack(require('./hacks/transform-decl'));
|
|
46
45
|
Declaration.hack(require('./hacks/flex-direction'));
|
|
47
46
|
Declaration.hack(require('./hacks/image-rendering'));
|
|
47
|
+
Declaration.hack(require('./hacks/text-decoration'));
|
|
48
48
|
Declaration.hack(require('./hacks/justify-content'));
|
|
49
49
|
Declaration.hack(require('./hacks/background-size'));
|
|
50
|
+
Declaration.hack(require('./hacks/grid-column-align'));
|
|
50
51
|
Declaration.hack(require('./hacks/text-emphasis-position'));
|
|
51
52
|
|
|
52
53
|
Value.hack(require('./hacks/gradient'));
|
package/lib/processor.js
CHANGED
|
@@ -82,7 +82,7 @@ var Processor = function () {
|
|
|
82
82
|
if (decl.value.indexOf('fill-available') !== -1) {
|
|
83
83
|
result.warn('Replace fill-available to stretch, ' + 'because spec had been changed', { node: decl });
|
|
84
84
|
} else if (decl.value.indexOf('fill') !== -1) {
|
|
85
|
-
result.warn('Replace fill to stretch, because spec had been changed', { node: decl });
|
|
85
|
+
result.warn('Replace fill to stretch, ' + 'because spec had been changed', { node: decl });
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
|
|
@@ -92,7 +92,7 @@ var Processor = function () {
|
|
|
92
92
|
}
|
|
93
93
|
if (decl.prop === 'grid-row') {
|
|
94
94
|
if (decl.value.indexOf('/') !== -1 && decl.value.indexOf('span') === -1) {
|
|
95
|
-
result.warn('IE supports only grid-row with / and span. ' + 'You should add grid: false option
|
|
95
|
+
result.warn('IE supports only grid-row with / and span. ' + 'You should add grid: false option ' + 'to Autoprefixer and use some JS grid polyfill ' + 'for full spec support', { node: decl });
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "autoprefixer",
|
|
3
|
-
"version": "7.1.
|
|
3
|
+
"version": "7.1.2",
|
|
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",
|
|
@@ -13,36 +13,39 @@
|
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"repository": "postcss/autoprefixer",
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"browserslist": "^2.1.
|
|
17
|
-
"caniuse-lite": "^1.0.
|
|
16
|
+
"browserslist": "^2.1.5",
|
|
17
|
+
"caniuse-lite": "^1.0.30000697",
|
|
18
18
|
"normalize-range": "^0.1.2",
|
|
19
19
|
"num2fraction": "^1.2.2",
|
|
20
|
-
"postcss": "^6.0.
|
|
20
|
+
"postcss": "^6.0.6",
|
|
21
21
|
"postcss-value-parser": "^3.2.3"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"babel-eslint": "^7.2.3",
|
|
25
25
|
"babel-plugin-transform-class-properties": "^6.24.1",
|
|
26
|
-
"babel-preset-env": "^1.
|
|
27
|
-
"
|
|
28
|
-
"
|
|
26
|
+
"babel-preset-env": "^1.6.0",
|
|
27
|
+
"babelify": "^7.3.0",
|
|
28
|
+
"browserify": "^14.4.0",
|
|
29
|
+
"eslint": "^4.1.1",
|
|
29
30
|
"eslint-config-postcss": "^2.0.2",
|
|
30
31
|
"fs-extra": "^3.0.1",
|
|
31
32
|
"gulp": "^3.9.1",
|
|
32
33
|
"gulp-babel": "^6.1.2",
|
|
33
34
|
"gulp-coffee": "^2.3.4",
|
|
34
35
|
"gulp-json-editor": "^2.2.1",
|
|
35
|
-
"gulp-replace": "^0.
|
|
36
|
-
"jest": "^20.0.
|
|
37
|
-
"lint-staged": "^
|
|
36
|
+
"gulp-replace": "^0.6.1",
|
|
37
|
+
"jest": "^20.0.4",
|
|
38
|
+
"lint-staged": "^4.0.1",
|
|
38
39
|
"pre-commit": "^1.2.2",
|
|
40
|
+
"size-limit": "^0.5.0",
|
|
39
41
|
"vinyl-source-stream": "^1.1.0",
|
|
40
42
|
"babel-register": "^6.24.0"
|
|
41
43
|
},
|
|
42
44
|
"scripts": {
|
|
43
45
|
"lint-staged": "lint-staged",
|
|
44
46
|
"lint": "eslint *.js lib/*.js data/*.js test/*.js",
|
|
45
|
-
"
|
|
47
|
+
"size": "size-limit --babili 250KB build/lib/autoprefixer.js",
|
|
48
|
+
"test": "jest && npm run lint && gulp && npm run size"
|
|
46
49
|
},
|
|
47
50
|
"lint-staged": {
|
|
48
51
|
"*.js": "eslint"
|