All Projects → younth → fis-postprocessor-px2rem

younth / fis-postprocessor-px2rem

Licence: other
fis3 plugins for px2rem when we use rem for mobile flexbox

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to fis-postprocessor-px2rem

material2-admin
Angular - Material2 - Redux - Flex - Admin Example - Starter
Stars: ✭ 13 (-40.91%)
Mutual labels:  flex
flexui
A light UI for C++ with XML and CSS support
Stars: ✭ 21 (-4.55%)
Mutual labels:  flex
vue-flex-waterfall
🌊 A horizontal sorting waterfall layout component for Vue.js, realized by flex layout
Stars: ✭ 27 (+22.73%)
Mutual labels:  flex
px2rem.scss
Self adaption plugin for mobile development.
Stars: ✭ 18 (-18.18%)
Mutual labels:  px2rem
flex-bison-indentation
An example of how to correctly parse python-like indentation-scoped files using flex (and bison).
Stars: ✭ 32 (+45.45%)
Mutual labels:  flex
bit-css
用原子类赋予元素属性,减少甚至不写css
Stars: ✭ 19 (-13.64%)
Mutual labels:  flex
flexboxes
CSS flexbox framework with pure flexbox grid ability
Stars: ✭ 27 (+22.73%)
Mutual labels:  flex
alipay-vue
蚂蚁金服小程序(alipay hybrid) 基于 vuejs 的 template
Stars: ✭ 13 (-40.91%)
Mutual labels:  flex
react-styled-flexbox
A Flexbox React component harnessing the power of styled-components
Stars: ✭ 30 (+36.36%)
Mutual labels:  flex
vue-layout-system
A pack of Vue components that solve daily layout problems
Stars: ✭ 31 (+40.91%)
Mutual labels:  flex
Flex-AntiCheat
Flex AntiCheat - Optimized Configs For Multiple AntiCheats
Stars: ✭ 37 (+68.18%)
Mutual labels:  flex
language-grammars
Syntax highlighting for ABNF/BNF/EBNF, Yacc, and other language-related languages.
Stars: ✭ 14 (-36.36%)
Mutual labels:  flex
icon-generator
Generate icons and launch screens for your Adobe AIR projects.
Stars: ✭ 24 (+9.09%)
Mutual labels:  flex
px2rem
convert px to rem in webpack
Stars: ✭ 21 (-4.55%)
Mutual labels:  px2rem
gulp-px2rem
This is a gulp plugin for node-px2rem.
Stars: ✭ 19 (-13.64%)
Mutual labels:  px2rem
Decaf-Compiler
Compiler for Decaf Programming Language
Stars: ✭ 36 (+63.64%)
Mutual labels:  flex
simpPRU
Intuitive language for PRU which compiles down to PRU C
Stars: ✭ 54 (+145.45%)
Mutual labels:  flex
chirp
Interpreter in C for rockstar programing language
Stars: ✭ 20 (-9.09%)
Mutual labels:  flex
compiler
Implementing a complete Compiler for a simple C-like language using the C-tools Flex and Bison
Stars: ✭ 106 (+381.82%)
Mutual labels:  flex
NatLang
NatLang is an English parser with an extensible grammar
Stars: ✭ 20 (-9.09%)
Mutual labels:  flex

fis-postprocessor-px2rem

fis3/fis px 自动转为 rem 插件,提高源码可维护性

安装

  • npm i -g fis-postprocessor-px2rem
  • 修改 fis-conf.js
    fis.match('*less', {
        postprocessor: fis.plugin('px2rem', {
            remUnit: 75
        })
    });
    

用法

  • 该插件要配合基于rem的flex布局方案使用,推荐大家用手淘的lib-flexible
  • 通过增加注释判断转换类型,主要有:
    1. 默认所有的px都会转为rem
    2. /*no*/ 不转换,常用于 1px的处理
    3. /*px*/ 强制使用px,即不适配,各个分辨率看到的大小一样,字体通常会用到。

参数

    {
        baseDpr: 2,             // dpr基准
        remUnit: 75,            // rem 基准,由设计稿决定
        remPrecision: 6         // rem 精确位数
    }

Example

Pre processing:

One raw stylesheet: test.css

.selector {
    width: 150px;
    height: 64px; /*px*/
    font-size: 28px; /*px*/
    border: 1px solid #ddd; /*no*/
}

After processing:

Rem version: test.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;
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].