postcss-convert-values 1.3.0 → 1.3.1
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/CHANGELOG.md +5 -0
- package/dist/index.js +12 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -22,7 +22,10 @@ var optimise = function optimise(decl) {
|
|
|
22
22
|
if (~decl.prop.indexOf('flex')) {
|
|
23
23
|
return;
|
|
24
24
|
}
|
|
25
|
-
|
|
25
|
+
|
|
26
|
+
var parsed = (0, _postcssValueParser2['default'])(decl.value);
|
|
27
|
+
|
|
28
|
+
var transform = function transform(node) {
|
|
26
29
|
if (node.type === 'word') {
|
|
27
30
|
var number = (0, _postcssValueParser.unit)(node.value);
|
|
28
31
|
if (number) {
|
|
@@ -35,8 +38,15 @@ var optimise = function optimise(decl) {
|
|
|
35
38
|
}
|
|
36
39
|
node.value = (0, _libConvert2['default'])(num, u);
|
|
37
40
|
}
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
if (node.type === 'function' && node.value === 'calc') {
|
|
44
|
+
return node.nodes.forEach(transform);
|
|
38
45
|
}
|
|
39
|
-
}
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
parsed.nodes.forEach(transform);
|
|
49
|
+
decl.value = parsed.toString();
|
|
40
50
|
};
|
|
41
51
|
|
|
42
52
|
exports['default'] = _postcss2['default'].plugin('postcss-convert-values', function () {
|