Components may have variants. Elements may have variants, too.
元件可以有多樣的變化,元素當然也有,我們這邊稱為變種。
Classnames for variants will be prefixed by a dash (-
).
變化的名稱前須加上分號(-)作為前綴詞。
.like-button {
&.-wide { /* ... */ }
&.-short { /* ... */ }
&.-disabled { /* ... */ }
}
Elements may also have variants.
元素也會有變種。
.shopping-card {
> .title { /* ... */ }
> .title.-small { /* ... */ }
}
Dashes are the preferred prefix for variants.
對於變種,分號是較好的前綴用法。
_
or -
.gcc -O2 -Wall -emit-last
).gcc -O2 -Wall -emit-last
)。How do you deal with complex elements? Nest them.
遇到複雜的元素該如何處理呢? 將它們巢狀化吧!
Continue →