fis-parser-rem
fis px自动转化成rem插件
Last updated 4 years ago by imweb .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install fis-parser-rem 
SYNC missed versions from official npm registry.

fis-parser-rem

fis px自动转化成rem插件

fis.conf

CSS

fis.match('*.css', {
    parser: [ 
        fis.plugin('rem')
    ]
})

SCSS

fis.match('*.scss', {
    rExt: '.css',
    parser: [ 
        fis.plugin('node-sass'),
        fis.plugin('rem')
    ]
})

Usage

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

输出:

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

Option

  • rem {Number} 1rem=多少px default 18
  • min {Number} 最小转化值 default 3
  • exclude {Array.<String>} 忽略的样式 default ['width', 'height', 'background', 'background-size']

Question

  • 如何忽略整个文件? 在文件头添加/* @norem */即可

Current Tags

  • 0.0.2                                ...           latest (4 years ago)

2 Versions

  • 0.0.2                                ...           4 years ago
  • 0.0.1                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |