bem-jade-legacy

Smart mixins for writing BEM in Jade

Usage no npm install needed!

<script type="module">
  import bemJadeLegacy from 'https://cdn.skypack.dev/bem-jade-legacy';
</script>

README

This is a refactored fork of bemto, see bemto/README.md for syntax of mixins +b and +e.

Template:

include bem

+b.foo
  +e.bar baz

(need to make sure the interpreter can find bem.jade from this module).

JS:

var bem = require('bem-jade-legacy');
var jade = reqiure('jade');
var result = jade.renderFile('filename.jade', {
 bem: bem(),
 name: 'Joe'
});

The compiled function is still larger than pure jade equivalent, but gzips pretty good (lots of repetition), so the overhead is under 20%.

The original bem.jade is not suited for client-side.