px2rem icon indicating copy to clipboard operation
px2rem copied to clipboard

fix: 处理.5px等忽略小数首位0时rem计算异常的问题

Open tangxiangmin opened this issue 3 years ago • 1 comments

使用dart-sass时,当outputStyle配置项为压缩模式,会将0.5px等小于1的数字忽略首位0,最终输入.5px

这种数字单位在px2rem时会错误地忽略小数点.,被当做成5px,比如当remUnit为100时,计算输出的rem值变成了.0.05rem,导致最后的结果变成了0.05rem,结果扩大了10倍,因此需要修复一下

tangxiangmin avatar Jan 05 '22 15:01 tangxiangmin

@songsiqi 可以 cr 一下这个 pr 么,希望可以合并下

ProfBramble avatar Feb 27 '23 09:02 ProfBramble