.red { color: red; }
.leftBar { float: left; }
當需求變更(紅字改藍、左欄移右),類名失去語意,維護困難。
/* 結構與功能導向 */
#navigation { ... }
.sidebar { ... }
.post-wrap { ... }
/* 通用工具類(外觀固定不變) */
.align-left { float: left; margin-right: 20px; }
.align-right { float: right; text-align: right; margin-left: 20px; }
.clearfix::after { content: ""; display: table; clear: both; }
.btn-primary、.card-title。is-、has- 開頭:.is-active、.has-error。