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 CHANGED
@@ -1,3 +1,8 @@
1
+ # 1.3.1
2
+
3
+ * Fixes an issue where the module would convert values in gradient/url functions
4
+ since 1.3.0.
5
+
1
6
  # 1.3.0
2
7
 
3
8
  * Converted the module to use ES6.
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
- decl.value = (0, _postcssValueParser2['default'])(decl.value).walk(function (node) {
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
- }).toString();
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 () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "postcss-convert-values",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "Convert values with PostCSS (e.g. ms -> s)",
5
5
  "main": "dist/index.js",
6
6
  "files": [