postcss-pxtransform 3.3.15 → 3.3.19

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.
Files changed (2) hide show
  1. package/index.js +10 -5
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -44,11 +44,6 @@ module.exports = postcss.plugin('postcss-pxtransform', function (options) {
44
44
  options = Object.assign(DEFAULT_WEAPP_OPTIONS, options || {})
45
45
 
46
46
  switch (options.platform) {
47
- case 'weapp': {
48
- options.rootValue = 1 / options.deviceRatio[options.designWidth]
49
- targetUnit = 'rpx'
50
- break
51
- }
52
47
  case 'h5': {
53
48
  options.rootValue = baseFontSize * options.designWidth / 640
54
49
  targetUnit = 'rem'
@@ -59,6 +54,16 @@ module.exports = postcss.plugin('postcss-pxtransform', function (options) {
59
54
  targetUnit = 'px'
60
55
  break
61
56
  }
57
+ case 'quickapp': {
58
+ options.rootValue = 1
59
+ targetUnit = 'px'
60
+ break
61
+ }
62
+ default: {
63
+ // mini-program
64
+ options.rootValue = 1 / options.deviceRatio[options.designWidth]
65
+ targetUnit = 'rpx'
66
+ }
62
67
  }
63
68
 
64
69
  convertLegacyOptions(options)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "postcss-pxtransform",
3
- "version": "3.3.15",
3
+ "version": "3.3.19",
4
4
  "description": "PostCSS plugin px 转小程序 rpx及h5 rem 单位",
5
5
  "keywords": [
6
6
  "postcss",
@@ -29,5 +29,5 @@
29
29
  "testEnvironment": "node"
30
30
  },
31
31
  "main": "index.js",
32
- "gitHead": "4a11ab9a8950f6a580e1278c160f6b4aaa8ac4f2"
32
+ "gitHead": "e5152ac3ba4c46d5cc7af3c27a1e98ce73c2af17"
33
33
  }