px2viewport

1.0.2 • Public • Published

px to viewport


use

require('css-loader!px2viewport!./test.css')

{
  test: /\.css$/,
  use: [  
          'style-loader',
          'css-loader',
          'px2viewport
    }]
}

config

var opts = {
    viewportWidth: 750, //设计稿宽度 Design draft width
    viewportUnit: 'vw', //参考单位 Reference unit
    minPixelValue: 1, //最小不需要转换的值:1px min pixel not need transfer
    precision: 5 //最大支持小数位数 precision
};
require("css!px2viewport?"+JSON.stringify(opts)+"!./test.css")

Readme

Keywords

Package Sidebar

Install

npm i px2viewport

Weekly Downloads

0

Version

1.0.2

License

ISC

Unpacked Size

3.19 kB

Total Files

4

Last publish

Collaborators

  • asteryk