purebem-js
A BEM CSS methodology utility helper
A simple JavaScript utility for creating BEM standard CSS class names. This is a stricter cousin of purebem.
Install
To install the stable version:
npm install --save purebem-js
Usage
Import module
; const element = ; // Define a block.;// 'my-block' // Define a block with modifier(s) using an object.;// 'my-block my-block--modifier' ;// 'my-block my-block--camel-case' // Define a block with modifier(s) using an array.
API
purebem(block: string/number) -> ([ modifiers: array/object ]) -> string
purebem(block: string/number) -> ([ element: string/number [, modifiers: array/object ] ]) -> string
The purebem
takes one argument and returns a function taking multiple arguments.
block
Type: string
or number
The block name.
element
Type: string
or number
The element name.
modifiers
Type: array
or object
.
The modifiers.
License
MIT