bemto-components icon indicating copy to clipboard operation
bemto-components copied to clipboard

Configuration of the bem syntax

Open kizu opened this issue 7 years ago • 0 comments

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:

  1. The bemto.setSyntax() (what other names for the method there could be? How the arguments should look like?)

  2. 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.

kizu avatar Oct 30 '17 10:10 kizu