autoprefixer 9.8.7 → 10.0.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 +999 -0
- package/README.md +0 -3
- package/bin/autoprefixer +11 -11
- package/data/prefixes.js +799 -545
- package/lib/at-rule.js +23 -50
- package/lib/autoprefixer.js +108 -97
- package/lib/brackets.js +31 -44
- package/lib/browsers.js +54 -71
- package/lib/declaration.js +122 -178
- package/lib/hacks/align-content.js +24 -54
- package/lib/hacks/align-items.js +23 -53
- package/lib/hacks/align-self.js +32 -60
- package/lib/hacks/animation.js +11 -29
- package/lib/hacks/appearance.js +19 -35
- package/lib/hacks/backdrop-filter.js +16 -31
- package/lib/hacks/background-clip.js +19 -36
- package/lib/hacks/background-size.js +16 -31
- package/lib/hacks/block-logical.js +28 -36
- package/lib/hacks/border-image.js +9 -27
- package/lib/hacks/border-radius.js +22 -44
- package/lib/hacks/break-props.js +38 -51
- package/lib/hacks/color-adjust.js +11 -30
- package/lib/hacks/cross-fade.js +29 -48
- package/lib/hacks/display-flex.js +32 -61
- package/lib/hacks/display-grid.js +12 -32
- package/lib/hacks/filter-value.js +8 -25
- package/lib/hacks/filter.js +13 -27
- package/lib/hacks/flex-basis.js +21 -54
- package/lib/hacks/flex-direction.js +41 -77
- package/lib/hacks/flex-flow.js +33 -61
- package/lib/hacks/flex-grow.js +16 -43
- package/lib/hacks/flex-shrink.js +21 -54
- package/lib/hacks/flex-spec.js +7 -10
- package/lib/hacks/flex-wrap.js +11 -32
- package/lib/hacks/flex.js +27 -58
- package/lib/hacks/fullscreen.js +10 -30
- package/lib/hacks/gradient.js +240 -330
- package/lib/hacks/grid-area.js +25 -43
- package/lib/hacks/grid-column-align.js +14 -34
- package/lib/hacks/grid-end.js +30 -45
- package/lib/hacks/grid-row-align.js +14 -34
- package/lib/hacks/grid-row-column.js +20 -39
- package/lib/hacks/grid-rows-columns.js +75 -99
- package/lib/hacks/grid-start.js +17 -39
- package/lib/hacks/grid-template-areas.js +59 -76
- package/lib/hacks/grid-template.js +40 -61
- package/lib/hacks/grid-utils.js +686 -716
- package/lib/hacks/image-rendering.js +24 -47
- package/lib/hacks/image-set.js +10 -30
- package/lib/hacks/inline-logical.js +26 -32
- package/lib/hacks/intrinsic.js +40 -53
- package/lib/hacks/justify-content.js +26 -57
- package/lib/hacks/mask-border.js +28 -36
- package/lib/hacks/mask-composite.js +41 -57
- package/lib/hacks/order.js +22 -52
- package/lib/hacks/overscroll-behavior.js +16 -37
- package/lib/hacks/pixelated.js +16 -40
- package/lib/hacks/place-self.js +18 -41
- package/lib/hacks/placeholder-shown.js +9 -28
- package/lib/hacks/placeholder.js +15 -38
- package/lib/hacks/text-decoration-skip-ink.js +14 -29
- package/lib/hacks/text-decoration.js +20 -31
- package/lib/hacks/text-emphasis-position.js +9 -28
- package/lib/hacks/transform-decl.js +43 -69
- package/lib/hacks/user-select.js +19 -27
- package/lib/hacks/writing-mode.js +19 -36
- package/lib/info.js +63 -93
- package/lib/old-selector.js +39 -60
- package/lib/old-value.js +17 -25
- package/lib/prefixer.js +83 -110
- package/lib/prefixes.js +233 -336
- package/lib/processor.js +420 -416
- package/lib/resolution.js +62 -98
- package/lib/selector.js +91 -139
- package/lib/supports.js +194 -246
- package/lib/transition.js +170 -265
- package/lib/utils.js +49 -72
- package/lib/value.js +77 -116
- package/lib/vendor.js +14 -0
- package/package.json +23 -12
package/lib/processor.js
CHANGED
|
@@ -1,252 +1,286 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
let parser = require('postcss-value-parser')
|
|
2
|
+
|
|
3
|
+
let Value = require('./value')
|
|
4
|
+
let insertAreas = require('./hacks/grid-utils').insertAreas
|
|
5
|
+
|
|
6
|
+
const OLD_LINEAR = /(^|[^-])linear-gradient\(\s*(top|left|right|bottom)/i
|
|
7
|
+
const OLD_RADIAL = /(^|[^-])radial-gradient\(\s*\d+(\w*|%)\s+\d+(\w*|%)\s*,/i
|
|
8
|
+
const IGNORE_NEXT = /(!\s*)?autoprefixer:\s*ignore\s+next/i
|
|
9
|
+
const GRID_REGEX = /(!\s*)?autoprefixer\s*grid:\s*(on|off|(no-)?autoplace)/i
|
|
10
|
+
|
|
11
|
+
const SIZES = [
|
|
12
|
+
'width',
|
|
13
|
+
'height',
|
|
14
|
+
'min-width',
|
|
15
|
+
'max-width',
|
|
16
|
+
'min-height',
|
|
17
|
+
'max-height',
|
|
18
|
+
'inline-size',
|
|
19
|
+
'min-inline-size',
|
|
20
|
+
'max-inline-size',
|
|
21
|
+
'block-size',
|
|
22
|
+
'min-block-size',
|
|
23
|
+
'max-block-size'
|
|
24
|
+
]
|
|
25
|
+
|
|
26
|
+
function hasGridTemplate (decl) {
|
|
27
|
+
return decl.parent.some(
|
|
28
|
+
i => i.prop === 'grid-template' || i.prop === 'grid-template-areas'
|
|
29
|
+
)
|
|
25
30
|
}
|
|
26
31
|
|
|
27
|
-
function hasRowsAndColumns(decl) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
var hasColumns = decl.parent.some(function (i) {
|
|
32
|
-
return i.prop === 'grid-template-columns';
|
|
33
|
-
});
|
|
34
|
-
return hasRows && hasColumns;
|
|
32
|
+
function hasRowsAndColumns (decl) {
|
|
33
|
+
let hasRows = decl.parent.some(i => i.prop === 'grid-template-rows')
|
|
34
|
+
let hasColumns = decl.parent.some(i => i.prop === 'grid-template-columns')
|
|
35
|
+
return hasRows && hasColumns
|
|
35
36
|
}
|
|
36
37
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
this.prefixes = prefixes
|
|
38
|
+
class Processor {
|
|
39
|
+
constructor (prefixes) {
|
|
40
|
+
this.prefixes = prefixes
|
|
40
41
|
}
|
|
42
|
+
|
|
41
43
|
/**
|
|
42
44
|
* Add necessary prefixes
|
|
43
45
|
*/
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
var _proto = Processor.prototype;
|
|
47
|
-
|
|
48
|
-
_proto.add = function add(css, result) {
|
|
49
|
-
var _this = this;
|
|
50
|
-
|
|
46
|
+
add (css, result) {
|
|
51
47
|
// At-rules
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
48
|
+
let resolution = this.prefixes.add['@resolution']
|
|
49
|
+
let keyframes = this.prefixes.add['@keyframes']
|
|
50
|
+
let viewport = this.prefixes.add['@viewport']
|
|
51
|
+
let supports = this.prefixes.add['@supports']
|
|
52
|
+
|
|
53
|
+
css.walkAtRules(rule => {
|
|
57
54
|
if (rule.name === 'keyframes') {
|
|
58
|
-
if (!
|
|
59
|
-
return keyframes && keyframes.process(rule)
|
|
55
|
+
if (!this.disabled(rule, result)) {
|
|
56
|
+
return keyframes && keyframes.process(rule)
|
|
60
57
|
}
|
|
61
58
|
} else if (rule.name === 'viewport') {
|
|
62
|
-
if (!
|
|
63
|
-
return viewport && viewport.process(rule)
|
|
59
|
+
if (!this.disabled(rule, result)) {
|
|
60
|
+
return viewport && viewport.process(rule)
|
|
64
61
|
}
|
|
65
62
|
} else if (rule.name === 'supports') {
|
|
66
|
-
if (
|
|
67
|
-
|
|
63
|
+
if (
|
|
64
|
+
this.prefixes.options.supports !== false &&
|
|
65
|
+
!this.disabled(rule, result)
|
|
66
|
+
) {
|
|
67
|
+
return supports.process(rule)
|
|
68
68
|
}
|
|
69
69
|
} else if (rule.name === 'media' && rule.params.includes('-resolution')) {
|
|
70
|
-
if (!
|
|
71
|
-
return resolution && resolution.process(rule)
|
|
70
|
+
if (!this.disabled(rule, result)) {
|
|
71
|
+
return resolution && resolution.process(rule)
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
return undefined
|
|
76
|
-
})
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
75
|
+
return undefined
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
// Selectors
|
|
79
|
+
css.walkRules(rule => {
|
|
80
|
+
if (this.disabled(rule, result)) return undefined
|
|
81
|
+
|
|
82
|
+
return this.prefixes.add.selectors.map(selector => {
|
|
83
|
+
return selector.process(rule, result)
|
|
84
|
+
})
|
|
85
|
+
})
|
|
86
|
+
|
|
87
|
+
function insideGrid (decl) {
|
|
88
|
+
return decl.parent.nodes.some(node => {
|
|
89
|
+
if (node.type !== 'decl') return false
|
|
90
|
+
let displayGrid =
|
|
91
|
+
node.prop === 'display' && /(inline-)?grid/.test(node.value)
|
|
92
|
+
let gridTemplate = node.prop.startsWith('grid-template')
|
|
93
|
+
let gridGap = /^grid-([A-z]+-)?gap/.test(node.prop)
|
|
94
|
+
return displayGrid || gridTemplate || gridGap
|
|
95
|
+
})
|
|
93
96
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
});
|
|
97
|
+
function insideFlex (decl) {
|
|
98
|
+
return decl.parent.some(node => {
|
|
99
|
+
return node.prop === 'display' && /(inline-)?flex/.test(node.value)
|
|
100
|
+
})
|
|
99
101
|
}
|
|
100
102
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
103
|
+
let gridPrefixes =
|
|
104
|
+
this.gridStatus(css, result) &&
|
|
105
|
+
this.prefixes.add['grid-area'] &&
|
|
106
|
+
this.prefixes.add['grid-area'].prefixes
|
|
107
|
+
|
|
108
|
+
css.walkDecls(decl => {
|
|
109
|
+
if (this.disabledDecl(decl, result)) return undefined
|
|
110
|
+
|
|
111
|
+
let parent = decl.parent
|
|
112
|
+
let prop = decl.prop
|
|
113
|
+
let value = decl.value
|
|
107
114
|
|
|
108
115
|
if (prop === 'grid-row-span') {
|
|
109
|
-
result.warn(
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
116
|
+
result.warn(
|
|
117
|
+
'grid-row-span is not part of final Grid Layout. Use grid-row.',
|
|
118
|
+
{ node: decl }
|
|
119
|
+
)
|
|
120
|
+
return undefined
|
|
113
121
|
} else if (prop === 'grid-column-span') {
|
|
114
|
-
result.warn(
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
122
|
+
result.warn(
|
|
123
|
+
'grid-column-span is not part of final Grid Layout. Use grid-column.',
|
|
124
|
+
{ node: decl }
|
|
125
|
+
)
|
|
126
|
+
return undefined
|
|
118
127
|
} else if (prop === 'display' && value === 'box') {
|
|
119
|
-
result.warn(
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
128
|
+
result.warn(
|
|
129
|
+
'You should write display: flex by final spec ' +
|
|
130
|
+
'instead of display: box',
|
|
131
|
+
{ node: decl }
|
|
132
|
+
)
|
|
133
|
+
return undefined
|
|
123
134
|
} else if (prop === 'text-emphasis-position') {
|
|
124
135
|
if (value === 'under' || value === 'over') {
|
|
125
|
-
result.warn(
|
|
126
|
-
|
|
127
|
-
|
|
136
|
+
result.warn(
|
|
137
|
+
'You should use 2 values for text-emphasis-position ' +
|
|
138
|
+
'For example, `under left` instead of just `under`.',
|
|
139
|
+
{ node: decl }
|
|
140
|
+
)
|
|
128
141
|
}
|
|
129
|
-
} else if (
|
|
142
|
+
} else if (
|
|
143
|
+
/^(align|justify|place)-(items|content)$/.test(prop) &&
|
|
144
|
+
insideFlex(decl)
|
|
145
|
+
) {
|
|
130
146
|
if (value === 'start' || value === 'end') {
|
|
131
|
-
result.warn(
|
|
132
|
-
|
|
133
|
-
|
|
147
|
+
result.warn(
|
|
148
|
+
`${value} value has mixed support, consider using ` +
|
|
149
|
+
`flex-${value} instead`,
|
|
150
|
+
{ node: decl }
|
|
151
|
+
)
|
|
134
152
|
}
|
|
135
153
|
} else if (prop === 'text-decoration-skip' && value === 'ink') {
|
|
136
|
-
result.warn(
|
|
137
|
-
|
|
138
|
-
|
|
154
|
+
result.warn(
|
|
155
|
+
'Replace text-decoration-skip: ink to ' +
|
|
156
|
+
'text-decoration-skip-ink: auto, because spec had been changed',
|
|
157
|
+
{ node: decl }
|
|
158
|
+
)
|
|
139
159
|
} else {
|
|
140
|
-
if (gridPrefixes &&
|
|
160
|
+
if (gridPrefixes && this.gridStatus(decl, result)) {
|
|
141
161
|
if (decl.value === 'subgrid') {
|
|
142
|
-
result.warn('IE does not support subgrid', {
|
|
143
|
-
node: decl
|
|
144
|
-
});
|
|
162
|
+
result.warn('IE does not support subgrid', { node: decl })
|
|
145
163
|
}
|
|
146
|
-
|
|
147
164
|
if (/^(align|justify|place)-items$/.test(prop) && insideGrid(decl)) {
|
|
148
|
-
|
|
149
|
-
result.warn(
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
165
|
+
let fixed = prop.replace('-items', '-self')
|
|
166
|
+
result.warn(
|
|
167
|
+
`IE does not support ${prop} on grid containers. ` +
|
|
168
|
+
`Try using ${fixed} on child elements instead: ` +
|
|
169
|
+
`${decl.parent.selector} > * { ${fixed}: ${decl.value} }`,
|
|
170
|
+
{ node: decl }
|
|
171
|
+
)
|
|
172
|
+
} else if (
|
|
173
|
+
/^(align|justify|place)-content$/.test(prop) &&
|
|
174
|
+
insideGrid(decl)
|
|
175
|
+
) {
|
|
176
|
+
result.warn(`IE does not support ${decl.prop} on grid containers`, {
|
|
154
177
|
node: decl
|
|
155
|
-
})
|
|
178
|
+
})
|
|
156
179
|
} else if (prop === 'display' && decl.value === 'contents') {
|
|
157
|
-
result.warn(
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
180
|
+
result.warn(
|
|
181
|
+
'Please do not use display: contents; ' +
|
|
182
|
+
'if you have grid setting enabled',
|
|
183
|
+
{ node: decl }
|
|
184
|
+
)
|
|
185
|
+
return undefined
|
|
161
186
|
} else if (decl.prop === 'grid-gap') {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
187
|
+
let status = this.gridStatus(decl, result)
|
|
188
|
+
if (
|
|
189
|
+
status === 'autoplace' &&
|
|
190
|
+
!hasRowsAndColumns(decl) &&
|
|
191
|
+
!hasGridTemplate(decl)
|
|
192
|
+
) {
|
|
193
|
+
result.warn(
|
|
194
|
+
'grid-gap only works if grid-template(-areas) is being ' +
|
|
195
|
+
'used or both rows and columns have been declared ' +
|
|
196
|
+
'and cells have not been manually ' +
|
|
197
|
+
'placed inside the explicit grid',
|
|
198
|
+
{ node: decl }
|
|
199
|
+
)
|
|
200
|
+
} else if (
|
|
201
|
+
(status === true || status === 'no-autoplace') &&
|
|
202
|
+
!hasGridTemplate(decl)
|
|
203
|
+
) {
|
|
204
|
+
result.warn(
|
|
205
|
+
'grid-gap only works if grid-template(-areas) is being used',
|
|
206
|
+
{ node: decl }
|
|
207
|
+
)
|
|
172
208
|
}
|
|
173
209
|
} else if (prop === 'grid-auto-columns') {
|
|
174
210
|
result.warn('grid-auto-columns is not supported by IE', {
|
|
175
211
|
node: decl
|
|
176
|
-
})
|
|
177
|
-
return undefined
|
|
212
|
+
})
|
|
213
|
+
return undefined
|
|
178
214
|
} else if (prop === 'grid-auto-rows') {
|
|
179
|
-
result.warn('grid-auto-rows is not supported by IE', {
|
|
180
|
-
|
|
181
|
-
});
|
|
182
|
-
return undefined;
|
|
215
|
+
result.warn('grid-auto-rows is not supported by IE', { node: decl })
|
|
216
|
+
return undefined
|
|
183
217
|
} else if (prop === 'grid-auto-flow') {
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
});
|
|
187
|
-
var hasCols = parent.some(function (i) {
|
|
188
|
-
return i.prop === 'grid-template-columns';
|
|
189
|
-
});
|
|
218
|
+
let hasRows = parent.some(i => i.prop === 'grid-template-rows')
|
|
219
|
+
let hasCols = parent.some(i => i.prop === 'grid-template-columns')
|
|
190
220
|
|
|
191
221
|
if (hasGridTemplate(decl)) {
|
|
192
222
|
result.warn('grid-auto-flow is not supported by IE', {
|
|
193
223
|
node: decl
|
|
194
|
-
})
|
|
224
|
+
})
|
|
195
225
|
} else if (value.includes('dense')) {
|
|
196
226
|
result.warn('grid-auto-flow: dense is not supported by IE', {
|
|
197
227
|
node: decl
|
|
198
|
-
})
|
|
228
|
+
})
|
|
199
229
|
} else if (!hasRows && !hasCols) {
|
|
200
|
-
result.warn(
|
|
201
|
-
|
|
202
|
-
|
|
230
|
+
result.warn(
|
|
231
|
+
'grid-auto-flow works only if grid-template-rows and ' +
|
|
232
|
+
'grid-template-columns are present in the same rule',
|
|
233
|
+
{ node: decl }
|
|
234
|
+
)
|
|
203
235
|
}
|
|
204
|
-
|
|
205
|
-
return undefined;
|
|
236
|
+
return undefined
|
|
206
237
|
} else if (value.includes('auto-fit')) {
|
|
207
238
|
result.warn('auto-fit value is not supported by IE', {
|
|
208
239
|
node: decl,
|
|
209
240
|
word: 'auto-fit'
|
|
210
|
-
})
|
|
211
|
-
return undefined
|
|
241
|
+
})
|
|
242
|
+
return undefined
|
|
212
243
|
} else if (value.includes('auto-fill')) {
|
|
213
244
|
result.warn('auto-fill value is not supported by IE', {
|
|
214
245
|
node: decl,
|
|
215
246
|
word: 'auto-fill'
|
|
216
|
-
})
|
|
217
|
-
return undefined
|
|
247
|
+
})
|
|
248
|
+
return undefined
|
|
218
249
|
} else if (prop.startsWith('grid-template') && value.includes('[')) {
|
|
219
|
-
result.warn(
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
250
|
+
result.warn(
|
|
251
|
+
'Autoprefixer currently does not support line names. ' +
|
|
252
|
+
'Try using grid-template-areas instead.',
|
|
253
|
+
{ node: decl, word: '[' }
|
|
254
|
+
)
|
|
223
255
|
}
|
|
224
256
|
}
|
|
225
|
-
|
|
226
257
|
if (value.includes('radial-gradient')) {
|
|
227
258
|
if (OLD_RADIAL.test(decl.value)) {
|
|
228
|
-
result.warn(
|
|
229
|
-
|
|
230
|
-
|
|
259
|
+
result.warn(
|
|
260
|
+
'Gradient has outdated direction syntax. ' +
|
|
261
|
+
'New syntax is like `closest-side at 0 0` ' +
|
|
262
|
+
'instead of `0 0, closest-side`.',
|
|
263
|
+
{ node: decl }
|
|
264
|
+
)
|
|
231
265
|
} else {
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
for (var _iterator = _createForOfIteratorHelperLoose(ast.nodes), _step; !(_step = _iterator()).done;) {
|
|
235
|
-
var i = _step.value;
|
|
266
|
+
let ast = parser(value)
|
|
236
267
|
|
|
268
|
+
for (let i of ast.nodes) {
|
|
237
269
|
if (i.type === 'function' && i.value === 'radial-gradient') {
|
|
238
|
-
for (
|
|
239
|
-
var word = _step2.value;
|
|
240
|
-
|
|
270
|
+
for (let word of i.nodes) {
|
|
241
271
|
if (word.type === 'word') {
|
|
242
272
|
if (word.value === 'cover') {
|
|
243
|
-
result.warn(
|
|
244
|
-
|
|
245
|
-
|
|
273
|
+
result.warn(
|
|
274
|
+
'Gradient has outdated direction syntax. ' +
|
|
275
|
+
'Replace `cover` to `farthest-corner`.',
|
|
276
|
+
{ node: decl }
|
|
277
|
+
)
|
|
246
278
|
} else if (word.value === 'contain') {
|
|
247
|
-
result.warn(
|
|
248
|
-
|
|
249
|
-
|
|
279
|
+
result.warn(
|
|
280
|
+
'Gradient has outdated direction syntax. ' +
|
|
281
|
+
'Replace `contain` to `closest-side`.',
|
|
282
|
+
{ node: decl }
|
|
283
|
+
)
|
|
250
284
|
}
|
|
251
285
|
}
|
|
252
286
|
}
|
|
@@ -254,12 +288,13 @@ var Processor = /*#__PURE__*/function () {
|
|
|
254
288
|
}
|
|
255
289
|
}
|
|
256
290
|
}
|
|
257
|
-
|
|
258
291
|
if (value.includes('linear-gradient')) {
|
|
259
292
|
if (OLD_LINEAR.test(value)) {
|
|
260
|
-
result.warn(
|
|
261
|
-
|
|
262
|
-
|
|
293
|
+
result.warn(
|
|
294
|
+
'Gradient has outdated direction syntax. ' +
|
|
295
|
+
'New syntax is like `to left` instead of `right`.',
|
|
296
|
+
{ node: decl }
|
|
297
|
+
)
|
|
263
298
|
}
|
|
264
299
|
}
|
|
265
300
|
}
|
|
@@ -267,437 +302,406 @@ var Processor = /*#__PURE__*/function () {
|
|
|
267
302
|
if (SIZES.includes(decl.prop)) {
|
|
268
303
|
if (!decl.value.includes('-fill-available')) {
|
|
269
304
|
if (decl.value.includes('fill-available')) {
|
|
270
|
-
result.warn(
|
|
271
|
-
|
|
272
|
-
|
|
305
|
+
result.warn(
|
|
306
|
+
'Replace fill-available to stretch, ' +
|
|
307
|
+
'because spec had been changed',
|
|
308
|
+
{ node: decl }
|
|
309
|
+
)
|
|
273
310
|
} else if (decl.value.includes('fill')) {
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
node: decl
|
|
281
|
-
});
|
|
311
|
+
let ast = parser(value)
|
|
312
|
+
if (ast.nodes.some(i => i.type === 'word' && i.value === 'fill')) {
|
|
313
|
+
result.warn(
|
|
314
|
+
'Replace fill to stretch, because spec had been changed',
|
|
315
|
+
{ node: decl }
|
|
316
|
+
)
|
|
282
317
|
}
|
|
283
318
|
}
|
|
284
319
|
}
|
|
285
320
|
}
|
|
286
321
|
|
|
287
|
-
|
|
322
|
+
let prefixer
|
|
288
323
|
|
|
289
324
|
if (decl.prop === 'transition' || decl.prop === 'transition-property') {
|
|
290
325
|
// Transition
|
|
291
|
-
return
|
|
326
|
+
return this.prefixes.transition.add(decl, result)
|
|
292
327
|
} else if (decl.prop === 'align-self') {
|
|
293
328
|
// align-self flexbox or grid
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
prefixer = _this.prefixes.add['align-self'];
|
|
298
|
-
|
|
329
|
+
let display = this.displayType(decl)
|
|
330
|
+
if (display !== 'grid' && this.prefixes.options.flexbox !== false) {
|
|
331
|
+
prefixer = this.prefixes.add['align-self']
|
|
299
332
|
if (prefixer && prefixer.prefixes) {
|
|
300
|
-
prefixer.process(decl)
|
|
333
|
+
prefixer.process(decl)
|
|
301
334
|
}
|
|
302
335
|
}
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
prefixer = _this.prefixes.add['grid-row-align'];
|
|
306
|
-
|
|
336
|
+
if (this.gridStatus(decl, result) !== false) {
|
|
337
|
+
prefixer = this.prefixes.add['grid-row-align']
|
|
307
338
|
if (prefixer && prefixer.prefixes) {
|
|
308
|
-
return prefixer.process(decl, result)
|
|
339
|
+
return prefixer.process(decl, result)
|
|
309
340
|
}
|
|
310
341
|
}
|
|
311
342
|
} else if (decl.prop === 'justify-self') {
|
|
312
343
|
// justify-self flexbox or grid
|
|
313
|
-
if (
|
|
314
|
-
prefixer =
|
|
315
|
-
|
|
344
|
+
if (this.gridStatus(decl, result) !== false) {
|
|
345
|
+
prefixer = this.prefixes.add['grid-column-align']
|
|
316
346
|
if (prefixer && prefixer.prefixes) {
|
|
317
|
-
return prefixer.process(decl, result)
|
|
347
|
+
return prefixer.process(decl, result)
|
|
318
348
|
}
|
|
319
349
|
}
|
|
320
350
|
} else if (decl.prop === 'place-self') {
|
|
321
|
-
prefixer =
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
351
|
+
prefixer = this.prefixes.add['place-self']
|
|
352
|
+
if (
|
|
353
|
+
prefixer &&
|
|
354
|
+
prefixer.prefixes &&
|
|
355
|
+
this.gridStatus(decl, result) !== false
|
|
356
|
+
) {
|
|
357
|
+
return prefixer.process(decl, result)
|
|
325
358
|
}
|
|
326
359
|
} else {
|
|
327
360
|
// Properties
|
|
328
|
-
prefixer =
|
|
329
|
-
|
|
361
|
+
prefixer = this.prefixes.add[decl.prop]
|
|
330
362
|
if (prefixer && prefixer.prefixes) {
|
|
331
|
-
return prefixer.process(decl, result)
|
|
363
|
+
return prefixer.process(decl, result)
|
|
332
364
|
}
|
|
333
365
|
}
|
|
334
366
|
|
|
335
|
-
return undefined
|
|
336
|
-
})
|
|
337
|
-
// rules as a data and hack API is not enough for this
|
|
367
|
+
return undefined
|
|
368
|
+
})
|
|
338
369
|
|
|
370
|
+
// Insert grid-area prefixes. We need to be able to store the different
|
|
371
|
+
// rules as a data and hack API is not enough for this
|
|
339
372
|
if (this.gridStatus(css, result)) {
|
|
340
|
-
insertAreas(css, this.disabled)
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
return css.walkDecls(function (decl) {
|
|
345
|
-
if (_this.disabledValue(decl, result)) return;
|
|
346
|
-
|
|
347
|
-
var unprefixed = _this.prefixes.unprefixed(decl.prop);
|
|
373
|
+
insertAreas(css, this.disabled)
|
|
374
|
+
}
|
|
348
375
|
|
|
349
|
-
|
|
376
|
+
// Values
|
|
377
|
+
return css.walkDecls(decl => {
|
|
378
|
+
if (this.disabledValue(decl, result)) return
|
|
350
379
|
|
|
380
|
+
let unprefixed = this.prefixes.unprefixed(decl.prop)
|
|
381
|
+
let list = this.prefixes.values('add', unprefixed)
|
|
351
382
|
if (Array.isArray(list)) {
|
|
352
|
-
for (
|
|
353
|
-
|
|
354
|
-
if (value.process) value.process(decl, result);
|
|
383
|
+
for (let value of list) {
|
|
384
|
+
if (value.process) value.process(decl, result)
|
|
355
385
|
}
|
|
356
386
|
}
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
});
|
|
387
|
+
Value.save(this.prefixes, decl)
|
|
388
|
+
})
|
|
360
389
|
}
|
|
390
|
+
|
|
361
391
|
/**
|
|
362
392
|
* Remove unnecessary pefixes
|
|
363
393
|
*/
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
_proto.remove = function remove(css, result) {
|
|
367
|
-
var _this2 = this;
|
|
368
|
-
|
|
394
|
+
remove (css, result) {
|
|
369
395
|
// At-rules
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
396
|
+
let resolution = this.prefixes.remove['@resolution']
|
|
397
|
+
|
|
398
|
+
css.walkAtRules((rule, i) => {
|
|
399
|
+
if (this.prefixes.remove[`@${rule.name}`]) {
|
|
400
|
+
if (!this.disabled(rule, result)) {
|
|
401
|
+
rule.parent.removeChild(i)
|
|
375
402
|
}
|
|
376
|
-
} else if (
|
|
377
|
-
|
|
403
|
+
} else if (
|
|
404
|
+
rule.name === 'media' &&
|
|
405
|
+
rule.params.includes('-resolution') &&
|
|
406
|
+
resolution
|
|
407
|
+
) {
|
|
408
|
+
resolution.clean(rule)
|
|
378
409
|
}
|
|
379
|
-
})
|
|
410
|
+
})
|
|
380
411
|
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
css.walkRules(
|
|
412
|
+
// Selectors
|
|
413
|
+
for (let checker of this.prefixes.remove.selectors) {
|
|
414
|
+
css.walkRules((rule, i) => {
|
|
384
415
|
if (checker.check(rule)) {
|
|
385
|
-
if (!
|
|
386
|
-
rule.parent.removeChild(i)
|
|
416
|
+
if (!this.disabled(rule, result)) {
|
|
417
|
+
rule.parent.removeChild(i)
|
|
387
418
|
}
|
|
388
419
|
}
|
|
389
|
-
})
|
|
390
|
-
};
|
|
391
|
-
|
|
392
|
-
for (var _iterator4 = _createForOfIteratorHelperLoose(this.prefixes.remove.selectors), _step4; !(_step4 = _iterator4()).done;) {
|
|
393
|
-
_loop();
|
|
420
|
+
})
|
|
394
421
|
}
|
|
395
422
|
|
|
396
|
-
return css.walkDecls(
|
|
397
|
-
if (
|
|
398
|
-
var rule = decl.parent;
|
|
399
|
-
|
|
400
|
-
var unprefixed = _this2.prefixes.unprefixed(decl.prop); // Transition
|
|
423
|
+
return css.walkDecls((decl, i) => {
|
|
424
|
+
if (this.disabled(decl, result)) return
|
|
401
425
|
|
|
426
|
+
let rule = decl.parent
|
|
427
|
+
let unprefixed = this.prefixes.unprefixed(decl.prop)
|
|
402
428
|
|
|
429
|
+
// Transition
|
|
403
430
|
if (decl.prop === 'transition' || decl.prop === 'transition-property') {
|
|
404
|
-
|
|
405
|
-
}
|
|
406
|
-
|
|
431
|
+
this.prefixes.transition.remove(decl)
|
|
432
|
+
}
|
|
407
433
|
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
434
|
+
// Properties
|
|
435
|
+
if (
|
|
436
|
+
this.prefixes.remove[decl.prop] &&
|
|
437
|
+
this.prefixes.remove[decl.prop].remove
|
|
438
|
+
) {
|
|
439
|
+
let notHack = this.prefixes.group(decl).down(other => {
|
|
440
|
+
return this.prefixes.normalize(other.prop) === unprefixed
|
|
441
|
+
})
|
|
412
442
|
|
|
413
443
|
if (unprefixed === 'flex-flow') {
|
|
414
|
-
notHack = true
|
|
444
|
+
notHack = true
|
|
415
445
|
}
|
|
416
446
|
|
|
417
447
|
if (decl.prop === '-webkit-box-orient') {
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
'flex-flow': true
|
|
421
|
-
};
|
|
422
|
-
if (!decl.parent.some(function (j) {
|
|
423
|
-
return hacks[j.prop];
|
|
424
|
-
})) return;
|
|
448
|
+
let hacks = { 'flex-direction': true, 'flex-flow': true }
|
|
449
|
+
if (!decl.parent.some(j => hacks[j.prop])) return
|
|
425
450
|
}
|
|
426
451
|
|
|
427
|
-
if (notHack && !
|
|
452
|
+
if (notHack && !this.withHackValue(decl)) {
|
|
428
453
|
if (decl.raw('before').includes('\n')) {
|
|
429
|
-
|
|
454
|
+
this.reduceSpaces(decl)
|
|
430
455
|
}
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
return;
|
|
456
|
+
rule.removeChild(i)
|
|
457
|
+
return
|
|
434
458
|
}
|
|
435
|
-
}
|
|
436
|
-
|
|
459
|
+
}
|
|
437
460
|
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
if (!checker.check) continue
|
|
441
|
-
if (!checker.check(decl.value)) continue
|
|
442
|
-
unprefixed = checker.unprefixed;
|
|
461
|
+
// Values
|
|
462
|
+
for (let checker of this.prefixes.values('remove', unprefixed)) {
|
|
463
|
+
if (!checker.check) continue
|
|
464
|
+
if (!checker.check(decl.value)) continue
|
|
443
465
|
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
466
|
+
unprefixed = checker.unprefixed
|
|
467
|
+
let notHack = this.prefixes.group(decl).down(other => {
|
|
468
|
+
return other.value.includes(unprefixed)
|
|
469
|
+
})
|
|
447
470
|
|
|
448
|
-
if (
|
|
449
|
-
rule.removeChild(i)
|
|
450
|
-
return
|
|
471
|
+
if (notHack) {
|
|
472
|
+
rule.removeChild(i)
|
|
473
|
+
return
|
|
451
474
|
}
|
|
452
475
|
}
|
|
453
|
-
})
|
|
476
|
+
})
|
|
454
477
|
}
|
|
478
|
+
|
|
455
479
|
/**
|
|
456
480
|
* Some rare old values, which is not in standard
|
|
457
481
|
*/
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
_proto.withHackValue = function withHackValue(decl) {
|
|
461
|
-
return decl.prop === '-webkit-background-clip' && decl.value === 'text';
|
|
482
|
+
withHackValue (decl) {
|
|
483
|
+
return decl.prop === '-webkit-background-clip' && decl.value === 'text'
|
|
462
484
|
}
|
|
485
|
+
|
|
463
486
|
/**
|
|
464
487
|
* Check for grid/flexbox options.
|
|
465
488
|
*/
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
_proto.disabledValue = function disabledValue(node, result) {
|
|
489
|
+
disabledValue (node, result) {
|
|
469
490
|
if (this.gridStatus(node, result) === false && node.type === 'decl') {
|
|
470
491
|
if (node.prop === 'display' && node.value.includes('grid')) {
|
|
471
|
-
return true
|
|
492
|
+
return true
|
|
472
493
|
}
|
|
473
494
|
}
|
|
474
|
-
|
|
475
495
|
if (this.prefixes.options.flexbox === false && node.type === 'decl') {
|
|
476
496
|
if (node.prop === 'display' && node.value.includes('flex')) {
|
|
477
|
-
return true
|
|
497
|
+
return true
|
|
478
498
|
}
|
|
479
499
|
}
|
|
480
500
|
|
|
481
|
-
return this.disabled(node, result)
|
|
501
|
+
return this.disabled(node, result)
|
|
482
502
|
}
|
|
503
|
+
|
|
483
504
|
/**
|
|
484
505
|
* Check for grid/flexbox options.
|
|
485
506
|
*/
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
_proto.disabledDecl = function disabledDecl(node, result) {
|
|
507
|
+
disabledDecl (node, result) {
|
|
489
508
|
if (this.gridStatus(node, result) === false && node.type === 'decl') {
|
|
490
509
|
if (node.prop.includes('grid') || node.prop === 'justify-items') {
|
|
491
|
-
return true
|
|
510
|
+
return true
|
|
492
511
|
}
|
|
493
512
|
}
|
|
494
|
-
|
|
495
513
|
if (this.prefixes.options.flexbox === false && node.type === 'decl') {
|
|
496
|
-
|
|
497
|
-
|
|
514
|
+
let other = ['order', 'justify-content', 'align-items', 'align-content']
|
|
498
515
|
if (node.prop.includes('flex') || other.includes(node.prop)) {
|
|
499
|
-
return true
|
|
516
|
+
return true
|
|
500
517
|
}
|
|
501
518
|
}
|
|
502
519
|
|
|
503
|
-
return this.disabled(node, result)
|
|
520
|
+
return this.disabled(node, result)
|
|
504
521
|
}
|
|
522
|
+
|
|
505
523
|
/**
|
|
506
524
|
* Check for control comment and global options
|
|
507
525
|
*/
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
_proto.disabled = function disabled(node, result) {
|
|
511
|
-
if (!node) return false;
|
|
526
|
+
disabled (node, result) {
|
|
527
|
+
if (!node) return false
|
|
512
528
|
|
|
513
529
|
if (node._autoprefixerDisabled !== undefined) {
|
|
514
|
-
return node._autoprefixerDisabled
|
|
530
|
+
return node._autoprefixerDisabled
|
|
515
531
|
}
|
|
516
532
|
|
|
517
533
|
if (node.parent) {
|
|
518
|
-
|
|
519
|
-
|
|
534
|
+
let p = node.prev()
|
|
520
535
|
if (p && p.type === 'comment' && IGNORE_NEXT.test(p.text)) {
|
|
521
|
-
node._autoprefixerDisabled = true
|
|
522
|
-
node._autoprefixerSelfDisabled = true
|
|
523
|
-
return true
|
|
536
|
+
node._autoprefixerDisabled = true
|
|
537
|
+
node._autoprefixerSelfDisabled = true
|
|
538
|
+
return true
|
|
524
539
|
}
|
|
525
540
|
}
|
|
526
541
|
|
|
527
|
-
|
|
528
|
-
|
|
542
|
+
let value = null
|
|
529
543
|
if (node.nodes) {
|
|
530
|
-
|
|
531
|
-
node.each(
|
|
532
|
-
if (i.type !== 'comment') return
|
|
533
|
-
|
|
544
|
+
let status
|
|
545
|
+
node.each(i => {
|
|
546
|
+
if (i.type !== 'comment') return
|
|
534
547
|
if (/(!\s*)?autoprefixer:\s*(off|on)/i.test(i.text)) {
|
|
535
548
|
if (typeof status !== 'undefined') {
|
|
536
|
-
result.warn(
|
|
537
|
-
|
|
538
|
-
|
|
549
|
+
result.warn(
|
|
550
|
+
'Second Autoprefixer control comment ' +
|
|
551
|
+
'was ignored. Autoprefixer applies control ' +
|
|
552
|
+
'comment to whole block, not to next rules.',
|
|
553
|
+
{ node: i }
|
|
554
|
+
)
|
|
539
555
|
} else {
|
|
540
|
-
status = /on/i.test(i.text)
|
|
556
|
+
status = /on/i.test(i.text)
|
|
541
557
|
}
|
|
542
558
|
}
|
|
543
|
-
})
|
|
559
|
+
})
|
|
544
560
|
|
|
545
561
|
if (status !== undefined) {
|
|
546
|
-
value = !status
|
|
562
|
+
value = !status
|
|
547
563
|
}
|
|
548
564
|
}
|
|
549
|
-
|
|
550
565
|
if (!node.nodes || value === null) {
|
|
551
566
|
if (node.parent) {
|
|
552
|
-
|
|
553
|
-
|
|
567
|
+
let isParentDisabled = this.disabled(node.parent, result)
|
|
554
568
|
if (node.parent._autoprefixerSelfDisabled === true) {
|
|
555
|
-
value = false
|
|
569
|
+
value = false
|
|
556
570
|
} else {
|
|
557
|
-
value = isParentDisabled
|
|
571
|
+
value = isParentDisabled
|
|
558
572
|
}
|
|
559
573
|
} else {
|
|
560
|
-
value = false
|
|
574
|
+
value = false
|
|
561
575
|
}
|
|
562
576
|
}
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
return value;
|
|
577
|
+
node._autoprefixerDisabled = value
|
|
578
|
+
return value
|
|
566
579
|
}
|
|
580
|
+
|
|
567
581
|
/**
|
|
568
582
|
* Normalize spaces in cascade declaration group
|
|
569
583
|
*/
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
return true;
|
|
577
|
-
});
|
|
578
|
-
|
|
584
|
+
reduceSpaces (decl) {
|
|
585
|
+
let stop = false
|
|
586
|
+
this.prefixes.group(decl).up(() => {
|
|
587
|
+
stop = true
|
|
588
|
+
return true
|
|
589
|
+
})
|
|
579
590
|
if (stop) {
|
|
580
|
-
return
|
|
591
|
+
return
|
|
581
592
|
}
|
|
582
593
|
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
594
|
+
let parts = decl.raw('before').split('\n')
|
|
595
|
+
let prevMin = parts[parts.length - 1].length
|
|
596
|
+
let diff = false
|
|
597
|
+
|
|
598
|
+
this.prefixes.group(decl).down(other => {
|
|
599
|
+
parts = other.raw('before').split('\n')
|
|
600
|
+
let last = parts.length - 1
|
|
589
601
|
|
|
590
602
|
if (parts[last].length > prevMin) {
|
|
591
603
|
if (diff === false) {
|
|
592
|
-
diff = parts[last].length - prevMin
|
|
604
|
+
diff = parts[last].length - prevMin
|
|
593
605
|
}
|
|
594
606
|
|
|
595
|
-
parts[last] = parts[last].slice(0, -diff)
|
|
596
|
-
other.raws.before = parts.join('\n')
|
|
607
|
+
parts[last] = parts[last].slice(0, -diff)
|
|
608
|
+
other.raws.before = parts.join('\n')
|
|
597
609
|
}
|
|
598
|
-
})
|
|
610
|
+
})
|
|
599
611
|
}
|
|
612
|
+
|
|
600
613
|
/**
|
|
601
614
|
* Is it flebox or grid rule
|
|
602
615
|
*/
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
_proto.displayType = function displayType(decl) {
|
|
606
|
-
for (var _iterator6 = _createForOfIteratorHelperLoose(decl.parent.nodes), _step6; !(_step6 = _iterator6()).done;) {
|
|
607
|
-
var i = _step6.value;
|
|
608
|
-
|
|
616
|
+
displayType (decl) {
|
|
617
|
+
for (let i of decl.parent.nodes) {
|
|
609
618
|
if (i.prop !== 'display') {
|
|
610
|
-
continue
|
|
619
|
+
continue
|
|
611
620
|
}
|
|
612
621
|
|
|
613
622
|
if (i.value.includes('flex')) {
|
|
614
|
-
return 'flex'
|
|
623
|
+
return 'flex'
|
|
615
624
|
}
|
|
616
625
|
|
|
617
626
|
if (i.value.includes('grid')) {
|
|
618
|
-
return 'grid'
|
|
627
|
+
return 'grid'
|
|
619
628
|
}
|
|
620
629
|
}
|
|
621
630
|
|
|
622
|
-
return false
|
|
631
|
+
return false
|
|
623
632
|
}
|
|
633
|
+
|
|
624
634
|
/**
|
|
625
635
|
* Set grid option via control comment
|
|
626
636
|
*/
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
_proto.gridStatus = function gridStatus(node, result) {
|
|
630
|
-
if (!node) return false;
|
|
637
|
+
gridStatus (node, result) {
|
|
638
|
+
if (!node) return false
|
|
631
639
|
|
|
632
640
|
if (node._autoprefixerGridStatus !== undefined) {
|
|
633
|
-
return node._autoprefixerGridStatus
|
|
641
|
+
return node._autoprefixerGridStatus
|
|
634
642
|
}
|
|
635
643
|
|
|
636
|
-
|
|
637
|
-
|
|
644
|
+
let value = null
|
|
638
645
|
if (node.nodes) {
|
|
639
|
-
|
|
640
|
-
node.each(
|
|
641
|
-
if (i.type !== 'comment') return
|
|
642
|
-
|
|
646
|
+
let status
|
|
647
|
+
node.each(i => {
|
|
648
|
+
if (i.type !== 'comment') return
|
|
643
649
|
if (GRID_REGEX.test(i.text)) {
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
650
|
+
let hasAutoplace = /:\s*autoplace/i.test(i.text)
|
|
651
|
+
let noAutoplace = /no-autoplace/i.test(i.text)
|
|
647
652
|
if (typeof status !== 'undefined') {
|
|
648
|
-
result.warn(
|
|
649
|
-
|
|
650
|
-
|
|
653
|
+
result.warn(
|
|
654
|
+
'Second Autoprefixer grid control comment was ' +
|
|
655
|
+
'ignored. Autoprefixer applies control comments to the whole ' +
|
|
656
|
+
'block, not to the next rules.',
|
|
657
|
+
{ node: i }
|
|
658
|
+
)
|
|
651
659
|
} else if (hasAutoplace) {
|
|
652
|
-
status = 'autoplace'
|
|
660
|
+
status = 'autoplace'
|
|
653
661
|
} else if (noAutoplace) {
|
|
654
|
-
status = true
|
|
662
|
+
status = true
|
|
655
663
|
} else {
|
|
656
|
-
status = /on/i.test(i.text)
|
|
664
|
+
status = /on/i.test(i.text)
|
|
657
665
|
}
|
|
658
666
|
}
|
|
659
|
-
})
|
|
667
|
+
})
|
|
660
668
|
|
|
661
669
|
if (status !== undefined) {
|
|
662
|
-
value = status
|
|
670
|
+
value = status
|
|
663
671
|
}
|
|
664
672
|
}
|
|
665
673
|
|
|
666
674
|
if (node.type === 'atrule' && node.name === 'supports') {
|
|
667
|
-
|
|
668
|
-
|
|
675
|
+
let params = node.params
|
|
669
676
|
if (params.includes('grid') && params.includes('auto')) {
|
|
670
|
-
value = false
|
|
677
|
+
value = false
|
|
671
678
|
}
|
|
672
679
|
}
|
|
673
680
|
|
|
674
681
|
if (!node.nodes || value === null) {
|
|
675
682
|
if (node.parent) {
|
|
676
|
-
|
|
677
|
-
|
|
683
|
+
let isParentGrid = this.gridStatus(node.parent, result)
|
|
678
684
|
if (node.parent._autoprefixerSelfDisabled === true) {
|
|
679
|
-
value = false
|
|
685
|
+
value = false
|
|
680
686
|
} else {
|
|
681
|
-
value = isParentGrid
|
|
687
|
+
value = isParentGrid
|
|
682
688
|
}
|
|
683
689
|
} else if (typeof this.prefixes.options.grid !== 'undefined') {
|
|
684
|
-
value = this.prefixes.options.grid
|
|
690
|
+
value = this.prefixes.options.grid
|
|
685
691
|
} else if (typeof process.env.AUTOPREFIXER_GRID !== 'undefined') {
|
|
686
692
|
if (process.env.AUTOPREFIXER_GRID === 'autoplace') {
|
|
687
|
-
value = 'autoplace'
|
|
693
|
+
value = 'autoplace'
|
|
688
694
|
} else {
|
|
689
|
-
value = true
|
|
695
|
+
value = true
|
|
690
696
|
}
|
|
691
697
|
} else {
|
|
692
|
-
value = false
|
|
698
|
+
value = false
|
|
693
699
|
}
|
|
694
700
|
}
|
|
695
701
|
|
|
696
|
-
node._autoprefixerGridStatus = value
|
|
697
|
-
return value
|
|
698
|
-
}
|
|
699
|
-
|
|
700
|
-
return Processor;
|
|
701
|
-
}();
|
|
702
|
+
node._autoprefixerGridStatus = value
|
|
703
|
+
return value
|
|
704
|
+
}
|
|
705
|
+
}
|
|
702
706
|
|
|
703
|
-
module.exports = Processor
|
|
707
|
+
module.exports = Processor
|