0.1.2 • Published 3 years ago

@bem-modules/bem v0.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

@bem-modules/bem

npm i @bem-modules/bem

Class name generation helper.

May be used separately from the rest of the project, yet with weaker type checking.

const b = bem('block');

b() // 'block'
b('element') // 'block__element'
b({bool: true}) // 'block _bool'
b({bool: false}) // 'block'
b({camelCase: true}) // 'block _camel-case'
b({foo: 'bar'}) // 'block _foo_bar'
b('element', {camelCase: true}) // 'block__element _camel-case',
b('element', {bool: true}) // 'block__element _bool'
b('element', {bool: false}) // 'block__element'
b('element', {foo: 'bar'}) // 'block__element _foo_bar'

See root package for documentation. See example package for full usage example.