基于宽度将rpx转换为rem, 宽度默认750;
本项目需结合
Convert rpx to rem plugin for less.js
npm install -g less-plugin-rpxtorem
and then on the command line,
lessc file.less --rpxtorem
You can set the 'width' option to control the ratio of rpx to rem (default 100).
lessc --rpxtorem="width=750" index.less index.css.
var LessPluginRpxToRem = require('less-plugin-rpxtorem');
new LessPluginRpxToRem({
width:750
})
Browser usage is not supported at this time.