BEM和SUIT CSS命名约定之间的区别

前端之家收集整理的这篇文章主要介绍了BEM和SUIT CSS命名约定之间的区别前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
@H_502_1@BEMSUIT CSS命名约定之间有什么区别?

解决方法

根据bem.info( source):

We use hyphen to separate words in long names […] and two underscores to separate the name of the block form the name of the element […]

But you can use any other separators for it.

因此,可以使用另一种语法的BEM. SUIT CSS的语法是BEM的有效替代语法.

此外,Nicolas Gallagher将块(BEM)重命名为组件(SUIT),将元素(BEM)重命名为后代(SUIT).

Is one better suited for certain types of projects the other?

如果您计划使用完整的BEM方法(参见this article的示例),包括Yandex的工具,那么请保留原始的BEM约定.

否则,这取决于您的偏好.

原文链接:https://www.f2er.com/css/215367.html

猜你在找的CSS相关文章