autoprefixer 10.4.3 → 10.4.6

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/data/prefixes.js CHANGED
@@ -1077,16 +1077,6 @@ f(prefixOverscroll, { match: /a #1/ }, browsers =>
1077
1077
  })
1078
1078
  )
1079
1079
 
1080
- // color-adjust
1081
- let prefixColorAdjust = require('caniuse-lite/data/features/css-color-adjust')
1082
-
1083
- f(prefixColorAdjust, browsers =>
1084
- prefix(['color-adjust'], {
1085
- feature: 'css-color-adjust',
1086
- browsers
1087
- })
1088
- )
1089
-
1090
1080
  // text-orientation
1091
1081
  let prefixTextOrientation = require('caniuse-lite/data/features/css-text-orientation')
1092
1082
 
@@ -1096,3 +1086,13 @@ f(prefixTextOrientation, browsers =>
1096
1086
  browsers
1097
1087
  })
1098
1088
  )
1089
+
1090
+ // print-color-adjust
1091
+ let prefixPrintAdjust = require('caniuse-lite/data/features/css-print-color-adjust')
1092
+
1093
+ f(prefixPrintAdjust, browsers =>
1094
+ prefix(['print-color-adjust', 'color-adjust'], {
1095
+ feature: 'css-print-color-adjust',
1096
+ browsers
1097
+ })
1098
+ )
@@ -6,11 +6,7 @@ class Autofill extends Selector {
6
6
  super(name, prefixes, all)
7
7
 
8
8
  if (this.prefixes) {
9
- this.prefixes = utils.uniq(
10
- this.prefixes.map(i => {
11
- return '-webkit-'
12
- })
13
- )
9
+ this.prefixes = utils.uniq(this.prefixes.map(() => '-webkit-'))
14
10
  }
15
11
  }
16
12
 
@@ -6,11 +6,7 @@ class FileSelectorButton extends Selector {
6
6
  super(name, prefixes, all)
7
7
 
8
8
  if (this.prefixes) {
9
- this.prefixes = utils.uniq(
10
- this.prefixes.map(i => {
11
- return '-webkit-'
12
- })
13
- )
9
+ this.prefixes = utils.uniq(this.prefixes.map(() => '-webkit-'))
14
10
  }
15
11
  }
16
12
 
@@ -1,4 +1,5 @@
1
1
  let Declaration = require('../declaration')
2
+ let { isPureNumber } = require('../utils')
2
3
 
3
4
  class GridEnd extends Declaration {
4
5
  /**
@@ -26,8 +27,12 @@ class GridEnd extends Declaration {
26
27
  startDecl = d
27
28
  })
28
29
  if (startDecl) {
29
- let value = Number(decl.value) - Number(startDecl.value) + ''
30
- clonedDecl.value = value
30
+ if (isPureNumber(startDecl.value)) {
31
+ let value = Number(decl.value) - Number(startDecl.value) + ''
32
+ clonedDecl.value = value
33
+ } else {
34
+ return undefined
35
+ }
31
36
  } else {
32
37
  decl.warn(
33
38
  result,
@@ -6,7 +6,7 @@ class GridStart extends Declaration {
6
6
  */
7
7
  check(decl) {
8
8
  let value = decl.value
9
- return !value.includes('/') || value.includes('span')
9
+ return !value.includes('/') && !value.includes('span')
10
10
  }
11
11
 
12
12
  /**
@@ -1,6 +1,6 @@
1
1
  let Declaration = require('../declaration')
2
2
 
3
- class ColorAdjust extends Declaration {
3
+ class PrintColorAdjust extends Declaration {
4
4
  /**
5
5
  * Change property name for WebKit-based browsers
6
6
  */
@@ -12,10 +12,10 @@ class ColorAdjust extends Declaration {
12
12
  * Return property name by spec
13
13
  */
14
14
  normalize() {
15
- return 'color-adjust'
15
+ return 'print-color-adjust'
16
16
  }
17
17
  }
18
18
 
19
- ColorAdjust.names = ['color-adjust', 'print-color-adjust']
19
+ PrintColorAdjust.names = ['print-color-adjust', 'color-adjust']
20
20
 
21
- module.exports = ColorAdjust
21
+ module.exports = PrintColorAdjust
package/lib/prefixes.js CHANGED
@@ -33,7 +33,6 @@ let hackAlignItems = require('./hacks/align-items')
33
33
  let hackUserSelect = require('./hacks/user-select')
34
34
  let hackFlexShrink = require('./hacks/flex-shrink')
35
35
  let hackBreakProps = require('./hacks/break-props')
36
- let hackColorAdjust = require('./hacks/color-adjust')
37
36
  let hackWritingMode = require('./hacks/writing-mode')
38
37
  let hackBorderImage = require('./hacks/border-image')
39
38
  let hackAlignContent = require('./hacks/align-content')
@@ -53,6 +52,7 @@ let hackBackgroundSize = require('./hacks/background-size')
53
52
  let hackGridRowColumn = require('./hacks/grid-row-column')
54
53
  let hackGridRowsColumns = require('./hacks/grid-rows-columns')
55
54
  let hackGridColumnAlign = require('./hacks/grid-column-align')
55
+ let hackPrintColorAdjust = require('./hacks/print-color-adjust')
56
56
  let hackOverscrollBehavior = require('./hacks/overscroll-behavior')
57
57
  let hackGridTemplateAreas = require('./hacks/grid-template-areas')
58
58
  let hackTextEmphasisPosition = require('./hacks/text-emphasis-position')
@@ -92,7 +92,6 @@ Declaration.hack(hackAlignItems)
92
92
  Declaration.hack(hackUserSelect)
93
93
  Declaration.hack(hackFlexShrink)
94
94
  Declaration.hack(hackBreakProps)
95
- Declaration.hack(hackColorAdjust)
96
95
  Declaration.hack(hackWritingMode)
97
96
  Declaration.hack(hackBorderImage)
98
97
  Declaration.hack(hackAlignContent)
@@ -114,6 +113,7 @@ Declaration.hack(hackGridRowsColumns)
114
113
  Declaration.hack(hackGridColumnAlign)
115
114
  Declaration.hack(hackOverscrollBehavior)
116
115
  Declaration.hack(hackGridTemplateAreas)
116
+ Declaration.hack(hackPrintColorAdjust)
117
117
  Declaration.hack(hackTextEmphasisPosition)
118
118
  Declaration.hack(hackTextDecorationSkipInk)
119
119
  Value.hack(hackGradient)
package/lib/processor.js CHANGED
@@ -112,7 +112,13 @@ class Processor {
112
112
  let prop = decl.prop
113
113
  let value = decl.value
114
114
 
115
- if (prop === 'grid-row-span') {
115
+ if (prop === 'color-adjust') {
116
+ result.warn(
117
+ 'Replace color-adjust to print-color-adjust. ' +
118
+ 'The color-adjust shorthand is currently deprecated.',
119
+ { node: decl }
120
+ )
121
+ } else if (prop === 'grid-row-span') {
116
122
  result.warn(
117
123
  'grid-row-span is not part of final Grid Layout. Use grid-row.',
118
124
  { node: decl }
package/lib/utils.js CHANGED
@@ -76,3 +76,18 @@ module.exports.splitSelector = function (selector) {
76
76
  })
77
77
  })
78
78
  }
79
+
80
+ /**
81
+ * Return true if a given value only contains numbers.
82
+ * @param {*} value
83
+ * @returns {boolean}
84
+ */
85
+ module.exports.isPureNumber = function (value) {
86
+ if (typeof value === 'number') {
87
+ return true
88
+ }
89
+ if (typeof value === 'string') {
90
+ return /^[0-9]+$/.test(value)
91
+ }
92
+ return false
93
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "autoprefixer",
3
- "version": "10.4.3",
3
+ "version": "10.4.6",
4
4
  "description": "Parse CSS and add vendor prefixes to CSS rules using values from the Can I Use website",
5
5
  "engines": {
6
6
  "node": "^10 || ^12 || >=14"
@@ -18,7 +18,7 @@
18
18
  "funding": [
19
19
  {
20
20
  "type": "opencollective",
21
- "url": "https://opencollective.com/postcss"
21
+ "url": "https://opencollective.com/postcss/"
22
22
  },
23
23
  {
24
24
  "type": "tidelift",
@@ -35,8 +35,8 @@
35
35
  "postcss": "^8.1.0"
36
36
  },
37
37
  "dependencies": {
38
- "browserslist": "^4.20.2",
39
- "caniuse-lite": "^1.0.30001317",
38
+ "browserslist": "^4.20.3",
39
+ "caniuse-lite": "^1.0.30001334",
40
40
  "fraction.js": "^4.2.0",
41
41
  "normalize-range": "^0.1.2",
42
42
  "picocolors": "^1.0.0",