lkxian888 / postcss-px-to-viewport-8-plugin

解决 postcss-px-to-viewport 控制台输出: postcss.plugin was deprecated. Migration guide:
161 stars 27 forks source link

1.2.2版本中媒体查询中的px会被强制转换vw,哪怕配置中mediaQuery: false也不行,老版本1.2.0中没有这个问题 #22

Open chenky opened 1 year ago

chenky commented 1 year ago

1.2.2版本中媒体查询中的px会被强制转换vw,哪怕配置中mediaQuery: false也不行,老版本1.2.0中没有这个问题,我使用的是vue3,vite4.1.4,配置如下 css: { postcss: { plugins: [ postcsspxtoviewport8plugin({ unitToConvert: 'px', // 要转化的单位 viewportWidth: 375, // UI设计稿的宽度 // unitPrecision: 6, // 转换后的精度,即小数点位数 propList: [''], // 指定转换的css属性的单位,代表全部css属性的单位都进行转换 viewportUnit: 'vw', // 指定需要转换成的视窗单位,默认vw // fontViewportUnit: 'vw', // 指定字体需要转换成的视窗单位,默认vw selectorBlackList: ['ign_'], // 指定不转换为视窗单位的类名, minPixelValue: 0.5, // 默认值1,小于或等于1px则不进行转换 mediaQuery: false, // 是否在媒体查询的css代码中也进行转换,默认false // replace: true, // 是否转换后直接更换属性值 // exclude: [/node_modules/], // 设置忽略文件,用正则做目录名匹配 // exclude: [], // landscape: false // 是否处理横屏情况 }) ] } }

tsheng commented 1 year ago

@lkxian888 这个问题什么时候能修复下,这是个很重要的功能

EatherToo commented 1 year ago

https://github.com/lkxian888/postcss-px-to-viewport-8-plugin/pull/26 改这里就行

fkw-github commented 5 months ago

我安装了1.2.3版本,并设置 mediaQuery: false 还是会自动转换

lkxian888 commented 5 months ago

麻烦安装 1.2.5版本