1.2.0 • Published 7 years ago

create-bem v1.2.0

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

Create BEM

Provides a simple API for generating BEM like class names.

Installation

Install using the NPM:

npm install -S create-bem

Usage Example

A simple use case in a ReactJS component:

import React from 'react';
import createBEM from 'create-bem';

let bem = createBEM('Modal');

const Modal = ({ children, title, open }) => (
  <div className={ bem.md('open', open) }>
    <div className={ bem.el('heading').md('warning') }>{ title }</div>
    <div className={ bem.el('body') }>{ children }</div>
  </div>
);

And this component will get those CSS class names, according to the properties:

Modal
Modal Modal--open
Modal__heading Modal__heading--warning
Modal__body

License

MIT

1.2.0

7 years ago

1.1.3

8 years ago

1.1.2

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.0

8 years ago