Skip to content
This repository has been archived by the owner on Aug 19, 2019. It is now read-only.

Allow for users to specify element and modifier delimiters. #2

Closed
SethTompkins opened this issue Mar 21, 2016 · 6 comments
Closed

Allow for users to specify element and modifier delimiters. #2

SethTompkins opened this issue Mar 21, 2016 · 6 comments
Assignees

Comments

@SethTompkins
Copy link

First off, great package :)

The only thing that keeps me from using this is the hard-coded _ used to delimit modifiers. Traditional BEM syntax has modifiers delimited by two dashes, --.

In order to cater to more BEM flavors, it would be great to be able to set custom delimiters for the package.

@Guria
Copy link
Contributor

Guria commented Mar 21, 2016

@SethTompkins in fact this package represents traditional syntax, but what you mention is Harry Roberts' one. See https://en.bem.info/method/naming-convention/

@Guria
Copy link
Contributor

Guria commented Mar 21, 2016

@SethTompkins you can find useful bem-cn and some other similar projects

@deepsweet
Copy link
Member

hi.

first of all, "traditional" BEM syntax delimiters are underscores, everything else - BEM variations.

the only (pretty) way to implement this without headaches is to use some special process.env (and most likely we will do it so, because this feature request may be popular), but our original idea was to stop thinking in terms of delimiters and start using rebem-css. in that way you don't write delimteters by hands in any of the technologies in stack.

@Guria
Copy link
Contributor

Guria commented Mar 21, 2016

@deepsweet I like idea with process.env. We already have several projects with delimeters configured in runtime, like bem-cn. But we are really not often have such need.

@deepsweet
Copy link
Member

process.env.REBEM_MOD_DELIM and process.env.REBEM_ELEM_DELIM?

webpack config example:

plugins: [
    new webpack.DefinePlugin({
        'process.env': {
            REBEM_MOD_DELIM: JSON.stringify('--'),
            REBEM_ELEM_DELIM: JSON.stringify('~~')
        }
    })
]

@deepsweet deepsweet self-assigned this Mar 21, 2016
@SethTompkins
Copy link
Author

Sorry for my presumptuousness, and thanks for pointing me in the right direction.

deepsweet pushed a commit that referenced this issue Mar 22, 2016
* delimeters:
  ➕ add `REBEM_MOD_DELIM` and `REBEM_ELEM_DELIM` env vars (close #2)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants