autoprefixer 10.2.4 → 10.3.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.
Files changed (80) hide show
  1. package/README.md +4 -5
  2. package/data/prefixes.js +206 -91
  3. package/lib/at-rule.js +2 -2
  4. package/lib/autoprefixer.d.ts +3 -3
  5. package/lib/autoprefixer.js +28 -18
  6. package/lib/brackets.js +3 -3
  7. package/lib/browsers.js +6 -6
  8. package/lib/declaration.js +14 -14
  9. package/lib/hacks/align-content.js +3 -3
  10. package/lib/hacks/align-items.js +3 -3
  11. package/lib/hacks/align-self.js +4 -4
  12. package/lib/hacks/animation.js +1 -1
  13. package/lib/hacks/appearance.js +1 -1
  14. package/lib/hacks/backdrop-filter.js +1 -1
  15. package/lib/hacks/background-clip.js +2 -2
  16. package/lib/hacks/background-size.js +1 -1
  17. package/lib/hacks/block-logical.js +2 -2
  18. package/lib/hacks/border-image.js +1 -1
  19. package/lib/hacks/border-radius.js +2 -2
  20. package/lib/hacks/break-props.js +4 -4
  21. package/lib/hacks/color-adjust.js +2 -2
  22. package/lib/hacks/cross-fade.js +1 -1
  23. package/lib/hacks/display-flex.js +5 -5
  24. package/lib/hacks/display-grid.js +2 -2
  25. package/lib/hacks/file-selector-button.js +17 -0
  26. package/lib/hacks/filter-value.js +1 -1
  27. package/lib/hacks/filter.js +1 -1
  28. package/lib/hacks/flex-basis.js +3 -3
  29. package/lib/hacks/flex-direction.js +3 -3
  30. package/lib/hacks/flex-flow.js +1 -1
  31. package/lib/hacks/flex-grow.js +2 -2
  32. package/lib/hacks/flex-shrink.js +3 -3
  33. package/lib/hacks/flex-wrap.js +1 -1
  34. package/lib/hacks/flex.js +3 -3
  35. package/lib/hacks/fullscreen.js +1 -1
  36. package/lib/hacks/gradient.js +18 -18
  37. package/lib/hacks/grid-area.js +1 -1
  38. package/lib/hacks/grid-column-align.js +3 -3
  39. package/lib/hacks/grid-end.js +1 -1
  40. package/lib/hacks/grid-row-align.js +3 -3
  41. package/lib/hacks/grid-row-column.js +1 -1
  42. package/lib/hacks/grid-rows-columns.js +3 -3
  43. package/lib/hacks/grid-start.js +3 -3
  44. package/lib/hacks/grid-template-areas.js +2 -2
  45. package/lib/hacks/grid-template.js +1 -1
  46. package/lib/hacks/grid-utils.js +60 -48
  47. package/lib/hacks/image-rendering.js +5 -5
  48. package/lib/hacks/image-set.js +1 -1
  49. package/lib/hacks/inline-logical.js +2 -2
  50. package/lib/hacks/intrinsic.js +6 -6
  51. package/lib/hacks/justify-content.js +3 -3
  52. package/lib/hacks/mask-border.js +2 -2
  53. package/lib/hacks/mask-composite.js +1 -1
  54. package/lib/hacks/order.js +3 -3
  55. package/lib/hacks/overscroll-behavior.js +3 -3
  56. package/lib/hacks/pixelated.js +2 -2
  57. package/lib/hacks/place-self.js +1 -1
  58. package/lib/hacks/placeholder-shown.js +1 -1
  59. package/lib/hacks/placeholder.js +2 -2
  60. package/lib/hacks/text-decoration-skip-ink.js +1 -1
  61. package/lib/hacks/text-decoration.js +1 -1
  62. package/lib/hacks/text-emphasis-position.js +1 -1
  63. package/lib/hacks/transform-decl.js +4 -4
  64. package/lib/hacks/user-select.js +2 -2
  65. package/lib/hacks/writing-mode.js +1 -1
  66. package/lib/info.js +2 -2
  67. package/lib/old-selector.js +3 -3
  68. package/lib/old-value.js +2 -2
  69. package/lib/prefixer.js +8 -8
  70. package/lib/prefixes.js +126 -68
  71. package/lib/processor.js +17 -14
  72. package/lib/resolution.js +6 -6
  73. package/lib/selector.js +10 -10
  74. package/lib/supports.js +28 -20
  75. package/lib/transition.js +15 -15
  76. package/lib/utils.js +65 -67
  77. package/lib/value.js +7 -7
  78. package/lib/vendor.js +2 -2
  79. package/package.json +5 -5
  80. package/CHANGELOG.md +0 -1025
package/lib/info.js CHANGED
@@ -1,6 +1,6 @@
1
1
  let browserslist = require('browserslist')
2
2
 
3
- function capitalize (str) {
3
+ function capitalize(str) {
4
4
  return str.slice(0, 1).toUpperCase() + str.slice(1)
5
5
  }
6
6
 
@@ -19,7 +19,7 @@ const NAMES = {
19
19
  samsung: 'Samsung Internet'
20
20
  }
21
21
 
22
- function prefix (name, prefixes, note) {
22
+ function prefix(name, prefixes, note) {
23
23
  let out = ` ${name}`
24
24
  if (note) out += ' *'
25
25
  out += ': '
@@ -1,5 +1,5 @@
1
1
  class OldSelector {
2
- constructor (selector, prefix) {
2
+ constructor(selector, prefix) {
3
3
  this.prefix = prefix
4
4
  this.prefixed = selector.prefixed(this.prefix)
5
5
  this.regexp = selector.regexp(this.prefix)
@@ -15,7 +15,7 @@ class OldSelector {
15
15
  /**
16
16
  * Is rule a hack without unprefixed version bottom
17
17
  */
18
- isHack (rule) {
18
+ isHack(rule) {
19
19
  let index = rule.parent.index(rule) + 1
20
20
  let rules = rule.parent.nodes
21
21
 
@@ -50,7 +50,7 @@ class OldSelector {
50
50
  /**
51
51
  * Does rule contain an unnecessary prefixed selector
52
52
  */
53
- check (rule) {
53
+ check(rule) {
54
54
  if (!rule.selector.includes(this.prefixed)) {
55
55
  return false
56
56
  }
package/lib/old-value.js CHANGED
@@ -1,7 +1,7 @@
1
1
  let utils = require('./utils')
2
2
 
3
3
  class OldValue {
4
- constructor (unprefixed, prefixed, string, regexp) {
4
+ constructor(unprefixed, prefixed, string, regexp) {
5
5
  this.unprefixed = unprefixed
6
6
  this.prefixed = prefixed
7
7
  this.string = string || prefixed
@@ -11,7 +11,7 @@ class OldValue {
11
11
  /**
12
12
  * Check, that value contain old value
13
13
  */
14
- check (value) {
14
+ check(value) {
15
15
  if (value.includes(this.string)) {
16
16
  return !!value.match(this.regexp)
17
17
  }
package/lib/prefixer.js CHANGED
@@ -5,7 +5,7 @@ let utils = require('./utils')
5
5
  /**
6
6
  * Recursively clone objects
7
7
  */
8
- function clone (obj, parent) {
8
+ function clone(obj, parent) {
9
9
  let cloned = new obj.constructor()
10
10
 
11
11
  for (let i of Object.keys(obj || {})) {
@@ -37,7 +37,7 @@ class Prefixer {
37
37
  /**
38
38
  * Add hack to selected names
39
39
  */
40
- static hack (klass) {
40
+ static hack(klass) {
41
41
  if (!this.hacks) {
42
42
  this.hacks = {}
43
43
  }
@@ -50,7 +50,7 @@ class Prefixer {
50
50
  /**
51
51
  * Load hacks for some names
52
52
  */
53
- static load (name, prefixes, all) {
53
+ static load(name, prefixes, all) {
54
54
  let Klass = this.hacks && this.hacks[name]
55
55
  if (Klass) {
56
56
  return new Klass(name, prefixes, all)
@@ -62,7 +62,7 @@ class Prefixer {
62
62
  /**
63
63
  * Clone node and clean autprefixer custom caches
64
64
  */
65
- static clone (node, overrides) {
65
+ static clone(node, overrides) {
66
66
  let cloned = clone(node)
67
67
  for (let name in overrides) {
68
68
  cloned[name] = overrides[name]
@@ -70,7 +70,7 @@ class Prefixer {
70
70
  return cloned
71
71
  }
72
72
 
73
- constructor (name, prefixes, all) {
73
+ constructor(name, prefixes, all) {
74
74
  this.prefixes = prefixes
75
75
  this.name = name
76
76
  this.all = all
@@ -79,7 +79,7 @@ class Prefixer {
79
79
  /**
80
80
  * Find prefix in node parents
81
81
  */
82
- parentPrefix (node) {
82
+ parentPrefix(node) {
83
83
  let prefix
84
84
 
85
85
  if (typeof node._autoprefixerPrefix !== 'undefined') {
@@ -112,7 +112,7 @@ class Prefixer {
112
112
  /**
113
113
  * Clone node with prefixes
114
114
  */
115
- process (node, result) {
115
+ process(node, result) {
116
116
  if (!this.check(node)) {
117
117
  return undefined
118
118
  }
@@ -136,7 +136,7 @@ class Prefixer {
136
136
  /**
137
137
  * Shortcut for Prefixer.clone
138
138
  */
139
- clone (node, overrides) {
139
+ clone(node, overrides) {
140
140
  return Prefixer.clone(node, overrides)
141
141
  }
142
142
  }
package/lib/prefixes.js CHANGED
@@ -9,66 +9,124 @@ let Selector = require('./selector')
9
9
  let AtRule = require('./at-rule')
10
10
  let Value = require('./value')
11
11
  let utils = require('./utils')
12
- Selector.hack(require('./hacks/fullscreen'))
13
- Selector.hack(require('./hacks/placeholder'))
14
- Selector.hack(require('./hacks/placeholder-shown'))
15
- Declaration.hack(require('./hacks/flex'))
16
- Declaration.hack(require('./hacks/order'))
17
- Declaration.hack(require('./hacks/filter'))
18
- Declaration.hack(require('./hacks/grid-end'))
19
- Declaration.hack(require('./hacks/animation'))
20
- Declaration.hack(require('./hacks/flex-flow'))
21
- Declaration.hack(require('./hacks/flex-grow'))
22
- Declaration.hack(require('./hacks/flex-wrap'))
23
- Declaration.hack(require('./hacks/grid-area'))
24
- Declaration.hack(require('./hacks/place-self'))
25
- Declaration.hack(require('./hacks/grid-start'))
26
- Declaration.hack(require('./hacks/align-self'))
27
- Declaration.hack(require('./hacks/appearance'))
28
- Declaration.hack(require('./hacks/flex-basis'))
29
- Declaration.hack(require('./hacks/mask-border'))
30
- Declaration.hack(require('./hacks/mask-composite'))
31
- Declaration.hack(require('./hacks/align-items'))
32
- Declaration.hack(require('./hacks/user-select'))
33
- Declaration.hack(require('./hacks/flex-shrink'))
34
- Declaration.hack(require('./hacks/break-props'))
35
- Declaration.hack(require('./hacks/color-adjust'))
36
- Declaration.hack(require('./hacks/writing-mode'))
37
- Declaration.hack(require('./hacks/border-image'))
38
- Declaration.hack(require('./hacks/align-content'))
39
- Declaration.hack(require('./hacks/border-radius'))
40
- Declaration.hack(require('./hacks/block-logical'))
41
- Declaration.hack(require('./hacks/grid-template'))
42
- Declaration.hack(require('./hacks/inline-logical'))
43
- Declaration.hack(require('./hacks/grid-row-align'))
44
- Declaration.hack(require('./hacks/transform-decl'))
45
- Declaration.hack(require('./hacks/flex-direction'))
46
- Declaration.hack(require('./hacks/image-rendering'))
47
- Declaration.hack(require('./hacks/backdrop-filter'))
48
- Declaration.hack(require('./hacks/background-clip'))
49
- Declaration.hack(require('./hacks/text-decoration'))
50
- Declaration.hack(require('./hacks/justify-content'))
51
- Declaration.hack(require('./hacks/background-size'))
52
- Declaration.hack(require('./hacks/grid-row-column'))
53
- Declaration.hack(require('./hacks/grid-rows-columns'))
54
- Declaration.hack(require('./hacks/grid-column-align'))
55
- Declaration.hack(require('./hacks/overscroll-behavior'))
56
- Declaration.hack(require('./hacks/grid-template-areas'))
57
- Declaration.hack(require('./hacks/text-emphasis-position'))
58
- Declaration.hack(require('./hacks/text-decoration-skip-ink'))
59
- Value.hack(require('./hacks/gradient'))
60
- Value.hack(require('./hacks/intrinsic'))
61
- Value.hack(require('./hacks/pixelated'))
62
- Value.hack(require('./hacks/image-set'))
63
- Value.hack(require('./hacks/cross-fade'))
64
- Value.hack(require('./hacks/display-flex'))
65
- Value.hack(require('./hacks/display-grid'))
66
- Value.hack(require('./hacks/filter-value'))
12
+ let hackFullscreen = require('./hacks/fullscreen')
13
+ let hackPlaceholder = require('./hacks/placeholder')
14
+ let hackPlaceholderShown = require('./hacks/placeholder-shown')
15
+ let hackFileSelectorButton = require('./hacks/file-selector-button')
16
+ let hackFlex = require('./hacks/flex')
17
+ let hackOrder = require('./hacks/order')
18
+ let hackFilter = require('./hacks/filter')
19
+ let hackGridEnd = require('./hacks/grid-end')
20
+ let hackAnimation = require('./hacks/animation')
21
+ let hackFlexFlow = require('./hacks/flex-flow')
22
+ let hackFlexGrow = require('./hacks/flex-grow')
23
+ let hackFlexWrap = require('./hacks/flex-wrap')
24
+ let hackGridArea = require('./hacks/grid-area')
25
+ let hackPlaceSelf = require('./hacks/place-self')
26
+ let hackGridStart = require('./hacks/grid-start')
27
+ let hackAlignSelf = require('./hacks/align-self')
28
+ let hackAppearance = require('./hacks/appearance')
29
+ let hackFlexBasis = require('./hacks/flex-basis')
30
+ let hackMaskBorder = require('./hacks/mask-border')
31
+ let hackMaskComposite = require('./hacks/mask-composite')
32
+ let hackAlignItems = require('./hacks/align-items')
33
+ let hackUserSelect = require('./hacks/user-select')
34
+ let hackFlexShrink = require('./hacks/flex-shrink')
35
+ let hackBreakProps = require('./hacks/break-props')
36
+ let hackColorAdjust = require('./hacks/color-adjust')
37
+ let hackWritingMode = require('./hacks/writing-mode')
38
+ let hackBorderImage = require('./hacks/border-image')
39
+ let hackAlignContent = require('./hacks/align-content')
40
+ let hackBorderRadius = require('./hacks/border-radius')
41
+ let hackBlockLogical = require('./hacks/block-logical')
42
+ let hackGridTemplate = require('./hacks/grid-template')
43
+ let hackInlineLogical = require('./hacks/inline-logical')
44
+ let hackGridRowAlign = require('./hacks/grid-row-align')
45
+ let hackTransformDecl = require('./hacks/transform-decl')
46
+ let hackFlexDirection = require('./hacks/flex-direction')
47
+ let hackImageRendering = require('./hacks/image-rendering')
48
+ let hackBackdropFilter = require('./hacks/backdrop-filter')
49
+ let hackBackgroundClip = require('./hacks/background-clip')
50
+ let hackTextDecoration = require('./hacks/text-decoration')
51
+ let hackJustifyContent = require('./hacks/justify-content')
52
+ let hackBackgroundSize = require('./hacks/background-size')
53
+ let hackGridRowColumn = require('./hacks/grid-row-column')
54
+ let hackGridRowsColumns = require('./hacks/grid-rows-columns')
55
+ let hackGridColumnAlign = require('./hacks/grid-column-align')
56
+ let hackOverscrollBehavior = require('./hacks/overscroll-behavior')
57
+ let hackGridTemplateAreas = require('./hacks/grid-template-areas')
58
+ let hackTextEmphasisPosition = require('./hacks/text-emphasis-position')
59
+ let hackTextDecorationSkipInk = require('./hacks/text-decoration-skip-ink')
60
+ let hackGradient = require('./hacks/gradient')
61
+ let hackIntrinsic = require('./hacks/intrinsic')
62
+ let hackPixelated = require('./hacks/pixelated')
63
+ let hackImageSet = require('./hacks/image-set')
64
+ let hackCrossFade = require('./hacks/cross-fade')
65
+ let hackDisplayFlex = require('./hacks/display-flex')
66
+ let hackDisplayGrid = require('./hacks/display-grid')
67
+ let hackFilterValue = require('./hacks/filter-value')
68
+
69
+ Selector.hack(hackFullscreen)
70
+ Selector.hack(hackPlaceholder)
71
+ Selector.hack(hackPlaceholderShown)
72
+ Selector.hack(hackFileSelectorButton)
73
+ Declaration.hack(hackFlex)
74
+ Declaration.hack(hackOrder)
75
+ Declaration.hack(hackFilter)
76
+ Declaration.hack(hackGridEnd)
77
+ Declaration.hack(hackAnimation)
78
+ Declaration.hack(hackFlexFlow)
79
+ Declaration.hack(hackFlexGrow)
80
+ Declaration.hack(hackFlexWrap)
81
+ Declaration.hack(hackGridArea)
82
+ Declaration.hack(hackPlaceSelf)
83
+ Declaration.hack(hackGridStart)
84
+ Declaration.hack(hackAlignSelf)
85
+ Declaration.hack(hackAppearance)
86
+ Declaration.hack(hackFlexBasis)
87
+ Declaration.hack(hackMaskBorder)
88
+ Declaration.hack(hackMaskComposite)
89
+ Declaration.hack(hackAlignItems)
90
+ Declaration.hack(hackUserSelect)
91
+ Declaration.hack(hackFlexShrink)
92
+ Declaration.hack(hackBreakProps)
93
+ Declaration.hack(hackColorAdjust)
94
+ Declaration.hack(hackWritingMode)
95
+ Declaration.hack(hackBorderImage)
96
+ Declaration.hack(hackAlignContent)
97
+ Declaration.hack(hackBorderRadius)
98
+ Declaration.hack(hackBlockLogical)
99
+ Declaration.hack(hackGridTemplate)
100
+ Declaration.hack(hackInlineLogical)
101
+ Declaration.hack(hackGridRowAlign)
102
+ Declaration.hack(hackTransformDecl)
103
+ Declaration.hack(hackFlexDirection)
104
+ Declaration.hack(hackImageRendering)
105
+ Declaration.hack(hackBackdropFilter)
106
+ Declaration.hack(hackBackgroundClip)
107
+ Declaration.hack(hackTextDecoration)
108
+ Declaration.hack(hackJustifyContent)
109
+ Declaration.hack(hackBackgroundSize)
110
+ Declaration.hack(hackGridRowColumn)
111
+ Declaration.hack(hackGridRowsColumns)
112
+ Declaration.hack(hackGridColumnAlign)
113
+ Declaration.hack(hackOverscrollBehavior)
114
+ Declaration.hack(hackGridTemplateAreas)
115
+ Declaration.hack(hackTextEmphasisPosition)
116
+ Declaration.hack(hackTextDecorationSkipInk)
117
+ Value.hack(hackGradient)
118
+ Value.hack(hackIntrinsic)
119
+ Value.hack(hackPixelated)
120
+ Value.hack(hackImageSet)
121
+ Value.hack(hackCrossFade)
122
+ Value.hack(hackDisplayFlex)
123
+ Value.hack(hackDisplayGrid)
124
+ Value.hack(hackFilterValue)
67
125
 
68
126
  let declsCache = new Map()
69
127
 
70
128
  class Prefixes {
71
- constructor (data, browsers, options = {}) {
129
+ constructor(data, browsers, options = {}) {
72
130
  this.data = data
73
131
  this.browsers = browsers
74
132
  this.options = options
@@ -80,7 +138,7 @@ class Prefixes {
80
138
  /**
81
139
  * Return clone instance to remove all prefixes
82
140
  */
83
- cleaner () {
141
+ cleaner() {
84
142
  if (this.cleanerCache) {
85
143
  return this.cleanerCache
86
144
  }
@@ -98,7 +156,7 @@ class Prefixes {
98
156
  /**
99
157
  * Select prefixes from data, which is necessary for selected browsers
100
158
  */
101
- select (list) {
159
+ select(list) {
102
160
  let selected = { add: {}, remove: {} }
103
161
 
104
162
  for (let name in list) {
@@ -155,7 +213,7 @@ class Prefixes {
155
213
  /**
156
214
  * Sort vendor prefixes
157
215
  */
158
- sort (prefixes) {
216
+ sort(prefixes) {
159
217
  return prefixes.sort((a, b) => {
160
218
  let aLength = utils.removeNote(a).length
161
219
  let bLength = utils.removeNote(b).length
@@ -171,7 +229,7 @@ class Prefixes {
171
229
  /**
172
230
  * Cache prefixes data to fast CSS processing
173
231
  */
174
- preprocess (selected) {
232
+ preprocess(selected) {
175
233
  let add = {
176
234
  'selectors': [],
177
235
  '@supports': new Supports(Prefixes, this)
@@ -266,7 +324,7 @@ class Prefixes {
266
324
  /**
267
325
  * Declaration loader with caching
268
326
  */
269
- decl (prop) {
327
+ decl(prop) {
270
328
  if (!declsCache.has(prop)) {
271
329
  declsCache.set(prop, Declaration.load(prop))
272
330
  }
@@ -277,7 +335,7 @@ class Prefixes {
277
335
  /**
278
336
  * Return unprefixed version of property
279
337
  */
280
- unprefixed (prop) {
338
+ unprefixed(prop) {
281
339
  let value = this.normalize(vendor.unprefixed(prop))
282
340
  if (value === 'flex-direction') {
283
341
  value = 'flex-flow'
@@ -288,14 +346,14 @@ class Prefixes {
288
346
  /**
289
347
  * Normalize prefix for remover
290
348
  */
291
- normalize (prop) {
349
+ normalize(prop) {
292
350
  return this.decl(prop).normalize(prop)
293
351
  }
294
352
 
295
353
  /**
296
354
  * Return prefixed version of property
297
355
  */
298
- prefixed (prop, prefix) {
356
+ prefixed(prop, prefix) {
299
357
  prop = vendor.unprefixed(prop)
300
358
  return this.decl(prop).prefixed(prop, prefix)
301
359
  }
@@ -303,7 +361,7 @@ class Prefixes {
303
361
  /**
304
362
  * Return values, which must be prefixed in selected property
305
363
  */
306
- values (type, prop) {
364
+ values(type, prop) {
307
365
  let data = this[type]
308
366
 
309
367
  let global = data['*'] && data['*'].values
@@ -319,7 +377,7 @@ class Prefixes {
319
377
  /**
320
378
  * Group declaration by unprefixed property to check them
321
379
  */
322
- group (decl) {
380
+ group(decl) {
323
381
  let rule = decl.parent
324
382
  let index = rule.index(decl)
325
383
  let { length } = rule.nodes
@@ -355,10 +413,10 @@ class Prefixes {
355
413
  }
356
414
 
357
415
  return {
358
- up (callback) {
416
+ up(callback) {
359
417
  return checker(-1, callback)
360
418
  },
361
- down (callback) {
419
+ down(callback) {
362
420
  return checker(+1, callback)
363
421
  }
364
422
  }
package/lib/processor.js CHANGED
@@ -23,27 +23,27 @@ const SIZES = [
23
23
  'max-block-size'
24
24
  ]
25
25
 
26
- function hasGridTemplate (decl) {
26
+ function hasGridTemplate(decl) {
27
27
  return decl.parent.some(
28
28
  i => i.prop === 'grid-template' || i.prop === 'grid-template-areas'
29
29
  )
30
30
  }
31
31
 
32
- function hasRowsAndColumns (decl) {
32
+ function hasRowsAndColumns(decl) {
33
33
  let hasRows = decl.parent.some(i => i.prop === 'grid-template-rows')
34
34
  let hasColumns = decl.parent.some(i => i.prop === 'grid-template-columns')
35
35
  return hasRows && hasColumns
36
36
  }
37
37
 
38
38
  class Processor {
39
- constructor (prefixes) {
39
+ constructor(prefixes) {
40
40
  this.prefixes = prefixes
41
41
  }
42
42
 
43
43
  /**
44
44
  * Add necessary prefixes
45
45
  */
46
- add (css, result) {
46
+ add(css, result) {
47
47
  // At-rules
48
48
  let resolution = this.prefixes.add['@resolution']
49
49
  let keyframes = this.prefixes.add['@keyframes']
@@ -84,7 +84,7 @@ class Processor {
84
84
  })
85
85
  })
86
86
 
87
- function insideGrid (decl) {
87
+ function insideGrid(decl) {
88
88
  return decl.parent.nodes.some(node => {
89
89
  if (node.type !== 'decl') return false
90
90
  let displayGrid =
@@ -94,7 +94,7 @@ class Processor {
94
94
  return displayGrid || gridTemplate || gridGap
95
95
  })
96
96
  }
97
- function insideFlex (decl) {
97
+ function insideFlex(decl) {
98
98
  return decl.parent.some(node => {
99
99
  return node.prop === 'display' && /(inline-)?flex/.test(node.value)
100
100
  })
@@ -391,7 +391,7 @@ class Processor {
391
391
  /**
392
392
  * Remove unnecessary pefixes
393
393
  */
394
- remove (css, result) {
394
+ remove(css, result) {
395
395
  // At-rules
396
396
  let resolution = this.prefixes.remove['@resolution']
397
397
 
@@ -479,14 +479,14 @@ class Processor {
479
479
  /**
480
480
  * Some rare old values, which is not in standard
481
481
  */
482
- withHackValue (decl) {
482
+ withHackValue(decl) {
483
483
  return decl.prop === '-webkit-background-clip' && decl.value === 'text'
484
484
  }
485
485
 
486
486
  /**
487
487
  * Check for grid/flexbox options.
488
488
  */
489
- disabledValue (node, result) {
489
+ disabledValue(node, result) {
490
490
  if (this.gridStatus(node, result) === false && node.type === 'decl') {
491
491
  if (node.prop === 'display' && node.value.includes('grid')) {
492
492
  return true
@@ -497,6 +497,9 @@ class Processor {
497
497
  return true
498
498
  }
499
499
  }
500
+ if (node.type === 'decl' && node.prop === 'content') {
501
+ return true
502
+ }
500
503
 
501
504
  return this.disabled(node, result)
502
505
  }
@@ -504,7 +507,7 @@ class Processor {
504
507
  /**
505
508
  * Check for grid/flexbox options.
506
509
  */
507
- disabledDecl (node, result) {
510
+ disabledDecl(node, result) {
508
511
  if (this.gridStatus(node, result) === false && node.type === 'decl') {
509
512
  if (node.prop.includes('grid') || node.prop === 'justify-items') {
510
513
  return true
@@ -523,7 +526,7 @@ class Processor {
523
526
  /**
524
527
  * Check for control comment and global options
525
528
  */
526
- disabled (node, result) {
529
+ disabled(node, result) {
527
530
  if (!node) return false
528
531
 
529
532
  if (node._autoprefixerDisabled !== undefined) {
@@ -581,7 +584,7 @@ class Processor {
581
584
  /**
582
585
  * Normalize spaces in cascade declaration group
583
586
  */
584
- reduceSpaces (decl) {
587
+ reduceSpaces(decl) {
585
588
  let stop = false
586
589
  this.prefixes.group(decl).up(() => {
587
590
  stop = true
@@ -613,7 +616,7 @@ class Processor {
613
616
  /**
614
617
  * Is it flebox or grid rule
615
618
  */
616
- displayType (decl) {
619
+ displayType(decl) {
617
620
  for (let i of decl.parent.nodes) {
618
621
  if (i.prop !== 'display') {
619
622
  continue
@@ -634,7 +637,7 @@ class Processor {
634
637
  /**
635
638
  * Set grid option via control comment
636
639
  */
637
- gridStatus (node, result) {
640
+ gridStatus(node, result) {
638
641
  if (!node) return false
639
642
 
640
643
  if (node._autoprefixerGridStatus !== undefined) {
package/lib/resolution.js CHANGED
@@ -1,4 +1,4 @@
1
- let Fraction = require('fraction.js')
1
+ let FractionJs = require('fraction.js')
2
2
 
3
3
  let Prefixer = require('./prefixer')
4
4
  let utils = require('./utils')
@@ -10,7 +10,7 @@ class Resolution extends Prefixer {
10
10
  /**
11
11
  * Return prefixed query name
12
12
  */
13
- prefixName (prefix, name) {
13
+ prefixName(prefix, name) {
14
14
  if (prefix === '-moz-') {
15
15
  return name + '--moz-device-pixel-ratio'
16
16
  } else {
@@ -21,8 +21,8 @@ class Resolution extends Prefixer {
21
21
  /**
22
22
  * Return prefixed query
23
23
  */
24
- prefixQuery (prefix, name, colon, value, units) {
25
- value = new Fraction(value)
24
+ prefixQuery(prefix, name, colon, value, units) {
25
+ value = new FractionJs(value)
26
26
 
27
27
  // 1dpcm = 2.54dpi
28
28
  // 1dppx = 96dpi
@@ -42,7 +42,7 @@ class Resolution extends Prefixer {
42
42
  /**
43
43
  * Remove prefixed queries
44
44
  */
45
- clean (rule) {
45
+ clean(rule) {
46
46
  if (!this.bad) {
47
47
  this.bad = []
48
48
  for (let prefix of this.prefixes) {
@@ -59,7 +59,7 @@ class Resolution extends Prefixer {
59
59
  /**
60
60
  * Add prefixed queries
61
61
  */
62
- process (rule) {
62
+ process(rule) {
63
63
  let parent = this.parentPrefix(rule)
64
64
  let prefixes = parent ? [parent] : this.prefixes
65
65
 
package/lib/selector.js CHANGED
@@ -6,7 +6,7 @@ let Browsers = require('./browsers')
6
6
  let utils = require('./utils')
7
7
 
8
8
  class Selector extends Prefixer {
9
- constructor (name, prefixes, all) {
9
+ constructor(name, prefixes, all) {
10
10
  super(name, prefixes, all)
11
11
  this.regexpCache = new Map()
12
12
  }
@@ -14,7 +14,7 @@ class Selector extends Prefixer {
14
14
  /**
15
15
  * Is rule selectors need to be prefixed
16
16
  */
17
- check (rule) {
17
+ check(rule) {
18
18
  if (rule.selector.includes(this.name)) {
19
19
  return !!rule.selector.match(this.regexp())
20
20
  }
@@ -25,14 +25,14 @@ class Selector extends Prefixer {
25
25
  /**
26
26
  * Return prefixed version of selector
27
27
  */
28
- prefixed (prefix) {
28
+ prefixed(prefix) {
29
29
  return this.name.replace(/^(\W*)/, `$1${prefix}`)
30
30
  }
31
31
 
32
32
  /**
33
33
  * Lazy loadRegExp for name
34
34
  */
35
- regexp (prefix) {
35
+ regexp(prefix) {
36
36
  if (!this.regexpCache.has(prefix)) {
37
37
  let name = prefix ? this.prefixed(prefix) : this.name
38
38
  this.regexpCache.set(
@@ -47,14 +47,14 @@ class Selector extends Prefixer {
47
47
  /**
48
48
  * All possible prefixes
49
49
  */
50
- possible () {
50
+ possible() {
51
51
  return Browsers.prefixes()
52
52
  }
53
53
 
54
54
  /**
55
55
  * Return all possible selector prefixes
56
56
  */
57
- prefixeds (rule) {
57
+ prefixeds(rule) {
58
58
  if (rule._autoprefixerPrefixeds) {
59
59
  if (rule._autoprefixerPrefixeds[this.name]) {
60
60
  return rule._autoprefixerPrefixeds
@@ -86,7 +86,7 @@ class Selector extends Prefixer {
86
86
  /**
87
87
  * Is rule already prefixed before
88
88
  */
89
- already (rule, prefixeds, prefix) {
89
+ already(rule, prefixeds, prefix) {
90
90
  let index = rule.parent.index(rule) - 1
91
91
 
92
92
  while (index >= 0) {
@@ -121,14 +121,14 @@ class Selector extends Prefixer {
121
121
  /**
122
122
  * Replace selectors by prefixed one
123
123
  */
124
- replace (selector, prefix) {
124
+ replace(selector, prefix) {
125
125
  return selector.replace(this.regexp(), `$1${this.prefixed(prefix)}`)
126
126
  }
127
127
 
128
128
  /**
129
129
  * Clone and add prefixes for at-rule
130
130
  */
131
- add (rule, prefix) {
131
+ add(rule, prefix) {
132
132
  let prefixeds = this.prefixeds(rule)
133
133
 
134
134
  if (this.already(rule, prefixeds, prefix)) {
@@ -142,7 +142,7 @@ class Selector extends Prefixer {
142
142
  /**
143
143
  * Return function to fast find prefixed selector
144
144
  */
145
- old (prefix) {
145
+ old(prefix) {
146
146
  return new OldSelector(this, prefix)
147
147
  }
148
148
  }