-
-
Save ximan/9827642 to your computer and use it in GitHub Desktop.
BEM改进版
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 既然大家接受不了BEM那种严格模式,那么就尝试一下BEM改进版。 | |
| * 不允许有标签没有类名,既所有标签必须有类名 | |
| * 按照模块来取名,而不是项目来取名 | |
| * 单词或缩写之间,用`-`连接。模块(block)里面都是元素(element),请用`_`连接,且只能连一次,例如`.hot-buy_search-box`。如果有状态(modifier),请在后面用`_`连接,例如`.header_search-box_current`。类名最多只能出现两个`_`。 | |
| 示例html结构: | |
| <div class="hot-buy"> | |
| <ul class="hot-buy_tab-title"> | |
| <li class="hot-buy_tab-title-item hot-buy_tab-title_current">TAB1</li> | |
| <li class="hot-buy_tab-title-item">TAB2</li> | |
| </ul> | |
| </div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
我测试下
你的