bemto-components
bemto-components copied to clipboard
Configuration of the bem syntax
Right now the only supported syntax is the original BEM: __
for elements and _
for modifiers. It would be nice to have some ways to configure this. We can have at least two variants:
-
The
bemto.setSyntax()
(what other names for the method there could be? How the arguments should look like?) -
The inline method, similar to #12: whenever there is a trailing modifier/element delimiter, it would be treated as the syntax that should be used for the generating the className. For example,
bemto('.myBlock--')
would set the modifiers to have the--
delimiter.bemto('.myBlock-')
would set the element modifier to be-
.Note that you can't use both of those, so I think the best would be also to add the same to the element declaration: the prefix for the name would be stripped and treated as an element delimiter:
Block.elem('-Elem')
would set the delimiter for this element to-
, etc.