1.0.3 • Published 4 years ago

px2vwh-loader v1.0.3

Weekly downloads
6
License
MIT
Repository
github
Last release
4 years ago

This is a tool to convert px to vh vw

This is a tool to convert px to vh vw based on media query results,

Usually px will be converted to vh, if the screen ratio is 16/9, px will be converted to vw

The purpose of this is to try to keep the page as original as possible when the screen ratio changes.

install:

npm i px2vwh-loader

or

yarn add px2vwh-loader

config:

webpack:

module: {
  rules: [{
    test: /\.(sc|sa)ss$/,
    loader:'px2vwh-loader',
      query:{
        uiHeight:737,
        uiWidth:1283,
        decimal:3
      }
  }]
}

webpack-chain:

config.module
      .rule('px2vwh')
      .test( /\.(sc|sa)ss$/)
      .use('px2vwh-loader')
      .loader('px2vwh-loader')
      .options({
        uiHeight:737,
        uiWidth:1283,
        decimal:3
      })
      .end()
1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago