bem

bemb

BEM util library

Showing:

Popularity

Downloads/wk

5

GitHub Stars

0

Maintenance

Last Commit

1yr ago

Contributors

1

Package

Dependencies

0

License

MIT

Type Definitions

Tree-Shakeable

Yes?

Categories

Readme

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

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial