-
Notifications
You must be signed in to change notification settings - Fork 0
bem.elementModifier()
- bem.elementModifier(blockName, elementName, modifier)
- bem.elementModifier(blockName, elementName, modifierName, modifierValue)
- bem.elementModifier(blockName, elementName, modifiers)
Version added: 1.0.0
Creates a CSS class of the element's modifier.
A CSS class of the element's modifier.
Type: String
blockName
The name of the block.
Type: String
elementName
The name of the element.
Type: String
modifier
One or more modifiers, separated by a space.
Type: String
Creates a CSS class of the element's modifier using the name of the block, the name of the element and a string of modifiers:
Code:
var elementModifierCssClass = bem.elementModifier(
'product',
'name',
'is-selected is-focused size_xs'
);
Result:
'product__name_is-selected product__name_is-focused product__name_size_xs'
Version added: 1.0.0
Creates a CSS class of the element's modifier.
A CSS class of the element's modifier.
Type: String
blockName
The name of the block.
Type: String
elementName
The name of the element.
Type: String
modifierName
The name of the modifier.
Type: String
modifierValue
The value of the modifier.
Type: String
Creates a CSS class of the element's modifier using the name of the block, the name of the element, the name of the modifier and the value of the modifier:
Code:
var elementModifierCssClass = bem.elementModifier('product', 'name', 'size', 'xs');
Result:
'product__name_size_xs'
Version added: 1.0.0
Creates a CSS class of the element's modifier.
A CSS class of the element's modifier.
Type: String
##Parameters
blockName
The name of the block.
Type: String
elementName
The name of the element.
Type: String
modifiers
A list of modifiers.
Type: Array
Creates a CSS class of the element's modifier using the name of the block, the name of the element and a list of modifiers:
Code:
var elementModifierCssClass = bem.elementModifier(
'product',
'name',
[{ name: 'is-selected' }, { name: 'is-focused' }, { name: 'size', value: 'xs' }]
);
Result:
'product__name_is-selected product__name_is-focused product__name_size_xs'
bem.elementSeparator
bem.modifierSeparator
bem.modifierValueSeparator
bem.block()
bem.blockModifier()
bem.element()
bem.elementModifier()
bem.getBlock()
bem.getElement()
jQuery.fn.addModifier()
jQuery.fn.blockName()
jQuery.fn.elementName()
jQuery.fn.getBlock()
jQuery.fn.getElement()
jQuery.fn.hasModifier()
jQuery.fn.isBlock()
jQuery.fn.isElement()
jQuery.fn.modifierValue()
jQuery.fn.removeModifier()