# bem-modifiers

> cx-like utility for creating bem modifier classes

Latest version **1.1.0** (published 2020-12-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install bem-modifiers
pnpm add bem-modifiers
yarn add bem-modifiers
bun add bem-modifiers
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2020-12-06 |
| First published | 2018-09-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 5 |
| Unpacked size | 18.6 KB |
| Known vulnerabilities | 0 (+15 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Piotr Martyniak |
| Maintainers | m8ms |
| Keywords | react, css, classes, classname, classnames, util, utility, bem |

## Links

- npm: https://www.npmjs.com/package/bem-modifiers
- Repository: https://github.com/m8ms/bem-modifiers
- Homepage: https://github.com/m8ms/bem-modifiers#readme
- Issues: https://github.com/m8ms/bem-modifiers/issues
- npm.io page: https://npm.io/package/bem-modifiers

## Dependencies (5)

- [ramda](https://npm.io/package/ramda.md) ^0.25.0
- [lodash](https://npm.io/package/lodash.md) 4.17.20
- [classnames](https://npm.io/package/classnames.md) ^2.2.6
- [handlebars](https://npm.io/package/handlebars.md) 4.7.6
- [prop-types](https://npm.io/package/prop-types.md) ^15.6.2

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.1.0 (latest) — 2020-12-06
- 1.0.7 — 2019-02-26
- 1.0.6 — 2018-09-12
- 1.0.5 — 2018-09-12
- 1.0.4 — 2018-09-12
- 1.0.3 — 2018-09-12
- 1.0.2 — 2018-09-12
- 1.0.1 — 2018-09-11
- 1.0.0 — 2018-09-11

## README

# bemcx

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

Basic usage:

```javascript
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:

```javascript
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'
```

---
_Source: https://npm.io/package/bem-modifiers · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
