Skip to content

Instantly share code, notes, and snippets.

@Realetive
Last active July 19, 2017 08:12
Show Gist options
  • Save Realetive/313d4e67e055aa230aeea06afd1bc452 to your computer and use it in GitHub Desktop.
Save Realetive/313d4e67e055aa230aeea06afd1bc452 to your computer and use it in GitHub Desktop.
bem-tools-create template for pobem
'use strict';
var EOL = require('os').EOL;
module.exports = function(entity) {
var elemPart = entity.elem ? ".elem(" + entity.elem + ")" : '',
modVal = entity.modVal || '',
modPart = entity.modName ? ".mod(" + entity.modName + " " + modVal + ")" : '';
return [
"block(" + entity.block + ")" +
(entity.modName && !entity.elem ? modPart : '') +
(entity.elem ? elemPart : '') +
(entity.elem && entity.modName ? modPart : ''),
" "
].join(EOL);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment