Skip to content

Commit 0c83dd3

Browse files
committed
默认prefix
1 parent 29d18d1 commit 0c83dd3

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,27 +23,27 @@ CSS Flat 将CSS样式格式化为单条样式,开发时只需要按照正常
2323
```
2424
Flat化之后:
2525
```css
26-
.-d-b {
26+
.a-d-b {
2727
display: block;
2828
}
29-
.-c-1 {
29+
.a-c-1 {
3030
color: red;
3131
}
32-
.-m-2 {
32+
.a-m-2 {
3333
margin: 0 auto;
3434
}
35-
.-c_h-3:hover {
35+
.a-c_h-3:hover {
3636
color: green;
3737
}
38-
.css-flat .-mt_h-4:hover {
38+
.css-flat .a-mt_h-4:hover {
3939
margin-top: 10px;
4040
}
4141
```
4242
当你在js文件中 import CSS Flat文件时,会export一个对象,该对象包含Flat化之后
4343
的信息(className: newClassNames):
4444

4545
```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 '}
4747
// import { className } from "./style.css";
4848

4949
element.innerHTML = '<div class="' + styles.className + '">';
@@ -101,7 +101,7 @@ flat后的样式公式如下:
101101
| 属性 | 类型 | 默认值 | 描述 |
102102
| ---------- | --- | --- | --- |
103103
|**`htmlClass`**|`{string}`|`'css-flat'`|根节点类名,请自行在html标签上添加|
104-
|**`prefix`**|`{string}`|`''`|类名前缀|
104+
|**`prefix`**|`{string}`|`'a'`|类名前缀|
105105
|**`declPropMap`**|`{Object}`|[属性映射](https://github.com/tangjinzhou/css-flat-loader/blob/master/src/declPropMap.js)|属性映射|
106106
|**`pseudoMap`**|`{Object}`|[伪类映射](https://github.com/tangjinzhou/css-flat-loader/blob/master/src/pseudoMap.js)|伪类映射|
107107
|**`atRules`**|`{Array}`|`[]`|@规则的映射,如@media等,数组顺序代表权重|

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "css-flat-loader",
3-
"version": "0.1.6",
3+
"version": "0.1.7",
44
"author": "tangjinzhou",
55
"description": "css flat loader module for webpack",
66
"engines": {

0 commit comments

Comments
 (0)