postcss-convert-values
Advanced tools
Comparing version 1.2.2 to 1.2.3
@@ -0,1 +1,6 @@ | ||
# 1.2.3 | ||
* Adds support for `ch` units; previously they were removed. | ||
* Upgrades css-list to `0.1.0`, code tidied up. | ||
# 1.2.2 | ||
@@ -2,0 +7,0 @@ |
@@ -11,6 +11,9 @@ 'use strict'; | ||
css.eachDecl(function (decl) { | ||
if (~decl.prop.indexOf('flex')) { | ||
return; | ||
} | ||
decl.value = eachValue(decl.value, function (value) { | ||
var number, unit; | ||
if (!~decl.prop.indexOf('flex') && !isNaN(number = parseFloat(value))) { | ||
if (!isNaN(number = parseFloat(value))) { | ||
unit = parseUnit(value); | ||
@@ -17,0 +20,0 @@ |
@@ -7,3 +7,3 @@ 'use strict'; | ||
module.exports = function eachValue (value, callback) { | ||
return list.map(value, [' ', '\n', '\t', ',', '/'], function (value, type) { | ||
return list.map(value, function (value, type) { | ||
var name, | ||
@@ -10,0 +10,0 @@ match, |
'use strict'; | ||
// From longer to shorter! | ||
var units = ['vmin', 'vmax', 'rem', 'em', 'ex', 'vw', 'vh', 'vm', 'in', 'cm', 'mm', 'pt', 'pc', 'px', 'ms', 's', '%']; | ||
var units = [ | ||
'vmin', | ||
'vmax', | ||
'rem', | ||
'em', | ||
'ex', | ||
'vw', | ||
'vh', | ||
'vm', | ||
'ch', | ||
'in', | ||
'cm', | ||
'mm', | ||
'pt', | ||
'pc', | ||
'px', | ||
'ms', | ||
's', | ||
'%' | ||
]; | ||
@@ -11,3 +30,3 @@ module.exports = function (value) { | ||
index = units.indexOf(value.slice(-max)); | ||
if (index !== -1) { | ||
if (~index) { | ||
return units[index]; | ||
@@ -14,0 +33,0 @@ } |
{ | ||
"name": "postcss-convert-values", | ||
"version": "1.2.2", | ||
"version": "1.2.3", | ||
"description": "Convert values with PostCSS (e.g. ms -> s)", | ||
@@ -18,4 +18,4 @@ "main": "index.js", | ||
"devDependencies": { | ||
"tap-spec": "^2.2.2", | ||
"tape": "^3.5.0" | ||
"tap-spec": "^4.0.2", | ||
"tape": "^4.0.0" | ||
}, | ||
@@ -31,5 +31,5 @@ "homepage": "https://github.com/ben-eb/postcss-convert-values", | ||
"balanced-match": "^0.2.0", | ||
"css-list": "0.0.3", | ||
"postcss": "^4.1.4" | ||
"css-list": "^0.1.0", | ||
"postcss": "^4.1.13" | ||
} | ||
} |
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
7680
129
+ Addedcss-list@0.1.3(transitive)
- Removedcss-list@0.0.3(transitive)
Updatedcss-list@^0.1.0
Updatedpostcss@^4.1.13