postcss-pxtransform 4.0.8-beta.0 → 4.0.8-beta.3

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 +6 -6
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -235,11 +235,13 @@ module.exports = (options = {}) => {
235
235
  },
236
236
  AtRule: {
237
237
  media: (rule) => {
238
- if (skip) return
239
- if (!opts.methods.includes('size')) return
238
+ if (opts.mediaQuery) {
239
+ if (skip) return
240
+ if (!opts.methods.includes('size')) return
240
241
 
241
- if (!/px/i.test(rule.params)) return
242
- rule.params = rule.params.replace(pxRgx, pxReplace)
242
+ if (!/px/i.test(rule.params)) return
243
+ rule.params = rule.params.replace(pxRgx, pxReplace)
244
+ }
243
245
  },
244
246
  },
245
247
  }
@@ -291,8 +293,6 @@ function createPxReplace (rootValue, unitPrecision, minPixelValue, onePxTransfor
291
293
  return m
292
294
  }
293
295
 
294
- // 转换工作,如果是harmony的话不转换
295
- if (platform === 'harmony') { return m }
296
296
  let val = pixels / rootValue(input, m, $1)
297
297
  if (unitPrecision >= 0 && unitPrecision <= 100) {
298
298
  val = toFixed(val, unitPrecision)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "postcss-pxtransform",
3
- "version": "4.0.8-beta.0",
3
+ "version": "4.0.8-beta.3",
4
4
  "description": "PostCSS plugin px 转小程序 rpx及h5 rem 单位",
5
5
  "author": "O2Team",
6
6
  "license": "MIT",