postcss-merge-longhand
Advanced tools
Comparing version 4.0.9 to 4.0.10
@@ -376,3 +376,10 @@ 'use strict'; | ||
const values = rules.map(node => (0, _parseWsc2.default)(node.value).map((value, i) => value || defaults[i]).join(' ')); | ||
const values = rules.map(node => { | ||
const wscValue = (0, _parseWsc2.default)(node.value); | ||
if (!(0, _validateWsc.isValidWsc)(wscValue)) { | ||
return node.value; | ||
} | ||
return wscValue.map((value, i) => value || defaults[i]).join(' '); | ||
}); | ||
const reduced = getDistinctShorthands(values); | ||
@@ -379,0 +386,0 @@ |
@@ -14,2 +14,9 @@ 'use strict'; | ||
const varRE = /(^.*var)(.*\(.*--.*\))(.*)/i; | ||
const varPreserveCase = p => `${p[1].toLowerCase()}${p[2]}${p[3].toLowerCase()}`; | ||
const toLower = v => { | ||
const match = varRE.exec(v); | ||
return match ? varPreserveCase(match) : v.toLowerCase(); | ||
}; | ||
function parseWsc(value) { | ||
@@ -32,7 +39,7 @@ if (none.test(value)) { | ||
if ((0, _validateWsc.isStyle)(v)) { | ||
style = v.toLowerCase(); | ||
style = toLower(v); | ||
} else if ((0, _validateWsc.isWidth)(v)) { | ||
width = v.toLowerCase(); | ||
width = toLower(v); | ||
} else if ((0, _validateWsc.isColor)(v)) { | ||
color = v.toLowerCase(); | ||
color = toLower(v); | ||
} else { | ||
@@ -39,0 +46,0 @@ unknown.push(v); |
{ | ||
"name": "postcss-merge-longhand", | ||
"version": "4.0.9", | ||
"version": "4.0.10", | ||
"description": "Merge longhand properties into shorthand with PostCSS.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
50139
1123