easy-bem
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

Easy BEM class name generator

Simple and fast BEM class names generator.

NPM

Fork of bem-cn-fast that uses another delimiters (personally I like them more):

  • The element name is separated from the block name by a double underscore (__)
  • The modifier name is separated from the block or element name by a double dash (--)
  • The modifier value is separated from the modifier name by a single underscore (_)

Install

npm install --save easy-bem
yarn add easy-bem

Usage

import bem from 'easy-bem';
const b = bem('block');

b(); // -> 'block'
b('element'); // -> 'block__element'
b({ mod1: true, mod2: 'some-value' }); // -> 'block--mod1 block--mod2_some-value'
b('element', { mod1: true }); // -> 'block__element--mod1'

Readme

Keywords

Package Sidebar

Install

npm i easy-bem

Weekly Downloads

144,386

Version

1.1.1

License

MIT

Unpacked Size

3.34 kB

Total Files

4

Last publish

Collaborators

  • norserium