File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -23,27 +23,27 @@ CSS Flat 将CSS样式格式化为单条样式,开发时只需要按照正常
23
23
```
24
24
Flat化之后:
25
25
``` css
26
- .-d-b {
26
+ .a -d-b {
27
27
display : block ;
28
28
}
29
- .-c-1 {
29
+ .a -c-1 {
30
30
color : red ;
31
31
}
32
- .-m-2 {
32
+ .a -m-2 {
33
33
margin : 0 auto ;
34
34
}
35
- .-c_h-3 :hover {
35
+ .a -c_h-3 :hover {
36
36
color : green ;
37
37
}
38
- .css-flat .-mt_h-4 :hover {
38
+ .css-flat .a -mt_h-4 :hover {
39
39
margin-top : 10px ;
40
40
}
41
41
```
42
42
当你在js文件中 import CSS Flat文件时,会export一个对象,该对象包含Flat化之后
43
43
的信息(className: newClassNames):
44
44
45
45
``` js
46
- import styles from " ./style.css" ; // { classNames: '-d-b -c-1 -m-2 -c_h-3 -mt_h-4 '}
46
+ import styles from " ./style.css" ; // { classNames: 'a -d-b a -c-1 a -m-2 a -c_h-3 a -mt_h-4 '}
47
47
// import { className } from "./style.css";
48
48
49
49
element .innerHTML = ' <div class="' + styles .className + ' ">' ;
@@ -101,7 +101,7 @@ flat后的样式公式如下:
101
101
| 属性 | 类型 | 默认值 | 描述 |
102
102
| ---------- | --- | --- | --- |
103
103
| ** ` htmlClass ` ** | ` {string} ` | ` 'css-flat' ` | 根节点类名,请自行在html标签上添加|
104
- | ** ` prefix ` ** | ` {string} ` | ` '' ` | 类名前缀|
104
+ | ** ` prefix ` ** | ` {string} ` | ` 'a ' ` | 类名前缀|
105
105
| ** ` declPropMap ` ** | ` {Object} ` | 见[ 属性映射] ( https://github.com/tangjinzhou/css-flat-loader/blob/master/src/declPropMap.js ) | 属性映射|
106
106
| ** ` pseudoMap ` ** | ` {Object} ` | 见[ 伪类映射] ( https://github.com/tangjinzhou/css-flat-loader/blob/master/src/pseudoMap.js ) | 伪类映射|
107
107
| ** ` atRules ` ** | ` {Array} ` | ` [] ` | @规则的映射,如@media 等,数组顺序代表权重|
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " css-flat-loader" ,
3
- "version" : " 0.1.6 " ,
3
+ "version" : " 0.1.7 " ,
4
4
"author" : " tangjinzhou" ,
5
5
"description" : " css flat loader module for webpack" ,
6
6
"engines" : {
You can’t perform that action at this time.
0 commit comments