1.0.0 • Published 7 years ago

fis3-packager-rem v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

fis3-parser-rem

fis3 对px单位的css属性自动转化为rem为单位的fis插件。基于rem的解决方案rem-core的二次开发。


- 使用node-css把css解析后,对px为单位对属性进行rem转换处理。
- 对文字进行特殊处理追加至产出的css文件之后。
- developer只用专注开发,配置灵活方便, 对原始文件无侵入。

flexible.js

默认可以配合淘宝的flexible.js使用

fis配置

fis.match('*.css', {
    parser: fis.plugin('rem', {
        dpr: 2,
        rem: 750,
        exclude: ['background-size']
    })
})

Usage

body {
    border-top: 1px;
    border-bottom: 10px;
    padding: 10px; /* @norem */
    background-size: 10px 10px;
}

输出:

body {
    border-top: 1px;
    border-bottom: 0.5557rem;
    padding: 10px;
    background-size: 0.5557rem 0.5557rem;
}

changelog

1.0.0

7 years ago