a fis3 plugin for px2rem
fis3-preprocessor-px2rem
![Dependency Status](https://camo.githubusercontent.com/767b6c0122fee0a00a08653e61566ae519e87c0bb23376e6be5cd3bbd1178634/68747470733a2f2f64617669642d646d2e6f72672f4d726c756f626f2f666973332d70726570726f636573736f722d70783272656d2e7376673f7468656d653d736869656c64732e696f)
This is a FIS3 plugin for px2rem.
Run npm install fis3-preprocessor-px2rem
fis.match('test.css', {
preprocessor: fis.plugin('px2rem',{
designWidth: 640
})
})
{
designWidth: 640 // designWidth , 640 defult
}
One raw stylesheet: test.css
.selector {
width: 150px;
height: 64px; /*px*/
font-size: 28px; /*px*/
border: 1px solid #ddd; /*no*/
}
Rem version: test.debug.css
.selector {
width: 2rem;
border: 1px solid #ddd;
}
[data-dpr="1"] .selector {
height: 32px;
font-size: 14px;
}
[data-dpr="2"] .selector {
height: 64px;
font-size: 28px;
}
[data-dpr="3"] .selector {
height: 96px;
font-size: 42px;
}
MIT © 2015 mrluobo ([email protected])