Self adaption plugin for mobile development
npm install px2rem.scssSelf adaption plugin for mobile development.
```
npm install px2rem.scss --save
1. In html
tag, add viewport and designBaseWidth,as below:`html
demo
`2. import
px2rem.config.min.js file,`html
demo
`> Notice:this plugin need calculate the html tag base
font-size before dom rendering,otherwise web page will initial depend on font-size:16px to calculate rem value,this will cause page to rerender and repain.3. Before you use
mixins in px2rem.scss, plz import firstly:`scss
@import 'path/to/px2rem.scss';html {
@include font-dpr(16px);
@include px2rem(width, 320px);
}
`Remarks
px2rem.scss provide two sass mixin:`
font-dpr - calculate font size
px2rem - convert px to rem
`> Notice:The default base font size is
16px` for html.MIT