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