autoprefixer 8.1.0 → 8.4.1
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 +13 -0
- package/README.md +26 -40
- package/data/prefixes.js +64 -56
- package/lib/hacks/color-adjust.js +48 -0
- package/lib/hacks/grid-template.js +4 -2
- package/lib/hacks/grid-utils.js +59 -23
- package/lib/prefixes.js +1 -0
- package/lib/processor.js +37 -13
- package/package.json +5 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
|
3
3
|
|
|
4
|
+
## 8.4.1
|
|
5
|
+
* Fix working in old PostCSS versions (by Diablohu).
|
|
6
|
+
|
|
7
|
+
## 8.4 “Non in aves, sed in angues”
|
|
8
|
+
* Add `/* autoprefixer: ignore next */` control comment (by Pavel Vostrikov).
|
|
9
|
+
|
|
10
|
+
## 8.3 “Benigno Numine”
|
|
11
|
+
* Add `@media` support to `grid-template` (by Evgeny Petukhov).
|
|
12
|
+
* Fix `radial-gradient` direction warning (by Gustavo Real).
|
|
13
|
+
|
|
14
|
+
## 8.2 “Ad Astra per Aspera”
|
|
15
|
+
* Add `color-adjust` (by Sergey Lysenko, Stanislav Botev, and Yuriy Alekseyev).
|
|
16
|
+
|
|
4
17
|
## 8.1 “Rex, Familia et Ultio”
|
|
5
18
|
* Add `overscroll-behavior` support.
|
|
6
19
|
* Add `grid-template` shortcut support (by Evgeny Petukhov).
|
package/README.md
CHANGED
|
@@ -66,33 +66,6 @@ Because Autoprefixer is a postprocessor for CSS,
|
|
|
66
66
|
you can also use it with preprocessors such as Sass, Stylus or LESS.
|
|
67
67
|
|
|
68
68
|
|
|
69
|
-
### Flexbox, Filters, etc.
|
|
70
|
-
|
|
71
|
-
Just write normal CSS according to the latest W3C specs and Autoprefixer
|
|
72
|
-
will produce the code for old browsers.
|
|
73
|
-
|
|
74
|
-
```css
|
|
75
|
-
a {
|
|
76
|
-
display: flex;
|
|
77
|
-
}
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
compiles to:
|
|
81
|
-
|
|
82
|
-
```css
|
|
83
|
-
a {
|
|
84
|
-
display: -webkit-box;
|
|
85
|
-
display: -webkit-flex;
|
|
86
|
-
display: -ms-flexbox;
|
|
87
|
-
display: flex;
|
|
88
|
-
}
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
Autoprefixer has [27 special hacks] to fix web browser differences.
|
|
92
|
-
|
|
93
|
-
[27 special hacks]: https://github.com/postcss/autoprefixer/tree/master/lib/hacks
|
|
94
|
-
|
|
95
|
-
|
|
96
69
|
### Only Actual Prefixes
|
|
97
70
|
|
|
98
71
|
Autoprefixer utilizes the most recent data from [Can I Use]
|
|
@@ -122,8 +95,8 @@ a {
|
|
|
122
95
|
## Browsers
|
|
123
96
|
|
|
124
97
|
Autoprefixer uses [Browserslist], so you can specify the browsers
|
|
125
|
-
you want to target in your project by queries like
|
|
126
|
-
|
|
98
|
+
you want to target in your project by queries like `> 5%`
|
|
99
|
+
(see [Best Practises]).
|
|
127
100
|
|
|
128
101
|
The best way to provide browsers is `.browserslistrc` config
|
|
129
102
|
or `package.json` with `browserslist` key. Put it in your project root.
|
|
@@ -137,6 +110,7 @@ and default value.
|
|
|
137
110
|
|
|
138
111
|
[Browserslist docs]: https://github.com/ai/browserslist#queries
|
|
139
112
|
[babel-preset-env]: https://github.com/babel/babel-preset-env
|
|
113
|
+
[Best Practises]: https://github.com/browserslist/browserslist#best-practices
|
|
140
114
|
[Browserslist]: https://github.com/ai/browserslist
|
|
141
115
|
[Stylelint]: http://stylelint.io/
|
|
142
116
|
|
|
@@ -541,19 +515,27 @@ If you do not need Autoprefixer in some part of your CSS,
|
|
|
541
515
|
you can use control comments to disable Autoprefixer.
|
|
542
516
|
|
|
543
517
|
```css
|
|
544
|
-
a {
|
|
518
|
+
.a {
|
|
545
519
|
transition: 1s; /* it will be prefixed */
|
|
546
520
|
}
|
|
547
521
|
|
|
548
|
-
b {
|
|
522
|
+
.b {
|
|
549
523
|
/* autoprefixer: off */
|
|
550
524
|
transition: 1s; /* it will not be prefixed */
|
|
551
525
|
}
|
|
526
|
+
|
|
527
|
+
.c {
|
|
528
|
+
/* autoprefixer: ignore next */
|
|
529
|
+
transition: 1s; /* it will not be prefixed */
|
|
530
|
+
mask: url(image.png); /* it will be prefixed */
|
|
531
|
+
}
|
|
552
532
|
```
|
|
553
533
|
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
534
|
+
There is two types of control commens:
|
|
535
|
+
|
|
536
|
+
* `/* autoprefixer: off */` disable the whole block *before* and after comment.
|
|
537
|
+
* `/* autoprefixer: ignore next */` disable only next property
|
|
538
|
+
or next rule selector or at-rule parameters (but not rule/at‑rule body).
|
|
557
539
|
|
|
558
540
|
You can also use comments recursively:
|
|
559
541
|
|
|
@@ -568,7 +550,11 @@ You can also use comments recursively:
|
|
|
568
550
|
```
|
|
569
551
|
|
|
570
552
|
In Sass/SCSS you can use all the disable options above, add an exclamation mark
|
|
571
|
-
in the start of comment:
|
|
553
|
+
in the start of comment:
|
|
554
|
+
|
|
555
|
+
```scss
|
|
556
|
+
/*! autoprefixer: off */
|
|
557
|
+
```
|
|
572
558
|
|
|
573
559
|
|
|
574
560
|
## Options
|
|
@@ -582,11 +568,6 @@ autoprefixer({ cascade: false })
|
|
|
582
568
|
|
|
583
569
|
Available options are:
|
|
584
570
|
|
|
585
|
-
* `browsers` (array): list of browsers query (like `last 2 versions`),
|
|
586
|
-
which are supported in your project. We recommend to use `browserslist`
|
|
587
|
-
config or `browserslist` key in `package.json`, rather than this option
|
|
588
|
-
to share browsers with other tools. See [Browserslist docs] for available
|
|
589
|
-
queries and default value.
|
|
590
571
|
* `env` (string): environment for Browserslist.
|
|
591
572
|
* `cascade` (boolean): should Autoprefixer use Visual Cascade,
|
|
592
573
|
if CSS is uncompressed. Default: `true`
|
|
@@ -602,6 +583,11 @@ Available options are:
|
|
|
602
583
|
properties. Default is `false`.
|
|
603
584
|
* `stats` (object): custom [usage statistics] for `> 10% in my stats`
|
|
604
585
|
browsers query.
|
|
586
|
+
* `browsers` (array): list of queries for target browsers. Try to not use it.
|
|
587
|
+
The best preactive is to use `.browserslistrc` config
|
|
588
|
+
or `browserslist` key in `package.json` to share target browsers
|
|
589
|
+
with Babel, ESLint and Stylelint. See [Browserslist docs]
|
|
590
|
+
for available queries and default value.
|
|
605
591
|
|
|
606
592
|
Plugin object has `info()` method for debugging purpose.
|
|
607
593
|
|
package/data/prefixes.js
CHANGED
|
@@ -84,7 +84,7 @@ var add = function add(names, data) {
|
|
|
84
84
|
module.exports = result;
|
|
85
85
|
|
|
86
86
|
// Border Radius
|
|
87
|
-
f(require('caniuse-lite/data/features/border-radius
|
|
87
|
+
f(require('caniuse-lite/data/features/border-radius'), function (browsers) {
|
|
88
88
|
return prefix(['border-radius', 'border-top-left-radius', 'border-top-right-radius', 'border-bottom-right-radius', 'border-bottom-left-radius'], {
|
|
89
89
|
mistakes: ['-khtml-', '-ms-', '-o-'],
|
|
90
90
|
feature: 'border-radius',
|
|
@@ -93,7 +93,7 @@ f(require('caniuse-lite/data/features/border-radius.js'), function (browsers) {
|
|
|
93
93
|
});
|
|
94
94
|
|
|
95
95
|
// Box Shadow
|
|
96
|
-
f(require('caniuse-lite/data/features/css-boxshadow
|
|
96
|
+
f(require('caniuse-lite/data/features/css-boxshadow'), function (browsers) {
|
|
97
97
|
return prefix(['box-shadow'], {
|
|
98
98
|
mistakes: ['-khtml-'],
|
|
99
99
|
feature: 'css-boxshadow',
|
|
@@ -102,7 +102,7 @@ f(require('caniuse-lite/data/features/css-boxshadow.js'), function (browsers) {
|
|
|
102
102
|
});
|
|
103
103
|
|
|
104
104
|
// Animation
|
|
105
|
-
f(require('caniuse-lite/data/features/css-animation
|
|
105
|
+
f(require('caniuse-lite/data/features/css-animation'), function (browsers) {
|
|
106
106
|
return prefix(['animation', 'animation-name', 'animation-duration', 'animation-delay', 'animation-direction', 'animation-fill-mode', 'animation-iteration-count', 'animation-play-state', 'animation-timing-function', '@keyframes'], {
|
|
107
107
|
mistakes: ['-khtml-', '-ms-'],
|
|
108
108
|
feature: 'css-animation',
|
|
@@ -111,7 +111,7 @@ f(require('caniuse-lite/data/features/css-animation.js'), function (browsers) {
|
|
|
111
111
|
});
|
|
112
112
|
|
|
113
113
|
// Transition
|
|
114
|
-
f(require('caniuse-lite/data/features/css-transitions
|
|
114
|
+
f(require('caniuse-lite/data/features/css-transitions'), function (browsers) {
|
|
115
115
|
return prefix(['transition', 'transition-property', 'transition-duration', 'transition-delay', 'transition-timing-function'], {
|
|
116
116
|
mistakes: ['-khtml-', '-ms-'],
|
|
117
117
|
browsers: browsers,
|
|
@@ -120,7 +120,7 @@ f(require('caniuse-lite/data/features/css-transitions.js'), function (browsers)
|
|
|
120
120
|
});
|
|
121
121
|
|
|
122
122
|
// Transform 2D
|
|
123
|
-
f(require('caniuse-lite/data/features/transforms2d
|
|
123
|
+
f(require('caniuse-lite/data/features/transforms2d'), function (browsers) {
|
|
124
124
|
return prefix(['transform', 'transform-origin'], {
|
|
125
125
|
feature: 'transforms2d',
|
|
126
126
|
browsers: browsers
|
|
@@ -128,7 +128,7 @@ f(require('caniuse-lite/data/features/transforms2d.js'), function (browsers) {
|
|
|
128
128
|
});
|
|
129
129
|
|
|
130
130
|
// Transform 3D
|
|
131
|
-
var transforms3d = require('caniuse-lite/data/features/transforms3d
|
|
131
|
+
var transforms3d = require('caniuse-lite/data/features/transforms3d');
|
|
132
132
|
|
|
133
133
|
f(transforms3d, function (browsers) {
|
|
134
134
|
prefix(['perspective', 'perspective-origin'], {
|
|
@@ -151,7 +151,7 @@ f(transforms3d, { match: /y\sx|y\s#2/ }, function (browsers) {
|
|
|
151
151
|
});
|
|
152
152
|
|
|
153
153
|
// Gradients
|
|
154
|
-
var gradients = require('caniuse-lite/data/features/css-gradients
|
|
154
|
+
var gradients = require('caniuse-lite/data/features/css-gradients');
|
|
155
155
|
|
|
156
156
|
f(gradients, { match: /y\sx/ }, function (browsers) {
|
|
157
157
|
return prefix(['linear-gradient', 'repeating-linear-gradient', 'radial-gradient', 'repeating-radial-gradient'], {
|
|
@@ -177,7 +177,7 @@ f(gradients, { match: /a\sx/ }, function (browsers) {
|
|
|
177
177
|
});
|
|
178
178
|
|
|
179
179
|
// Box sizing
|
|
180
|
-
f(require('caniuse-lite/data/features/css3-boxsizing
|
|
180
|
+
f(require('caniuse-lite/data/features/css3-boxsizing'), function (browsers) {
|
|
181
181
|
return prefix(['box-sizing'], {
|
|
182
182
|
feature: 'css3-boxsizing',
|
|
183
183
|
browsers: browsers
|
|
@@ -185,7 +185,7 @@ f(require('caniuse-lite/data/features/css3-boxsizing.js'), function (browsers) {
|
|
|
185
185
|
});
|
|
186
186
|
|
|
187
187
|
// Filter Effects
|
|
188
|
-
f(require('caniuse-lite/data/features/css-filters
|
|
188
|
+
f(require('caniuse-lite/data/features/css-filters'), function (browsers) {
|
|
189
189
|
return prefix(['filter'], {
|
|
190
190
|
feature: 'css-filters',
|
|
191
191
|
browsers: browsers
|
|
@@ -193,7 +193,7 @@ f(require('caniuse-lite/data/features/css-filters.js'), function (browsers) {
|
|
|
193
193
|
});
|
|
194
194
|
|
|
195
195
|
// filter() function
|
|
196
|
-
f(require('caniuse-lite/data/features/css-filter-function
|
|
196
|
+
f(require('caniuse-lite/data/features/css-filter-function'), function (browsers) {
|
|
197
197
|
return prefix(['filter-function'], {
|
|
198
198
|
props: ['background', 'background-image', 'border-image', 'mask', 'list-style', 'list-style-image', 'content', 'mask-image'],
|
|
199
199
|
feature: 'css-filter-function',
|
|
@@ -202,7 +202,7 @@ f(require('caniuse-lite/data/features/css-filter-function.js'), function (browse
|
|
|
202
202
|
});
|
|
203
203
|
|
|
204
204
|
// Backdrop-filter
|
|
205
|
-
f(require('caniuse-lite/data/features/css-backdrop-filter
|
|
205
|
+
f(require('caniuse-lite/data/features/css-backdrop-filter'), function (browsers) {
|
|
206
206
|
return prefix(['backdrop-filter'], {
|
|
207
207
|
feature: 'css-backdrop-filter',
|
|
208
208
|
browsers: browsers
|
|
@@ -210,7 +210,7 @@ f(require('caniuse-lite/data/features/css-backdrop-filter.js'), function (browse
|
|
|
210
210
|
});
|
|
211
211
|
|
|
212
212
|
// element() function
|
|
213
|
-
f(require('caniuse-lite/data/features/css-element-function
|
|
213
|
+
f(require('caniuse-lite/data/features/css-element-function'), function (browsers) {
|
|
214
214
|
return prefix(['element'], {
|
|
215
215
|
props: ['background', 'background-image', 'border-image', 'mask', 'list-style', 'list-style-image', 'content', 'mask-image'],
|
|
216
216
|
feature: 'css-element-function',
|
|
@@ -219,7 +219,7 @@ f(require('caniuse-lite/data/features/css-element-function.js'), function (brows
|
|
|
219
219
|
});
|
|
220
220
|
|
|
221
221
|
// Multicolumns
|
|
222
|
-
f(require('caniuse-lite/data/features/multicolumn
|
|
222
|
+
f(require('caniuse-lite/data/features/multicolumn'), function (browsers) {
|
|
223
223
|
prefix(['columns', 'column-width', 'column-gap', 'column-rule', 'column-rule-color', 'column-rule-width', 'column-count', 'column-rule-style', 'column-span', 'column-fill'], {
|
|
224
224
|
feature: 'multicolumn',
|
|
225
225
|
browsers: browsers
|
|
@@ -235,7 +235,7 @@ f(require('caniuse-lite/data/features/multicolumn.js'), function (browsers) {
|
|
|
235
235
|
});
|
|
236
236
|
|
|
237
237
|
// User select
|
|
238
|
-
f(require('caniuse-lite/data/features/user-select-none
|
|
238
|
+
f(require('caniuse-lite/data/features/user-select-none'), function (browsers) {
|
|
239
239
|
return prefix(['user-select'], {
|
|
240
240
|
mistakes: ['-khtml-'],
|
|
241
241
|
feature: 'user-select-none',
|
|
@@ -244,7 +244,7 @@ f(require('caniuse-lite/data/features/user-select-none.js'), function (browsers)
|
|
|
244
244
|
});
|
|
245
245
|
|
|
246
246
|
// Flexible Box Layout
|
|
247
|
-
var flexbox = require('caniuse-lite/data/features/flexbox
|
|
247
|
+
var flexbox = require('caniuse-lite/data/features/flexbox');
|
|
248
248
|
f(flexbox, { match: /a\sx/ }, function (browsers) {
|
|
249
249
|
browsers = browsers.map(function (i) {
|
|
250
250
|
if (/ie|firefox/.test(i)) {
|
|
@@ -284,7 +284,7 @@ f(flexbox, { match: /y\sx/ }, function (browsers) {
|
|
|
284
284
|
});
|
|
285
285
|
|
|
286
286
|
// calc() unit
|
|
287
|
-
f(require('caniuse-lite/data/features/calc
|
|
287
|
+
f(require('caniuse-lite/data/features/calc'), function (browsers) {
|
|
288
288
|
return prefix(['calc'], {
|
|
289
289
|
props: ['*'],
|
|
290
290
|
feature: 'calc',
|
|
@@ -293,7 +293,7 @@ f(require('caniuse-lite/data/features/calc.js'), function (browsers) {
|
|
|
293
293
|
});
|
|
294
294
|
|
|
295
295
|
// Background options
|
|
296
|
-
f(require('caniuse-lite/data/features/background-img-opts
|
|
296
|
+
f(require('caniuse-lite/data/features/background-img-opts'), function (browsers) {
|
|
297
297
|
return prefix(['background-clip', 'background-origin', 'background-size'], {
|
|
298
298
|
feature: 'background-img-opts',
|
|
299
299
|
browsers: browsers
|
|
@@ -301,7 +301,7 @@ f(require('caniuse-lite/data/features/background-img-opts.js'), function (browse
|
|
|
301
301
|
});
|
|
302
302
|
|
|
303
303
|
// Font feature settings
|
|
304
|
-
f(require('caniuse-lite/data/features/font-feature
|
|
304
|
+
f(require('caniuse-lite/data/features/font-feature'), function (browsers) {
|
|
305
305
|
return prefix(['font-feature-settings', 'font-variant-ligatures', 'font-language-override'], {
|
|
306
306
|
feature: 'font-feature',
|
|
307
307
|
browsers: browsers
|
|
@@ -309,7 +309,7 @@ f(require('caniuse-lite/data/features/font-feature.js'), function (browsers) {
|
|
|
309
309
|
});
|
|
310
310
|
|
|
311
311
|
// CSS font-kerning property
|
|
312
|
-
f(require('caniuse-lite/data/features/font-kerning
|
|
312
|
+
f(require('caniuse-lite/data/features/font-kerning'), function (browsers) {
|
|
313
313
|
return prefix(['font-kerning'], {
|
|
314
314
|
feature: 'font-kerning',
|
|
315
315
|
browsers: browsers
|
|
@@ -317,7 +317,7 @@ f(require('caniuse-lite/data/features/font-kerning.js'), function (browsers) {
|
|
|
317
317
|
});
|
|
318
318
|
|
|
319
319
|
// Border image
|
|
320
|
-
f(require('caniuse-lite/data/features/border-image
|
|
320
|
+
f(require('caniuse-lite/data/features/border-image'), function (browsers) {
|
|
321
321
|
return prefix(['border-image'], {
|
|
322
322
|
feature: 'border-image',
|
|
323
323
|
browsers: browsers
|
|
@@ -325,7 +325,7 @@ f(require('caniuse-lite/data/features/border-image.js'), function (browsers) {
|
|
|
325
325
|
});
|
|
326
326
|
|
|
327
327
|
// Selection selector
|
|
328
|
-
f(require('caniuse-lite/data/features/css-selection
|
|
328
|
+
f(require('caniuse-lite/data/features/css-selection'), function (browsers) {
|
|
329
329
|
return prefix(['::selection'], {
|
|
330
330
|
selector: true,
|
|
331
331
|
feature: 'css-selection',
|
|
@@ -334,7 +334,7 @@ f(require('caniuse-lite/data/features/css-selection.js'), function (browsers) {
|
|
|
334
334
|
});
|
|
335
335
|
|
|
336
336
|
// Placeholder selector
|
|
337
|
-
f(require('caniuse-lite/data/features/css-placeholder
|
|
337
|
+
f(require('caniuse-lite/data/features/css-placeholder'), function (browsers) {
|
|
338
338
|
browsers = browsers.map(function (i) {
|
|
339
339
|
var _i$split = i.split(' '),
|
|
340
340
|
name = _i$split[0],
|
|
@@ -357,7 +357,7 @@ f(require('caniuse-lite/data/features/css-placeholder.js'), function (browsers)
|
|
|
357
357
|
});
|
|
358
358
|
|
|
359
359
|
// Hyphenation
|
|
360
|
-
f(require('caniuse-lite/data/features/css-hyphens
|
|
360
|
+
f(require('caniuse-lite/data/features/css-hyphens'), function (browsers) {
|
|
361
361
|
return prefix(['hyphens'], {
|
|
362
362
|
feature: 'css-hyphens',
|
|
363
363
|
browsers: browsers
|
|
@@ -365,7 +365,7 @@ f(require('caniuse-lite/data/features/css-hyphens.js'), function (browsers) {
|
|
|
365
365
|
});
|
|
366
366
|
|
|
367
367
|
// Fullscreen selector
|
|
368
|
-
var fullscreen = require('caniuse-lite/data/features/fullscreen
|
|
368
|
+
var fullscreen = require('caniuse-lite/data/features/fullscreen');
|
|
369
369
|
|
|
370
370
|
f(fullscreen, function (browsers) {
|
|
371
371
|
return prefix([':fullscreen'], {
|
|
@@ -384,7 +384,7 @@ f(fullscreen, { match: /x(\s#2|$)/ }, function (browsers) {
|
|
|
384
384
|
});
|
|
385
385
|
|
|
386
386
|
// Tab size
|
|
387
|
-
f(require('caniuse-lite/data/features/css3-tabsize
|
|
387
|
+
f(require('caniuse-lite/data/features/css3-tabsize'), function (browsers) {
|
|
388
388
|
return prefix(['tab-size'], {
|
|
389
389
|
feature: 'css3-tabsize',
|
|
390
390
|
browsers: browsers
|
|
@@ -392,7 +392,7 @@ f(require('caniuse-lite/data/features/css3-tabsize.js'), function (browsers) {
|
|
|
392
392
|
});
|
|
393
393
|
|
|
394
394
|
// Intrinsic & extrinsic sizing
|
|
395
|
-
f(require('caniuse-lite/data/features/intrinsic-width
|
|
395
|
+
f(require('caniuse-lite/data/features/intrinsic-width'), function (browsers) {
|
|
396
396
|
return prefix(['max-content', 'min-content', 'fit-content', 'fill', 'fill-available', 'stretch'], {
|
|
397
397
|
props: ['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'],
|
|
398
398
|
feature: 'intrinsic-width',
|
|
@@ -401,7 +401,7 @@ f(require('caniuse-lite/data/features/intrinsic-width.js'), function (browsers)
|
|
|
401
401
|
});
|
|
402
402
|
|
|
403
403
|
// Zoom cursors
|
|
404
|
-
f(require('caniuse-lite/data/features/css3-cursors-newer
|
|
404
|
+
f(require('caniuse-lite/data/features/css3-cursors-newer'), function (browsers) {
|
|
405
405
|
return prefix(['zoom-in', 'zoom-out'], {
|
|
406
406
|
props: ['cursor'],
|
|
407
407
|
feature: 'css3-cursors-newer',
|
|
@@ -410,7 +410,7 @@ f(require('caniuse-lite/data/features/css3-cursors-newer.js'), function (browser
|
|
|
410
410
|
});
|
|
411
411
|
|
|
412
412
|
// Grab cursors
|
|
413
|
-
f(require('caniuse-lite/data/features/css3-cursors-grab
|
|
413
|
+
f(require('caniuse-lite/data/features/css3-cursors-grab'), function (browsers) {
|
|
414
414
|
return prefix(['grab', 'grabbing'], {
|
|
415
415
|
props: ['cursor'],
|
|
416
416
|
feature: 'css3-cursors-grab',
|
|
@@ -419,7 +419,7 @@ f(require('caniuse-lite/data/features/css3-cursors-grab.js'), function (browsers
|
|
|
419
419
|
});
|
|
420
420
|
|
|
421
421
|
// Sticky position
|
|
422
|
-
f(require('caniuse-lite/data/features/css-sticky
|
|
422
|
+
f(require('caniuse-lite/data/features/css-sticky'), function (browsers) {
|
|
423
423
|
return prefix(['sticky'], {
|
|
424
424
|
props: ['position'],
|
|
425
425
|
feature: 'css-sticky',
|
|
@@ -428,7 +428,7 @@ f(require('caniuse-lite/data/features/css-sticky.js'), function (browsers) {
|
|
|
428
428
|
});
|
|
429
429
|
|
|
430
430
|
// Pointer Events
|
|
431
|
-
f(require('caniuse-lite/data/features/pointer
|
|
431
|
+
f(require('caniuse-lite/data/features/pointer'), function (browsers) {
|
|
432
432
|
return prefix(['touch-action'], {
|
|
433
433
|
feature: 'pointer',
|
|
434
434
|
browsers: browsers
|
|
@@ -436,7 +436,7 @@ f(require('caniuse-lite/data/features/pointer.js'), function (browsers) {
|
|
|
436
436
|
});
|
|
437
437
|
|
|
438
438
|
// Text decoration
|
|
439
|
-
var decoration = require('caniuse-lite/data/features/text-decoration
|
|
439
|
+
var decoration = require('caniuse-lite/data/features/text-decoration');
|
|
440
440
|
|
|
441
441
|
f(decoration, function (browsers) {
|
|
442
442
|
return prefix(['text-decoration-style', 'text-decoration-color', 'text-decoration-line', 'text-decoration'], {
|
|
@@ -453,7 +453,7 @@ f(decoration, { match: /x.*#[23]/ }, function (browsers) {
|
|
|
453
453
|
});
|
|
454
454
|
|
|
455
455
|
// Text Size Adjust
|
|
456
|
-
f(require('caniuse-lite/data/features/text-size-adjust
|
|
456
|
+
f(require('caniuse-lite/data/features/text-size-adjust'), function (browsers) {
|
|
457
457
|
return prefix(['text-size-adjust'], {
|
|
458
458
|
feature: 'text-size-adjust',
|
|
459
459
|
browsers: browsers
|
|
@@ -461,7 +461,7 @@ f(require('caniuse-lite/data/features/text-size-adjust.js'), function (browsers)
|
|
|
461
461
|
});
|
|
462
462
|
|
|
463
463
|
// CSS Masks
|
|
464
|
-
f(require('caniuse-lite/data/features/css-masks
|
|
464
|
+
f(require('caniuse-lite/data/features/css-masks'), function (browsers) {
|
|
465
465
|
prefix(['mask-clip', 'mask-composite', 'mask-image', 'mask-origin', 'mask-repeat', 'mask-border-repeat', 'mask-border-source'], {
|
|
466
466
|
feature: 'css-masks',
|
|
467
467
|
browsers: browsers
|
|
@@ -473,7 +473,7 @@ f(require('caniuse-lite/data/features/css-masks.js'), function (browsers) {
|
|
|
473
473
|
});
|
|
474
474
|
|
|
475
475
|
// CSS clip-path property
|
|
476
|
-
f(require('caniuse-lite/data/features/css-clip-path
|
|
476
|
+
f(require('caniuse-lite/data/features/css-clip-path'), function (browsers) {
|
|
477
477
|
return prefix(['clip-path'], {
|
|
478
478
|
feature: 'css-clip-path',
|
|
479
479
|
browsers: browsers
|
|
@@ -481,7 +481,7 @@ f(require('caniuse-lite/data/features/css-clip-path.js'), function (browsers) {
|
|
|
481
481
|
});
|
|
482
482
|
|
|
483
483
|
// Fragmented Borders and Backgrounds
|
|
484
|
-
f(require('caniuse-lite/data/features/css-boxdecorationbreak
|
|
484
|
+
f(require('caniuse-lite/data/features/css-boxdecorationbreak'), function (browsers) {
|
|
485
485
|
return prefix(['box-decoration-break'], {
|
|
486
486
|
feature: 'css-boxdecorationbreak',
|
|
487
487
|
browsers: browsers
|
|
@@ -489,7 +489,7 @@ f(require('caniuse-lite/data/features/css-boxdecorationbreak.js'), function (bro
|
|
|
489
489
|
});
|
|
490
490
|
|
|
491
491
|
// CSS3 object-fit/object-position
|
|
492
|
-
f(require('caniuse-lite/data/features/object-fit
|
|
492
|
+
f(require('caniuse-lite/data/features/object-fit'), function (browsers) {
|
|
493
493
|
return prefix(['object-fit', 'object-position'], {
|
|
494
494
|
feature: 'object-fit',
|
|
495
495
|
browsers: browsers
|
|
@@ -497,7 +497,7 @@ f(require('caniuse-lite/data/features/object-fit.js'), function (browsers) {
|
|
|
497
497
|
});
|
|
498
498
|
|
|
499
499
|
// CSS Shapes
|
|
500
|
-
f(require('caniuse-lite/data/features/css-shapes
|
|
500
|
+
f(require('caniuse-lite/data/features/css-shapes'), function (browsers) {
|
|
501
501
|
return prefix(['shape-margin', 'shape-outside', 'shape-image-threshold'], {
|
|
502
502
|
feature: 'css-shapes',
|
|
503
503
|
browsers: browsers
|
|
@@ -505,7 +505,7 @@ f(require('caniuse-lite/data/features/css-shapes.js'), function (browsers) {
|
|
|
505
505
|
});
|
|
506
506
|
|
|
507
507
|
// CSS3 text-overflow
|
|
508
|
-
f(require('caniuse-lite/data/features/text-overflow
|
|
508
|
+
f(require('caniuse-lite/data/features/text-overflow'), function (browsers) {
|
|
509
509
|
return prefix(['text-overflow'], {
|
|
510
510
|
feature: 'text-overflow',
|
|
511
511
|
browsers: browsers
|
|
@@ -513,7 +513,7 @@ f(require('caniuse-lite/data/features/text-overflow.js'), function (browsers) {
|
|
|
513
513
|
});
|
|
514
514
|
|
|
515
515
|
// Viewport at-rule
|
|
516
|
-
f(require('caniuse-lite/data/features/css-deviceadaptation
|
|
516
|
+
f(require('caniuse-lite/data/features/css-deviceadaptation'), function (browsers) {
|
|
517
517
|
return prefix(['@viewport'], {
|
|
518
518
|
feature: 'css-deviceadaptation',
|
|
519
519
|
browsers: browsers
|
|
@@ -521,7 +521,7 @@ f(require('caniuse-lite/data/features/css-deviceadaptation.js'), function (brows
|
|
|
521
521
|
});
|
|
522
522
|
|
|
523
523
|
// Resolution Media Queries
|
|
524
|
-
var resolut = require('caniuse-lite/data/features/css-media-resolution
|
|
524
|
+
var resolut = require('caniuse-lite/data/features/css-media-resolution');
|
|
525
525
|
f(resolut, { match: /( x($| )|a #3)/ }, function (browsers) {
|
|
526
526
|
return prefix(['@resolution'], {
|
|
527
527
|
feature: 'css-media-resolution',
|
|
@@ -530,7 +530,7 @@ f(resolut, { match: /( x($| )|a #3)/ }, function (browsers) {
|
|
|
530
530
|
});
|
|
531
531
|
|
|
532
532
|
// CSS text-align-last
|
|
533
|
-
f(require('caniuse-lite/data/features/css-text-align-last
|
|
533
|
+
f(require('caniuse-lite/data/features/css-text-align-last'), function (browsers) {
|
|
534
534
|
return prefix(['text-align-last'], {
|
|
535
535
|
feature: 'css-text-align-last',
|
|
536
536
|
browsers: browsers
|
|
@@ -538,7 +538,7 @@ f(require('caniuse-lite/data/features/css-text-align-last.js'), function (browse
|
|
|
538
538
|
});
|
|
539
539
|
|
|
540
540
|
// Crisp Edges Image Rendering Algorithm
|
|
541
|
-
var crispedges = require('caniuse-lite/data/features/css-crisp-edges
|
|
541
|
+
var crispedges = require('caniuse-lite/data/features/css-crisp-edges');
|
|
542
542
|
|
|
543
543
|
f(crispedges, { match: /y x|a x #1/ }, function (browsers) {
|
|
544
544
|
return prefix(['pixelated'], {
|
|
@@ -556,7 +556,7 @@ f(crispedges, { match: /a x #2/ }, function (browsers) {
|
|
|
556
556
|
});
|
|
557
557
|
|
|
558
558
|
// Logical Properties
|
|
559
|
-
var logicalProps = require('caniuse-lite/data/features/css-logical-props
|
|
559
|
+
var logicalProps = require('caniuse-lite/data/features/css-logical-props');
|
|
560
560
|
|
|
561
561
|
f(logicalProps, function (browsers) {
|
|
562
562
|
return prefix(['border-inline-start', 'border-inline-end', 'margin-inline-start', 'margin-inline-end', 'padding-inline-start', 'padding-inline-end'], {
|
|
@@ -573,7 +573,7 @@ f(logicalProps, { match: /x\s#2/ }, function (browsers) {
|
|
|
573
573
|
});
|
|
574
574
|
|
|
575
575
|
// CSS appearance
|
|
576
|
-
var appearance = require('caniuse-lite/data/features/css-appearance
|
|
576
|
+
var appearance = require('caniuse-lite/data/features/css-appearance');
|
|
577
577
|
f(appearance, { match: /#2|x/ }, function (browsers) {
|
|
578
578
|
return prefix(['appearance'], {
|
|
579
579
|
feature: 'css-appearance',
|
|
@@ -582,7 +582,7 @@ f(appearance, { match: /#2|x/ }, function (browsers) {
|
|
|
582
582
|
});
|
|
583
583
|
|
|
584
584
|
// CSS Scroll snap points
|
|
585
|
-
f(require('caniuse-lite/data/features/css-snappoints
|
|
585
|
+
f(require('caniuse-lite/data/features/css-snappoints'), function (browsers) {
|
|
586
586
|
return prefix(['scroll-snap-type', 'scroll-snap-coordinate', 'scroll-snap-destination', 'scroll-snap-points-x', 'scroll-snap-points-y'], {
|
|
587
587
|
feature: 'css-snappoints',
|
|
588
588
|
browsers: browsers
|
|
@@ -590,7 +590,7 @@ f(require('caniuse-lite/data/features/css-snappoints.js'), function (browsers) {
|
|
|
590
590
|
});
|
|
591
591
|
|
|
592
592
|
// CSS Regions
|
|
593
|
-
f(require('caniuse-lite/data/features/css-regions
|
|
593
|
+
f(require('caniuse-lite/data/features/css-regions'), function (browsers) {
|
|
594
594
|
return prefix(['flow-into', 'flow-from', 'region-fragment'], {
|
|
595
595
|
feature: 'css-regions',
|
|
596
596
|
browsers: browsers
|
|
@@ -598,7 +598,7 @@ f(require('caniuse-lite/data/features/css-regions.js'), function (browsers) {
|
|
|
598
598
|
});
|
|
599
599
|
|
|
600
600
|
// CSS image-set
|
|
601
|
-
f(require('caniuse-lite/data/features/css-image-set
|
|
601
|
+
f(require('caniuse-lite/data/features/css-image-set'), function (browsers) {
|
|
602
602
|
return prefix(['image-set'], {
|
|
603
603
|
props: ['background', 'background-image', 'border-image', 'cursor', 'mask', 'mask-image', 'list-style', 'list-style-image', 'content'],
|
|
604
604
|
feature: 'css-image-set',
|
|
@@ -607,7 +607,7 @@ f(require('caniuse-lite/data/features/css-image-set.js'), function (browsers) {
|
|
|
607
607
|
});
|
|
608
608
|
|
|
609
609
|
// Writing Mode
|
|
610
|
-
var writingMode = require('caniuse-lite/data/features/css-writing-mode
|
|
610
|
+
var writingMode = require('caniuse-lite/data/features/css-writing-mode');
|
|
611
611
|
f(writingMode, { match: /a|x/ }, function (browsers) {
|
|
612
612
|
return prefix(['writing-mode'], {
|
|
613
613
|
feature: 'css-writing-mode',
|
|
@@ -616,7 +616,7 @@ f(writingMode, { match: /a|x/ }, function (browsers) {
|
|
|
616
616
|
});
|
|
617
617
|
|
|
618
618
|
// Cross-Fade Function
|
|
619
|
-
f(require('caniuse-lite/data/features/css-cross-fade
|
|
619
|
+
f(require('caniuse-lite/data/features/css-cross-fade'), function (browsers) {
|
|
620
620
|
return prefix(['cross-fade'], {
|
|
621
621
|
props: ['background', 'background-image', 'border-image', 'mask', 'list-style', 'list-style-image', 'content', 'mask-image'],
|
|
622
622
|
feature: 'css-cross-fade',
|
|
@@ -625,7 +625,7 @@ f(require('caniuse-lite/data/features/css-cross-fade.js'), function (browsers) {
|
|
|
625
625
|
});
|
|
626
626
|
|
|
627
627
|
// Read Only selector
|
|
628
|
-
f(require('caniuse-lite/data/features/css-read-only-write
|
|
628
|
+
f(require('caniuse-lite/data/features/css-read-only-write'), function (browsers) {
|
|
629
629
|
return prefix([':read-only', ':read-write'], {
|
|
630
630
|
selector: true,
|
|
631
631
|
feature: 'css-read-only-write',
|
|
@@ -634,7 +634,7 @@ f(require('caniuse-lite/data/features/css-read-only-write.js'), function (browse
|
|
|
634
634
|
});
|
|
635
635
|
|
|
636
636
|
// Text Emphasize
|
|
637
|
-
f(require('caniuse-lite/data/features/text-emphasis
|
|
637
|
+
f(require('caniuse-lite/data/features/text-emphasis'), function (browsers) {
|
|
638
638
|
return prefix(['text-emphasis', 'text-emphasis-position', 'text-emphasis-style', 'text-emphasis-color'], {
|
|
639
639
|
feature: 'text-emphasis',
|
|
640
640
|
browsers: browsers
|
|
@@ -642,7 +642,7 @@ f(require('caniuse-lite/data/features/text-emphasis.js'), function (browsers) {
|
|
|
642
642
|
});
|
|
643
643
|
|
|
644
644
|
// CSS Grid Layout
|
|
645
|
-
var grid = require('caniuse-lite/data/features/css-grid
|
|
645
|
+
var grid = require('caniuse-lite/data/features/css-grid');
|
|
646
646
|
|
|
647
647
|
f(grid, function (browsers) {
|
|
648
648
|
prefix(['display-grid', 'inline-grid'], {
|
|
@@ -664,7 +664,7 @@ f(grid, { match: /a x/ }, function (browsers) {
|
|
|
664
664
|
});
|
|
665
665
|
|
|
666
666
|
// CSS text-spacing
|
|
667
|
-
f(require('caniuse-lite/data/features/css-text-spacing
|
|
667
|
+
f(require('caniuse-lite/data/features/css-text-spacing'), function (browsers) {
|
|
668
668
|
return prefix(['text-spacing'], {
|
|
669
669
|
feature: 'css-text-spacing',
|
|
670
670
|
browsers: browsers
|
|
@@ -672,7 +672,7 @@ f(require('caniuse-lite/data/features/css-text-spacing.js'), function (browsers)
|
|
|
672
672
|
});
|
|
673
673
|
|
|
674
674
|
// :any-link selector
|
|
675
|
-
f(require('caniuse-lite/data/features/css-any-link
|
|
675
|
+
f(require('caniuse-lite/data/features/css-any-link'), function (browsers) {
|
|
676
676
|
return prefix([':any-link'], {
|
|
677
677
|
selector: true,
|
|
678
678
|
feature: 'css-any-link',
|
|
@@ -681,7 +681,7 @@ f(require('caniuse-lite/data/features/css-any-link.js'), function (browsers) {
|
|
|
681
681
|
});
|
|
682
682
|
|
|
683
683
|
// unicode-bidi
|
|
684
|
-
var bidi = require('caniuse-lite/data/features/css-unicode-bidi
|
|
684
|
+
var bidi = require('caniuse-lite/data/features/css-unicode-bidi');
|
|
685
685
|
|
|
686
686
|
f(bidi, function (browsers) {
|
|
687
687
|
return prefix(['isolate'], {
|
|
@@ -708,10 +708,18 @@ f(bidi, { match: /y x/ }, function (browsers) {
|
|
|
708
708
|
});
|
|
709
709
|
|
|
710
710
|
// overscroll-behavior selector
|
|
711
|
-
var over = require('caniuse-lite/data/features/css-overscroll-behavior
|
|
711
|
+
var over = require('caniuse-lite/data/features/css-overscroll-behavior');
|
|
712
712
|
f(over, { match: /a #1/ }, function (browsers) {
|
|
713
713
|
return prefix(['overscroll-behavior'], {
|
|
714
714
|
feature: 'css-overscroll-behavior',
|
|
715
715
|
browsers: browsers
|
|
716
716
|
});
|
|
717
|
+
});
|
|
718
|
+
|
|
719
|
+
// color-adjust
|
|
720
|
+
f(require('caniuse-lite/data/features/css-color-adjust'), function (browsers) {
|
|
721
|
+
return prefix(['color-adjust'], {
|
|
722
|
+
feature: 'css-color-adjust',
|
|
723
|
+
browsers: browsers
|
|
724
|
+
});
|
|
717
725
|
});
|
|
@@ -0,0 +1,48 @@
|
|
|
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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
6
|
+
|
|
7
|
+
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; }
|
|
8
|
+
|
|
9
|
+
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) : _defaults(subClass, superClass); }
|
|
10
|
+
|
|
11
|
+
var Declaration = require('../declaration');
|
|
12
|
+
|
|
13
|
+
var ColorAdjust = function (_Declaration) {
|
|
14
|
+
_inherits(ColorAdjust, _Declaration);
|
|
15
|
+
|
|
16
|
+
function ColorAdjust() {
|
|
17
|
+
_classCallCheck(this, ColorAdjust);
|
|
18
|
+
|
|
19
|
+
return _possibleConstructorReturn(this, _Declaration.apply(this, arguments));
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Change property name for WebKit-based browsers
|
|
24
|
+
*/
|
|
25
|
+
ColorAdjust.prototype.prefixed = function prefixed(prop, prefix) {
|
|
26
|
+
return prefix + 'print-color-adjust';
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Return property name by spec
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
ColorAdjust.prototype.normalize = function normalize() {
|
|
35
|
+
return 'color-adjust';
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
return ColorAdjust;
|
|
39
|
+
}(Declaration);
|
|
40
|
+
|
|
41
|
+
Object.defineProperty(ColorAdjust, 'names', {
|
|
42
|
+
enumerable: true,
|
|
43
|
+
writable: true,
|
|
44
|
+
value: ['color-adjust', 'print-color-adjust']
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
module.exports = ColorAdjust;
|
|
@@ -45,14 +45,16 @@ var GridTemplate = function (_Declaration) {
|
|
|
45
45
|
if (rows && columns || hasAreas) {
|
|
46
46
|
decl.cloneBefore({
|
|
47
47
|
prop: '-ms-grid-rows',
|
|
48
|
-
value: rows
|
|
48
|
+
value: rows,
|
|
49
|
+
raws: {}
|
|
49
50
|
});
|
|
50
51
|
}
|
|
51
52
|
|
|
52
53
|
if (columns) {
|
|
53
54
|
decl.cloneBefore({
|
|
54
55
|
prop: '-ms-grid-columns',
|
|
55
|
-
value: columns
|
|
56
|
+
value: columns,
|
|
57
|
+
raws: {}
|
|
56
58
|
});
|
|
57
59
|
}
|
|
58
60
|
|
package/lib/hacks/grid-utils.js
CHANGED
|
@@ -215,17 +215,38 @@ function parseTemplate(decl) {
|
|
|
215
215
|
|
|
216
216
|
// Insert parsed grid areas
|
|
217
217
|
|
|
218
|
-
function
|
|
219
|
-
|
|
218
|
+
function getMSDecls(area) {
|
|
219
|
+
return [].concat({
|
|
220
|
+
prop: '-ms-grid-row',
|
|
221
|
+
value: String(area.row.start)
|
|
222
|
+
}, area.row.span > 1 ? {
|
|
223
|
+
prop: '-ms-grid-row-span',
|
|
224
|
+
value: String(area.row.span)
|
|
225
|
+
} : [], {
|
|
226
|
+
prop: '-ms-grid-column',
|
|
227
|
+
value: String(area.column.start)
|
|
228
|
+
}, area.column.span > 1 ? {
|
|
229
|
+
prop: '-ms-grid-column-span',
|
|
230
|
+
value: String(area.column.span)
|
|
231
|
+
} : []);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
function getParentMedia(parent) {
|
|
235
|
+
if (parent.type === 'atrule' && parent.name === 'media') {
|
|
220
236
|
return parent;
|
|
237
|
+
} else if (!parent.parent) {
|
|
238
|
+
return false;
|
|
221
239
|
}
|
|
222
|
-
return
|
|
240
|
+
return getParentMedia(parent.parent);
|
|
223
241
|
}
|
|
224
242
|
|
|
225
243
|
function insertAreas(areas, decl, result) {
|
|
226
244
|
var missed = Object.keys(areas);
|
|
227
245
|
|
|
228
|
-
|
|
246
|
+
var parentMedia = getParentMedia(decl.parent);
|
|
247
|
+
|
|
248
|
+
decl.root().walkDecls('grid-area', function (gridArea) {
|
|
249
|
+
|
|
229
250
|
var value = gridArea.value;
|
|
230
251
|
var area = areas[value];
|
|
231
252
|
|
|
@@ -233,32 +254,47 @@ function insertAreas(areas, decl, result) {
|
|
|
233
254
|
return e !== value;
|
|
234
255
|
});
|
|
235
256
|
|
|
257
|
+
if (area && parentMedia) {
|
|
258
|
+
|
|
259
|
+
// skip if grid-template-areas already prefixed in media
|
|
260
|
+
if (parentMedia.some(function (i) {
|
|
261
|
+
return i.selector === gridArea.parent.selector;
|
|
262
|
+
})) {
|
|
263
|
+
return undefined;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
// create new rule
|
|
267
|
+
var rule = decl.parent.clone({
|
|
268
|
+
selector: gridArea.parent.selector
|
|
269
|
+
});
|
|
270
|
+
rule.removeAll();
|
|
271
|
+
|
|
272
|
+
// insert prefixed decls in new rule
|
|
273
|
+
getMSDecls(area).forEach(function (i) {
|
|
274
|
+
return rule.append(Object.assign(i, {
|
|
275
|
+
raws: {
|
|
276
|
+
between: gridArea.raws.between
|
|
277
|
+
}
|
|
278
|
+
}));
|
|
279
|
+
});
|
|
280
|
+
|
|
281
|
+
// insert new rule with prefixed decl to existing media
|
|
282
|
+
parentMedia.append(rule);
|
|
283
|
+
|
|
284
|
+
return undefined;
|
|
285
|
+
}
|
|
286
|
+
|
|
236
287
|
if (area) {
|
|
237
288
|
gridArea.parent.walkDecls(/-ms-grid-(row|column)/, function (d) {
|
|
238
289
|
d.remove();
|
|
239
290
|
});
|
|
240
291
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
292
|
+
// insert prefixed decls before grid-area
|
|
293
|
+
getMSDecls(area).forEach(function (i) {
|
|
294
|
+
return gridArea.cloneBefore(i);
|
|
244
295
|
});
|
|
245
|
-
if (area.row.span > 1) {
|
|
246
|
-
gridArea.cloneBefore({
|
|
247
|
-
prop: '-ms-grid-row-span',
|
|
248
|
-
value: String(area.row.span)
|
|
249
|
-
});
|
|
250
|
-
}
|
|
251
|
-
gridArea.cloneBefore({
|
|
252
|
-
prop: '-ms-grid-column',
|
|
253
|
-
value: String(area.column.start)
|
|
254
|
-
});
|
|
255
|
-
if (area.column.span > 1) {
|
|
256
|
-
gridArea.cloneBefore({
|
|
257
|
-
prop: '-ms-grid-column-span',
|
|
258
|
-
value: String(area.column.span)
|
|
259
|
-
});
|
|
260
|
-
}
|
|
261
296
|
}
|
|
297
|
+
|
|
262
298
|
return undefined;
|
|
263
299
|
});
|
|
264
300
|
|
package/lib/prefixes.js
CHANGED
|
@@ -55,6 +55,7 @@ Declaration.hack(require('./hacks/grid-column-align'));
|
|
|
55
55
|
Declaration.hack(require('./hacks/overscroll-behavior'));
|
|
56
56
|
Declaration.hack(require('./hacks/grid-template-areas'));
|
|
57
57
|
Declaration.hack(require('./hacks/text-emphasis-position'));
|
|
58
|
+
Declaration.hack(require('./hacks/color-adjust'));
|
|
58
59
|
|
|
59
60
|
Value.hack(require('./hacks/gradient'));
|
|
60
61
|
Value.hack(require('./hacks/intrinsic'));
|
package/lib/processor.js
CHANGED
|
@@ -6,6 +6,8 @@ var Value = require('./value');
|
|
|
6
6
|
|
|
7
7
|
var OLD_LINEAR = /(^|[^-])linear-gradient\(\s*(top|left|right|bottom)/i;
|
|
8
8
|
var OLD_RADIAL = /(^|[^-])radial-gradient\(\s*\d+(\w*|%)\s+\d+(\w*|%)\s*,/i;
|
|
9
|
+
var RADIAL_BLOCK = /\(((?:[^)(]+|\((?:[^)(]+|\([^)(]*\))*\))*)\)/i;
|
|
10
|
+
var IGNORE_NEXT = /(!\s*)?autoprefixer:\s*ignore\s+next/i;
|
|
9
11
|
|
|
10
12
|
var SIZES = ['width', 'height', 'min-width', 'max-width', 'min-height', 'max-height', 'inline-size', 'min-inline-size', 'max-inline-size', 'block-size', 'min-block-size', 'max-block-size'];
|
|
11
13
|
|
|
@@ -76,10 +78,16 @@ var Processor = function () {
|
|
|
76
78
|
if (decl.value.indexOf('radial-gradient') !== -1) {
|
|
77
79
|
if (OLD_RADIAL.test(decl.value)) {
|
|
78
80
|
result.warn('Gradient has outdated direction syntax. ' + 'New syntax is like `closest-side at 0 0` ' + 'instead of `0 0, closest-side`.', { node: decl });
|
|
79
|
-
} else
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
} else {
|
|
82
|
+
var match = decl.value.match(RADIAL_BLOCK);
|
|
83
|
+
|
|
84
|
+
if (match) {
|
|
85
|
+
if (/cover/.test(match[1])) {
|
|
86
|
+
result.warn('Gradient has outdated direction syntax. ' + 'Replace `cover` to `farthest-corner`.', { node: decl });
|
|
87
|
+
} else if (/contain/.test(match[1])) {
|
|
88
|
+
result.warn('Gradient has outdated direction syntax. ' + 'Replace `contain` to `closest-side`.', { node: decl });
|
|
89
|
+
}
|
|
90
|
+
}
|
|
83
91
|
}
|
|
84
92
|
}
|
|
85
93
|
if (decl.prop === 'text-emphasis-position') {
|
|
@@ -330,10 +338,21 @@ var Processor = function () {
|
|
|
330
338
|
|
|
331
339
|
Processor.prototype.disabled = function disabled(node, result) {
|
|
332
340
|
if (!node) return false;
|
|
341
|
+
|
|
333
342
|
if (node._autoprefixerDisabled !== undefined) {
|
|
334
343
|
return node._autoprefixerDisabled;
|
|
335
344
|
}
|
|
336
345
|
|
|
346
|
+
if (node.parent) {
|
|
347
|
+
var p = node.prev();
|
|
348
|
+
if (p && p.type === 'comment' && IGNORE_NEXT.test(p.text)) {
|
|
349
|
+
node._autoprefixerDisabled = true;
|
|
350
|
+
node._autoprefixerSelfDisabled = true;
|
|
351
|
+
return true;
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
var value = null;
|
|
337
356
|
if (node.nodes) {
|
|
338
357
|
var status = undefined;
|
|
339
358
|
node.each(function (i) {
|
|
@@ -347,19 +366,24 @@ var Processor = function () {
|
|
|
347
366
|
}
|
|
348
367
|
});
|
|
349
368
|
|
|
350
|
-
var value = false;
|
|
351
369
|
if (status !== undefined) {
|
|
352
370
|
value = !status;
|
|
353
|
-
} else if (node.parent) {
|
|
354
|
-
value = this.disabled(node.parent, result);
|
|
355
371
|
}
|
|
356
|
-
|
|
357
|
-
node._autoprefixerDisabled = value;
|
|
358
|
-
return node._autoprefixerDisabled;
|
|
359
|
-
} else {
|
|
360
|
-
node._autoprefixerDisabled = this.disabled(node.parent, result);
|
|
361
|
-
return node._autoprefixerDisabled;
|
|
362
372
|
}
|
|
373
|
+
if (!node.nodes || value === null) {
|
|
374
|
+
if (node.parent) {
|
|
375
|
+
var isParentDisabled = this.disabled(node.parent, result);
|
|
376
|
+
if (node.parent._autoprefixerSelfDisabled === true) {
|
|
377
|
+
value = false;
|
|
378
|
+
} else {
|
|
379
|
+
value = isParentDisabled;
|
|
380
|
+
}
|
|
381
|
+
} else {
|
|
382
|
+
value = false;
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
node._autoprefixerDisabled = value;
|
|
386
|
+
return value;
|
|
363
387
|
};
|
|
364
388
|
|
|
365
389
|
/**
|
package/package.json
CHANGED
|
@@ -1,23 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "autoprefixer",
|
|
3
|
-
"version": "8.1
|
|
3
|
+
"version": "8.4.1",
|
|
4
4
|
"description": "Parse CSS and add vendor prefixes to CSS rules using values from the Can I Use website",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"autoprefixer",
|
|
7
|
-
"css",
|
|
8
|
-
"prefix",
|
|
9
|
-
"postcss",
|
|
10
|
-
"postcss-plugin"
|
|
11
|
-
],
|
|
5
|
+
"keywords": ["autoprefixer", "css", "prefix", "postcss", "postcss-plugin"],
|
|
12
6
|
"author": "Andrey Sitnik <andrey@sitnik.ru>",
|
|
13
7
|
"license": "MIT",
|
|
14
8
|
"repository": "postcss/autoprefixer",
|
|
15
9
|
"dependencies": {
|
|
16
|
-
"browserslist": "^3.
|
|
17
|
-
"caniuse-lite": "^1.0.
|
|
10
|
+
"browserslist": "^3.2.6",
|
|
11
|
+
"caniuse-lite": "^1.0.30000832",
|
|
18
12
|
"normalize-range": "^0.1.2",
|
|
19
13
|
"num2fraction": "^1.2.2",
|
|
20
|
-
"postcss": "^6.0.
|
|
14
|
+
"postcss": "^6.0.22",
|
|
21
15
|
"postcss-value-parser": "^3.2.3"
|
|
22
16
|
},
|
|
23
17
|
"bin": {
|