# pug-bemify

> Adds bem shortcuts to pug

Latest version **1.1.0** (published 2019-04-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install pug-bemify
pnpm add pug-bemify
yarn add pug-bemify
bun add pug-bemify
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2019-04-14 |
| First published | 2017-02-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Khalid Hoffman |
| Maintainers | khalidhoffman, webleedev |
| Keywords | pugjs, pug, BEM, bem-methodology, pug-lexer, plugin |

## Links

- npm: https://www.npmjs.com/package/pug-bemify
- Repository: https://github.com/webleedev/pug-bemify
- Homepage: https://github.com/webleedev/pug-bemify#readme
- Issues: https://github.com/webleedev/pug-bemify/issues
- npm.io page: https://npm.io/package/pug-bemify

## Alternatives

- [cli-color](https://npm.io/package/cli-color.md) — 3.4M weekly downloads
- [log](https://npm.io/package/log.md) — 1.3M weekly downloads
- [logstash-client](https://npm.io/package/logstash-client.md) — 4.5K weekly downloads
- [@nocobase/plugin-logger](https://npm.io/package/@nocobase/plugin-logger.md) — 2.0K weekly downloads
- [child-process-debug](https://npm.io/package/child-process-debug.md) — 695 weekly downloads

## Recent versions

- 1.1.0 (latest) — 2019-04-14
- 1.0.4 — 2017-02-17
- 1.0.3 — 2017-02-17
- 1.0.2 — 2017-02-16
- 1.0.0 — 2017-02-16

## README

# pug-bemify
A plugin that adds BEM shortcuts to pug

## Installation
run `npm i pug-bemify`

## Setup
```javascript
var pugBEMify = require('pug-bemify');

pug.render(somePugString, {
  plugins : [pugBEMify()]
});
```

## Example Usage
```pug
.block.-some-modifier
    ._the-child-el
        span.the-grandchild.-with-content Inside
```
renders:
```html
<div class="block block--some-modifier">
  <div class="block__the-child-el"><span class="the-grandchild the-grandchild--with-content">Inside</span></div>
</div>
```

## Bonus Points
this plugin plays nicely with stylus and [stylus-bem-evaluator](https://github.com/khalidhoffman/stylus-bem-evaluator).
Example usage following the pug example may look like this:
```stylus
.block
  &/--some-modifier
    color: blue 
    /__the-child-el
      color: @color
  /__the-child-el
    color: red
```
which renders:
```css
.block.block--some-modifier {
  color: #00f;
}
.block.block--some-modifier .block__the-child-el {
  color: #00f;
}
.block .block__the-child-el {
  color: #f00;
}
```
hint: the `/` character in `/__` or `/--` is replaced with the parent block (in this case `.block`)

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