fisp-parser-rem

0.0.3 • Public • Published

fisp-parser-rem

fisp 对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: 75,
        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

版本 类型 说明
v0.0.8 Feature 添加原始值
v0.0.7 Bugfixed 全局选择器问题

Package Sidebar

Install

npm i fisp-parser-rem

Weekly Downloads

4

Version

0.0.3

License

MIT

Last publish

Collaborators

  • neverland