@remax/postcss-px2units
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -11,3 +11,4 @@ var postcss = require('postcss'); | ||
targetUnits: 'rpx', | ||
comment: 'no' | ||
comment: 'no', | ||
minPixelValue: 0 | ||
}, opts); | ||
@@ -20,2 +21,5 @@ | ||
return str.replace(/\b(\d+(\.\d+)?)px\b/g, function (match, x) { | ||
if (x <= opts.minPixelValue) { | ||
return match; | ||
} | ||
var size = x * opts.multiple / opts.divisor; | ||
@@ -22,0 +26,0 @@ return size % 1 === 0 ? size + opts.targetUnits : size.toFixed(opts.decimalPlaces) + opts.targetUnits; |
{ | ||
"name": "@remax/postcss-px2units", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "postcss plugin", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
8696
34