ycss 正在参加 2020 年度 OSC 中国开源项目评选,请投票支持!
ycss 在 2020 年度 OSC 中国开源项目评选 中已获得 {{ projectVoteCount }} 票,请投票支持!
授权协议: MIT
开发语言: Google Go
操作系统: 跨平台
收录时间: 2019-11-29
提 交 者: jiukerman

通过ycss,用户只需要写 class 名字就可以自动处理生成 css 代码。

# ycss
Only one configuration is needed, you can automatically complete your own style of CSS code!
You just need to write class, CSS is generated by us!
# Required
* go version>=1.13
# How To Run
* go build -o ycss main.go
* ./ycss
# Config
## Features
* write config will work immediately
## Field
         "debug": true, // debug mod
         "type": "rn", // rn|vue
         "common": ["./res/regexp/common/rn.reg"],// reg dir
         "single": ["./res/regexp/single/rn.reg"],// single dir
         "outUnit": "upx", // out unit,will work in vue
         "zoom": 1.4, // value zoom,if px need to rem;
         "needZoomUnit": "px|rem", // vaule unit will zoom,if not match will do nothing 
         "reg": ["GetStyle\\(\"([^\"]+)\""],// how to find your class,eq:class="w-15"
         "watchDir": ["./res/sample/rn"],// watch dir to do
         "oldCssReg": "/\\* Automatic generation Start \\*/([^/]+)/\\*", // both vue and rn do as <xxxx start> (auto code) <xxx end>,if not match do nothing;
         "keyNeedZoom": [ // will work in rn,if value need zoom ,please set it
# Reg
## Common
Common is an intermediary mechanism, which can be understood as a container
  w-15-h-20{w-15 h-20 pl-10}
* key is the regexp
* value $1,$2 mean regexp match value,w-($1)-h-($2)
## Single
Single is the most basic style expression
### Vue
* key is the regexp
* value $1,$2 mean regexp match value,w-($1)-h-($2)
### RN
Why do like -1,-2?
-1,-2 is a special value and can keep the original data type
* key is the regexp
* value -1,-2 mean regexp match value,w-(-1)-h-(-2),-1,-2,-3,-4,-5,-6 also can work
# example
CSS is automatically generated and can be configured! Can achieve a frame effect, this is your own frame!
The default rule is demo, and you can write your own structure.
## /res/sample
        <div class="bc-ff1123"></div>
        <div class="bc-000-112-231 br-nr bp-c bs-c bs-10-15"></div>
        <div class="b-1-001 br-1-123 o-1-000121 c-fff ls-12 lh-20"></div>
        <div class="ta-c ta-r ta-l"></div>
        <div class="fs-20 fw-100"></div>
        <div class="m-1010 p-0505 h-10 w-20 h10 w10"></div>
        <div class="maxh-23 maxw-10 minh-10 minw-22"></div>
        <div class="p-f p-a p-r d-b t-2 b-1 l-3 r-40 va-m zi-205"></div>
        <div class="mt-10 ml-10 mr-10 mb-10"></div>
        <div class="pt-10 pl-10 pr-10 pb-10 br-1"></div>
        <div class="d-f fd-r ai-c jc-c ai-c fw-nw f-21 test1"></div>
            width: 10px;
        /* Automatic generation Start */
    .bs-10-15{background-size:20px 30px;}
    .b-1-001{border:2px solid #001;}
    .br-1-123{border-right:2px solid #123;}
    .o-1-000121{outline:#000121 dotted 2px;}
    .m-1010{margin:20px 20px;}
    .p-0505{padding:10px 10px;}
    .d-f{display: -webkit-flex;
        display: flex;}
    /* Automatic generation End */
# QQ
* 941057162

* Support Global Value To Set
* Support Load Or Write Target file or dir


的 Gitee 指数为
超过 的项目

ycss 的相关资讯

ycss 的相关博客


《Meteor全栈开发》 链接: https://pan.baidu.com/s/17ryI2P90XZTyvzcCIwGxLg 密码: vyfg 《React全栈:Redux+Flux+webpack+...

ycss 的相关问答


评论 (0)

0 评论
12 收藏