Closed borodean closed 8 years ago
Hi, borodean! It may seem cleaner at first glance, however it looks more confusing in production code. See - single underscore used with descendant classes, i.e. ".parent_child", so it doesn't fit with "_modifier" naming. There are some methodologies, using inverse naming logic, however MCSS used to stick with present one.
MCSS doesn't force everyone to use specific naming syntax, the main part is about sticking to common rules and separate different types of selectors, blocks ant etc. There are other naming conventions that could be used with MCSS. like:
.block__element
.block__element_mod
.block_element
.block_elemennt--mod
We need to leave something easy noticeable to put the focus on blocks modifiers. As they're used not so often highlighting them with double underscore won't affect overall cleanliness of the code in most cases.
MCSS allows two different notations for modifiers:
In the short one double underscore
__
is used, which seems to originate from the long notation. However, I thought that the single underscore_
at the beginning of the name is enough to distinguish modifiers from another kinds of classes and looks a bit cleaner: