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.0
  • 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, 'disabled') // block + modifier
// -> 'component component--disabled'

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

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

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

bem('content', { tall: false, green: undefined, wide: true custom: 1 > 2 }) // dynamic modifiers
// -> 'component__content component__content--wide'

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

Keywords

FAQs

Package last updated on 18 Jul 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