Socket
Socket
Sign inDemoInstall

easy-bem

Package Overview
Dependencies
0
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    easy-bem

Easy BEM class name generator


Version published
Weekly downloads
156K
decreased by-9.12%
Maintainers
1
Install size
4.05 kB
Created
Weekly downloads
 

Readme

Source

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'

Keywords

FAQs

Last updated on 28 Feb 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc