PostHTML-easy-bem
PostHTML plugin for support to simplify the maintenance of BEM naming structure. It is inspired with posthtml-bem-sugar and pug-bem, but does not depend on other plugins. If you would like more complete and flexible solution, you should try posthtml-bem.
Install
$ npm install --save-dev posthtml-easy-bem
Features
Blocks
Unlike posthtml-bem-sugar, this plugin uses unprefixed classes to detect blocks. So the block class will be untouched on output.
March Hare
Elements
Element classes uses __
as a prefix.
March Hare
This would render like
March Hare
Modifiers
But modirier classes uses --
.
March Hare March Hare
This would render like
March Hare March Hare
Usage
const posthtml = ; const html = '<div class="MadTeaParty">' ' <div class="__march-hare --type_mad">March Hare</div>' ' <div class="__hatter --type_mad">Hatter</div>' ' <div class="__dormouse --state_sleepy">Dormouse</div>' '</div>' ;
License
MIT