Skip to content
This repository has been archived by the owner on Dec 22, 2023. It is now read-only.

Configuration of the bem syntax #13

Open
kizu opened this issue Oct 30, 2017 · 0 comments
Open

Configuration of the bem syntax #13

kizu opened this issue Oct 30, 2017 · 0 comments

Comments

@kizu
Copy link
Member

kizu commented Oct 30, 2017

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 Add a way to mark the block-creating context #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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant