Skip to content

bem.modifierSeparator

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

Version added: 1.0.0

Summary

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

Description

By default in the BEM methodology for separating the name of the block or element from the name of the modifier the character "_" 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', 'size_xs');

Result:

'product__name product__name_size_xs'

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

Code:

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

Result:

'product__name product__name-size_xs'

Clone this wiki locally