postcss-pxtransform 3.5.5 → 3.5.6

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.
@@ -72,6 +72,13 @@ describe('px2rem', function () {
72
72
 
73
73
  expect(processed).toBe(expected)
74
74
  })
75
+
76
+ it('8 should work on custom baseFontSize', function () {
77
+ const processed = postcss(px2rem({ platform: 'h5', baseFontSize: 15 })).process(basicCSS).css
78
+ const expected = '.rule { font-size: 0.5rem }'
79
+
80
+ expect(processed).toBe(expected)
81
+ })
75
82
  })
76
83
 
77
84
  describe('value parsing', function () {
package/index.js CHANGED
@@ -41,7 +41,7 @@ module.exports = postcss.plugin('postcss-pxtransform', function (options = {}) {
41
41
  options = Object.assign({}, DEFAULT_WEAPP_OPTIONS, options)
42
42
 
43
43
  const transUnits = ['px']
44
- const baseFontSize = options.baseFontSize || options.minRootSize >= 1 ? options.minRootSize : 20
44
+ const baseFontSize = options.baseFontSize || (options.minRootSize >= 1 ? options.minRootSize : 20)
45
45
  const designWidth = input => typeof options.designWidth === 'function'
46
46
  ? options.designWidth(input)
47
47
  : options.designWidth
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "postcss-pxtransform",
3
- "version": "3.5.5",
3
+ "version": "3.5.6",
4
4
  "description": "PostCSS plugin px 转小程序 rpx及h5 rem 单位",
5
5
  "keywords": [
6
6
  "postcss",