BEM is nice, but some may be irked at its unconventional syntax. RSCSS pretty much follows BEM conventions, only with a different syntax.
BEM是個不錯的選擇,但有些人可能會對於他的非常規的語法覺得很煩。 RSCSS 幾乎照著 BEM 的規則,只有語法上的不同。
<!-- BEM -->
<form class='site-search site-search--full'>
<input class='site-search__field' type='text'>
<button class='site-search__button'></button>
</form>
<!-- rscss -->
<form class='site-search -full'>
<input class='field' type='text'>
<button class='button'></button>
</form>
The same concepts exist in similar ways in other CSS structuring ideologies.
在其他 CSS 架構設計概念也存在著類似的方法。
RSCSS | BEM | SMACSS |
---|---|---|
Component | Block | Module |
Element | Element | Sub-Component |
Layout | ? | Layout |
Variant | Modifier | Sub-Module & State |