W3Cschool
恭喜您成為首批注冊用戶
獲得88經驗值獎勵
理想上,任何?CSS 規(guī)則集之前都應該使用 C 風格注釋來解釋 CSS 塊的核心。這個注釋也要記錄對規(guī)則集特定部分編號的解釋。比如:
/**
* Helper class to truncate and add ellipsis to a string too long for it to fit
* on a single line.
* 1\. Prevent content from wrapping, forcing it on a single line.
* 2\. Add ellipsis at the end of the line.
*/
.ellipsis {
white-space: nowrap; /* 1 */
text-overflow: ellipsis; /* 2 */
overflow: hidden;
}
基本上,任何不能明顯看出意義的地方都應該注釋,但不要隨處注釋。記住不要注釋太多,掌握尺度讓每一處注釋都有意義。
當注釋 Sass 的一個特定部分時,應該使用 Sass 單行注釋而不是 C 風格的注釋塊。這么做將不會輸出注釋,即使是在開發(fā)時的擴展模式。
// Add current module to the list of imported modules.
// `!global` flag is required so it actually updates the global variable.
$imported-modules: append($imported-modules, $module) !global;
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網安備35020302033924號
違法和不良信息舉報電話:173-0602-2364|舉報郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: