Wondering what’s next for npm?Check out our public roadmap! »

    bem-modifiers

    1.1.0 • Public • Published

    bemcx

    Simple utility inspired by classnames that glues bem classes with --modifiers.

    Basic usage:

    bemCx('some-block__some-element', modifiers, otherClasses);

    ...where modifiers & otherClasses can be:

    • string
    • array of strings
    • cx-style map of booleans: {modifier: condition, modifier2: condition}

    See tests for use cases.

    Example:

    bemCx('block__lem', ['modifier-a', {'modifier-B': true}], 'other-class')
    //will result in:
    //'block_lem block_lem--modifier-a block_lem--modifier-B other-class'

    Install

    npm i bem-modifiers

    DownloadsWeekly Downloads

    21

    Version

    1.1.0

    License

    MIT

    Unpacked Size

    19.1 kB

    Total Files

    7

    Last publish

    Collaborators

    • avatar