.widget {
padding: 10px;
border: 1px solid #BADA55;
background-color: #C0FFEE;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
.widget-heading {
font-size: 1.5rem;
line-height: 1;
font-weight: bold;
color: #BADA55;
margin-right: -10px;
margin-left: -10px;
padding: 0.25em;
}
.widget-heading 多一級縮排,明確表達它是 .widget 子元素。聲明按「字體屬性 → 色彩 → 盒模型微調」順序,符合行內元素樣式邏輯。
高重複、單一屬性的工具類群組,單行更緊湊易掃描:
.t10 { width: 10%; } .t20 { width: 20%; } .t25 { width: 25%; } /* 1/4 */
.t30 { width: 30%; } .t33 { width: 33.333%; } /* 1/3 */
.t40 { width: 40%; } .t50 { width: 50%; } /* 1/2 */
.t60 { width: 60%; } .t66 { width: 66.666%; } /* 2/3 */
.t70 { width: 70%; } .t75 { width: 75%; } /* 3/4 */
.t80 { width: 80%; } .t90 { width: 90%; }
此為 inuit.css 表格網格系統片段,單行呈現數學規律,維護極便利。
.block__element--modifierjs-,樣式類嚴禁綁定 JS 行為