Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bemmy

Package Overview
Dependencies
Maintainers
0
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bemmy

Dependency-free utility to compose CSS classnames following the BEM convention.

  • 1.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
110
decreased by-31.25%
Maintainers
0
Weekly downloads
 
Created
Source

bemmy

Dependency-free utility to compose CSS classnames following the BEM convention.

Installation

npm install bemmy

Usage

Basic examples

import bemmy from 'bemmy';

const bem = bemmy('component');

bem(); // block
// -> 'component'

bem('content'); // block + element
// -> 'component__content'

bem(null, 'tall'); // block + modifier
// -> 'component component--tall'

bem('content', 'tall'); // block + element + modifier
// -> 'component__content component__content--tall'

bem('content', { tall: true, green: false }); // modifier object
// -> 'component__content component__content--tall

bem('content', ['tall']); // modifier array
// -> 'component__content component__content--tall'

bem(null, null, 'some-class', 'another-class'); // additional classes
// -> 'component some-class another-class'

Keywords

FAQs

Package last updated on 24 Sep 2024

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

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc