1.0.4 • Published 6 years ago

bemb v1.0.4

Weekly downloads
4
License
MIT
Repository
github
Last release
6 years ago

bemb

/'bembɪ/

tiny BEM utility library

API

There are three methods getElement, getModifier, createBlock

getElement

Return you proper element class in BEM notation

getElement('block', 'element') // block__element

Default separator is "__" but this could be changed with third parameter

getElement('block', 'element', '--') // block--element

getModifier

Return you proper modifier class in BEM notation

getModifier('block__element', 'modifier') // block__element_modifier

Default separator is "_" but this could be changed with third parameter

getModifier('block__element', 'modifier', '-') // block__element-modifier

createBlock

Returns object with three methods getElement, getModifier, setDivs

var block = createBlock('b');
block.getElement('e'); // b__e
block.getModifier('m'); // b_m
block.getModifier('m', 'e') // b__e_m
block.setDivs('--', '-');
block.getModifier('m', 'e') // b--e-m
1.0.4

6 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago