Skip to content

Commit 74373ce

Browse files
committed
feat: add CSS BEM
1 parent d2a89d4 commit 74373ce

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
## 规范
3737

3838
- [x] 使用 ESLint 作为编码规范。
39-
- [ ] 使用 CSS bem 规范。
39+
- [x] 使用 CSS bem 规范。
4040
- [x] 使用 Angular Commit 规范。
4141

4242
## 项目目录

components/button/src/button.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<button
33
:disabled="disabled"
4-
class="button"
4+
class="demo__button_primary"
55
>
66
<slot />
77
</button>

components/button/src/style.scss

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
.button {
2-
display: inline-block;
3-
cursor: pointer;
4-
user-select: none;
5-
height: 32px;
6-
padding: 0 15px;
7-
font-size: 14px;
8-
color: red;
1+
.demo {
2+
&__button {
3+
&_primary {
4+
display: inline-block;
5+
cursor: pointer;
6+
user-select: none;
7+
height: 32px;
8+
padding: 0 15px;
9+
font-size: 14px;
10+
color: green;
11+
}
12+
}
913
}

0 commit comments

Comments
 (0)