Open crossjs opened 7 years ago
Please provide your postcss config.
我有相同的问题,原因是因为postcss
里配置多个插件时,会多次调用px2rem
,第一次调用px2rem
时会删除/*no*/
,后面再调用px2rem
就检测不到/*no*/
,暂时解决方案是注释掉px2rem.js
的129行:
line128 } else if (nextDeclaration.comment.trim() === config.keepComment) { // no transform
line129 // declarations.splice(j + 1, 1); // delete corresponding comment
line130 } else {
若有更优雅的解决方案请告知,谢谢~ @songsiqi @crossjs
@facesea 我的方案是不用这个工具,自己写了个 https://github.com/crossjs/postcss-flexible
使用 rem(),dpr() 等方法,虽然侵入性强了点,但适配更好,比如一行有多个需要转换的情况。
@facesea 解决了困扰半天的问题。
following:
will be converted to:
and that is NOT expected