autoprefixer
Advanced tools
Comparing version 10.4.2 to 10.4.14
@@ -1,2 +0,2 @@ | ||
let unpack = require('caniuse-lite').feature | ||
let unpack = require('caniuse-lite/dist/unpacker/feature') | ||
@@ -662,17 +662,2 @@ function browsersSort(a, b) { | ||
f(prefixDecoration, browsers => | ||
prefix( | ||
[ | ||
'text-decoration-style', | ||
'text-decoration-color', | ||
'text-decoration-line', | ||
'text-decoration' | ||
], | ||
{ | ||
feature: 'text-decoration', | ||
browsers | ||
} | ||
) | ||
) | ||
f(prefixDecoration, { match: /x.*#[235]/ }, browsers => | ||
@@ -685,2 +670,38 @@ prefix(['text-decoration-skip', 'text-decoration-skip-ink'], { | ||
let prefixDecorationShorthand = require('caniuse-lite/data/features/mdn-text-decoration-shorthand') | ||
f(prefixDecorationShorthand, browsers => | ||
prefix(['text-decoration'], { | ||
feature: 'text-decoration', | ||
browsers | ||
}) | ||
) | ||
let prefixDecorationColor = require('caniuse-lite/data/features/mdn-text-decoration-color') | ||
f(prefixDecorationColor, browsers => | ||
prefix(['text-decoration-color'], { | ||
feature: 'text-decoration', | ||
browsers | ||
}) | ||
) | ||
let prefixDecorationLine = require('caniuse-lite/data/features/mdn-text-decoration-line') | ||
f(prefixDecorationLine, browsers => | ||
prefix(['text-decoration-line'], { | ||
feature: 'text-decoration', | ||
browsers | ||
}) | ||
) | ||
let prefixDecorationStyle = require('caniuse-lite/data/features/mdn-text-decoration-style') | ||
f(prefixDecorationStyle, browsers => | ||
prefix(['text-decoration-style'], { | ||
feature: 'text-decoration', | ||
browsers | ||
}) | ||
) | ||
// Text Size Adjust | ||
@@ -1046,5 +1067,6 @@ let prefixTextSizeAdjust = require('caniuse-lite/data/features/text-size-adjust') | ||
// unicode-bidi | ||
let prefixBidi = require('caniuse-lite/data/features/css-unicode-bidi') | ||
f(prefixBidi, browsers => | ||
let bidiIsolate = require('caniuse-lite/data/features/mdn-css-unicode-bidi-isolate') | ||
f(bidiIsolate, browsers => | ||
prefix(['isolate'], { | ||
@@ -1057,3 +1079,5 @@ props: ['unicode-bidi'], | ||
f(prefixBidi, { match: /y x|a x #2/ }, browsers => | ||
let bidiPlaintext = require('caniuse-lite/data/features/mdn-css-unicode-bidi-plaintext') | ||
f(bidiPlaintext, browsers => | ||
prefix(['plaintext'], { | ||
@@ -1066,3 +1090,5 @@ props: ['unicode-bidi'], | ||
f(prefixBidi, { match: /y x/ }, browsers => | ||
let bidiOverride = require('caniuse-lite/data/features/mdn-css-unicode-bidi-isolate-override') | ||
f(bidiOverride, { match: /y x/ }, browsers => | ||
prefix(['isolate-override'], { | ||
@@ -1085,12 +1111,2 @@ props: ['unicode-bidi'], | ||
// color-adjust | ||
let prefixColorAdjust = require('caniuse-lite/data/features/css-color-adjust') | ||
f(prefixColorAdjust, browsers => | ||
prefix(['color-adjust'], { | ||
feature: 'css-color-adjust', | ||
browsers | ||
}) | ||
) | ||
// text-orientation | ||
@@ -1105,1 +1121,11 @@ let prefixTextOrientation = require('caniuse-lite/data/features/css-text-orientation') | ||
) | ||
// print-color-adjust | ||
let prefixPrintAdjust = require('caniuse-lite/data/features/css-print-color-adjust') | ||
f(prefixPrintAdjust, browsers => | ||
prefix(['print-color-adjust', 'color-adjust'], { | ||
feature: 'css-print-color-adjust', | ||
browsers | ||
}) | ||
) |
let browserslist = require('browserslist') | ||
let { agents } = require('caniuse-lite') | ||
let { agents } = require('caniuse-lite/dist/unpacker/agents') | ||
let pico = require('picocolors') | ||
@@ -4,0 +4,0 @@ |
let browserslist = require('browserslist') | ||
let agents = require('caniuse-lite').agents | ||
let { agents } = require('caniuse-lite/dist/unpacker/agents') | ||
@@ -4,0 +4,0 @@ let utils = require('./utils') |
@@ -36,3 +36,3 @@ let Prefixer = require('./prefixer') | ||
if (value.includes(other)) { | ||
return true | ||
return value.replace(/var\([^)]+\)/, '').includes(other) | ||
} | ||
@@ -39,0 +39,0 @@ } |
@@ -9,7 +9,3 @@ let Selector = require('../selector') | ||
if (this.prefixes) { | ||
this.prefixes = utils.uniq( | ||
this.prefixes.map(i => { | ||
return '-webkit-' | ||
}) | ||
) | ||
this.prefixes = utils.uniq(this.prefixes.map(() => '-webkit-')) | ||
} | ||
@@ -16,0 +12,0 @@ } |
@@ -9,7 +9,3 @@ let Selector = require('../selector') | ||
if (this.prefixes) { | ||
this.prefixes = utils.uniq( | ||
this.prefixes.map(i => { | ||
return '-webkit-' | ||
}) | ||
) | ||
this.prefixes = utils.uniq(this.prefixes.map(() => '-webkit-')) | ||
} | ||
@@ -16,0 +12,0 @@ } |
@@ -17,5 +17,6 @@ let parser = require('postcss-value-parser') | ||
for (let node of ast.nodes) { | ||
if (node.type === 'function' && node.value === this.name) { | ||
let gradientName = this.name // gradient name | ||
if (node.type === 'function' && node.value === gradientName) { | ||
node.nodes = this.newDirection(node.nodes) | ||
node.nodes = this.normalize(node.nodes) | ||
node.nodes = this.normalize(node.nodes, gradientName) | ||
if (prefix === '-webkit- old') { | ||
@@ -60,3 +61,3 @@ let changes = this.oldWebkit(node) | ||
*/ | ||
normalize(nodes) { | ||
normalize(nodes, gradientName) { | ||
if (!nodes[0]) return nodes | ||
@@ -76,10 +77,19 @@ | ||
if (nodes[0].value === '0deg') { | ||
nodes = this.replaceFirst(nodes, 'to', ' ', 'top') | ||
} else if (nodes[0].value === '90deg') { | ||
nodes = this.replaceFirst(nodes, 'to', ' ', 'right') | ||
} else if (nodes[0].value === '180deg') { | ||
nodes = this.replaceFirst(nodes, 'to', ' ', 'bottom') | ||
} else if (nodes[0].value === '270deg') { | ||
nodes = this.replaceFirst(nodes, 'to', ' ', 'left') | ||
if ( | ||
gradientName === 'linear-gradient' || | ||
gradientName === 'repeating-linear-gradient' | ||
) { | ||
let direction = nodes[0].value | ||
// Unitless zero for `<angle>` values are allowed in CSS gradients and transforms. | ||
// Spec: https://github.com/w3c/csswg-drafts/commit/602789171429b2231223ab1e5acf8f7f11652eb3 | ||
if (direction === '0deg' || direction === '0') { | ||
nodes = this.replaceFirst(nodes, 'to', ' ', 'top') | ||
} else if (direction === '90deg') { | ||
nodes = this.replaceFirst(nodes, 'to', ' ', 'right') | ||
} else if (direction === '180deg') { | ||
nodes = this.replaceFirst(nodes, 'to', ' ', 'bottom') // default value | ||
} else if (direction === '270deg') { | ||
nodes = this.replaceFirst(nodes, 'to', ' ', 'left') | ||
} | ||
} | ||
@@ -364,3 +374,12 @@ | ||
if (prefix === '-webkit-') { | ||
let type = this.name === 'linear-gradient' ? 'linear' : 'radial' | ||
let type | ||
if (this.name === 'linear-gradient') { | ||
type = 'linear' | ||
} else if (this.name === 'repeating-linear-gradient') { | ||
type = 'repeating-linear' | ||
} else if (this.name === 'repeating-radial-gradient') { | ||
type = 'repeating-radial' | ||
} else { | ||
type = 'radial' | ||
} | ||
let string = '-gradient' | ||
@@ -410,3 +429,3 @@ let regexp = utils.regexp( | ||
Gradient.directions = { | ||
top: 'bottom', | ||
top: 'bottom', // default value | ||
left: 'right', | ||
@@ -413,0 +432,0 @@ bottom: 'top', |
let Declaration = require('../declaration') | ||
let { isPureNumber } = require('../utils') | ||
@@ -29,4 +30,8 @@ class GridEnd extends Declaration { | ||
if (startDecl) { | ||
let value = Number(decl.value) - Number(startDecl.value) + '' | ||
clonedDecl.value = value | ||
if (isPureNumber(startDecl.value)) { | ||
let value = Number(decl.value) - Number(startDecl.value) + '' | ||
clonedDecl.value = value | ||
} else { | ||
return undefined | ||
} | ||
} else { | ||
@@ -33,0 +38,0 @@ decl.warn( |
@@ -9,3 +9,3 @@ let Declaration = require('../declaration') | ||
let value = decl.value | ||
return !value.includes('/') || value.includes('span') | ||
return !value.includes('/') && !value.includes('span') | ||
} | ||
@@ -12,0 +12,0 @@ |
@@ -36,3 +36,2 @@ let vendor = require('./vendor') | ||
let hackBreakProps = require('./hacks/break-props') | ||
let hackColorAdjust = require('./hacks/color-adjust') | ||
let hackWritingMode = require('./hacks/writing-mode') | ||
@@ -57,2 +56,3 @@ let hackBorderImage = require('./hacks/border-image') | ||
let hackGridColumnAlign = require('./hacks/grid-column-align') | ||
let hackPrintColorAdjust = require('./hacks/print-color-adjust') | ||
let hackOverscrollBehavior = require('./hacks/overscroll-behavior') | ||
@@ -97,3 +97,2 @@ let hackGridTemplateAreas = require('./hacks/grid-template-areas') | ||
Declaration.hack(hackBreakProps) | ||
Declaration.hack(hackColorAdjust) | ||
Declaration.hack(hackWritingMode) | ||
@@ -120,2 +119,3 @@ Declaration.hack(hackBorderImage) | ||
Declaration.hack(hackGridTemplateAreas) | ||
Declaration.hack(hackPrintColorAdjust) | ||
Declaration.hack(hackTextEmphasisPosition) | ||
@@ -122,0 +122,0 @@ Declaration.hack(hackTextDecorationSkipInk) |
@@ -115,3 +115,11 @@ let parser = require('postcss-value-parser') | ||
if (prop === 'grid-row-span') { | ||
if (prop === 'color-adjust') { | ||
if (parent.every(i => i.prop !== 'print-color-adjust')) { | ||
result.warn( | ||
'Replace color-adjust to print-color-adjust. ' + | ||
'The color-adjust shorthand is currently deprecated.', | ||
{ node: decl } | ||
) | ||
} | ||
} else if (prop === 'grid-row-span') { | ||
result.warn( | ||
@@ -118,0 +126,0 @@ 'grid-row-span is not part of final Grid Layout. Use grid-row.', |
let featureQueries = require('caniuse-lite/data/features/css-featurequeries.js') | ||
let { feature } = require('caniuse-lite') | ||
let feature = require('caniuse-lite/dist/unpacker/feature') | ||
let { parse } = require('postcss') | ||
@@ -4,0 +4,0 @@ |
@@ -79,1 +79,16 @@ let { list } = require('postcss') | ||
} | ||
/** | ||
* Return true if a given value only contains numbers. | ||
* @param {*} value | ||
* @returns {boolean} | ||
*/ | ||
module.exports.isPureNumber = function (value) { | ||
if (typeof value === 'number') { | ||
return true | ||
} | ||
if (typeof value === 'string') { | ||
return /^[0-9]+$/.test(value) | ||
} | ||
return false | ||
} |
{ | ||
"name": "autoprefixer", | ||
"version": "10.4.2", | ||
"version": "10.4.14", | ||
"description": "Parse CSS and add vendor prefixes to CSS rules using values from the Can I Use website", | ||
@@ -18,6 +18,12 @@ "engines": { | ||
"types": "lib/autoprefixer.d.ts", | ||
"funding": { | ||
"type": "opencollective", | ||
"url": "https://opencollective.com/postcss/" | ||
}, | ||
"funding": [ | ||
{ | ||
"type": "opencollective", | ||
"url": "https://opencollective.com/postcss/" | ||
}, | ||
{ | ||
"type": "tidelift", | ||
"url": "https://tidelift.com/funding/github/npm/autoprefixer" | ||
} | ||
], | ||
"author": "Andrey Sitnik <andrey@sitnik.ru>", | ||
@@ -33,5 +39,5 @@ "license": "MIT", | ||
"dependencies": { | ||
"browserslist": "^4.19.1", | ||
"caniuse-lite": "^1.0.30001297", | ||
"fraction.js": "^4.1.2", | ||
"browserslist": "^4.21.5", | ||
"caniuse-lite": "^1.0.30001464", | ||
"fraction.js": "^4.2.0", | ||
"normalize-range": "^0.1.2", | ||
@@ -38,0 +44,0 @@ "picocolors": "^1.0.0", |
@@ -36,5 +36,2 @@ # Autoprefixer [![Cult Of Martians][cult-img]][cult] | ||
} | ||
:-ms-input-placeholder { | ||
color: gray; | ||
} | ||
::placeholder { | ||
@@ -70,2 +67,2 @@ color: gray; | ||
## Docs | ||
Read **[full docs](https://github.com/postcss/autoprefixer#readme)** on GitHub. | ||
Read full docs **[here](https://github.com/postcss/autoprefixer#readme)**. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
198756
6996
67
+ Addedelectron-to-chromium@1.5.64(transitive)
+ Addednanoid@3.3.7(transitive)
- Removedelectron-to-chromium@1.5.65(transitive)
- Removednanoid@3.3.8(transitive)
Updatedbrowserslist@^4.21.5
Updatedcaniuse-lite@^1.0.30001464
Updatedfraction.js@^4.2.0