Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] CSS Basic architecture #2

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

bblurock
Copy link
Contributor

Preview: here

@bblurock bblurock force-pushed the front-end-BEM-draft branch from 32673ab to aea5ae9 Compare October 15, 2014 10:41
@bblurock bblurock force-pushed the front-end-BEM-draft branch from 5c86154 to 916844e Compare October 16, 2014 08:10
@bblurock bblurock force-pushed the front-end-BEM-draft branch from 916844e to 758e7bb Compare October 16, 2014 09:51
@bblurock
Copy link
Contributor Author

@LeoOnTheEarth 永來我更新了 CSS syntax 的部分

@asika32764
Copy link
Contributor

英文的那一段有要轉成中文嗎?

Coding Standards 已經拖太久囉,這一兩週要趕快結束掉

@bblurock
Copy link
Contributor Author

目前想寫的都寫進去了,昨天新增 single/multi class pattern。

今天會把 BEM 的部分翻成中文,應該就大功告成。

請大家這兩日抽空閱讀中文的部分,看有什麼問題。

```
在 "single-class" 中,同樣的 style 被定義在多個 classes 上,好處是 html 的元素只需使用單一的 class。

### "multi-class" 模式
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

要討論就是留言了就可以討論了

@asika32764
Copy link
Contributor

該繼續囉

<img src="images/blocks-example.png" alt="Blocks example" style="width: 200px;"/>

##### 命名規則
Block 的命名方式很簡單。只要其命名是具有意義且可以自我說明 (self-explaining) 的即可。必要的話可以以破折號 (dash) 隔開,也有使用駝峰式命名的做法 [[10]],待討論。
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

這裡需要討論:

如果命名太長,使用駝峰式命名或是一個 dash隔開。

因為 BEM 中 object 和 element 是用雙底線隔開 ex: text-field__label,如果用 dash 就會看起來比較亂;

如果是用駝峰則是這種寫法 textField__label 比較簡潔。

請投票!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

駝峰的麻煩在於需要多按一次鍵盤,駝峰跟底線在一起時你寫程式一整天會很想死

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants