Socket
Book a DemoInstallSign in
Socket

@maxwellmri/bem

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@maxwellmri/bem

A small helper function for managing BEM classes.

0.3.4
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

bem

bem is a small helper function for managing BEM classes.

Install

npm install --save @maxwellmri/bem

Usage

bem can be used 3 ways.

  • With an array
const b = bem("Block");
b(["&__component"]) // returns Block__component
ub(["&__component", "&--modified"]) // returns Block__component Block--modifier
  • With an string
const b = bem("Block");
b("&__component") // returns Block__component
  • With an object (for conditional classes)
const b = bem("Block");
b({ "&__component": true, "&--disabled": false }) // returns Block__component
b({ "&__component": true, "&--disabled": true }) // returns Block__component Block--disabled
  • With multiple arguments
const b = bem("Block");
b(["&", "&--disabled"], "random") // returns Block Block--disabled random
b(["&", "&--disabled"], { "fizz": true, "buzz": false }) // returns Block Block--disabled fizz

Keywords

bem

FAQs

Package last updated on 18 Mar 2018

Did you know?

Socket

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.