Skip to content

bem.elementSeparator

Evgenii Koriakin edited this page Oct 12, 2015 · 10 revisions

Version added: 1.0.0

Summary

The separator that is used for separating the name of the block from the name of the element.

Description

By default in the BEM methodology for separating the name of the block from the name of the element the string "__" is used. This field allows to override this behavior and use any other character(s) as a separator.

Default value

Value: '__'

Returns

Type: String

Examples

Creates a CSS class of the element with the default separator:

Code:

var elementCssClass = bem.element('product', 'name');

Result:

'product__name'

Creates a CSS class of the element with a custom separator:

Code:

bem.elementSeparator = '--';
var elementCssClass = bem.element('product', 'name');

Result:

'product--name'

Clone this wiki locally