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.
- package/index.js +6 -6
- 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 (
|
|
239
|
-
|
|
238
|
+
if (opts.mediaQuery) {
|
|
239
|
+
if (skip) return
|
|
240
|
+
if (!opts.methods.includes('size')) return
|
|
240
241
|
|
|
241
|
-
|
|
242
|
-
|
|
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)
|