src/lib/utils.js
/**
 * Creates BEM class name according the vanilla BEM style.
 * @param {string} block the main block
 * @return {function} function that takes up to 2 parameters
 * that determine the element and the modifier of the BEM class.
 */
Creates BEM class name according the vanilla BEM style.
@param {string} block the main block
@return {function} function that takes up to 2 parameters
that determine the element and the modifier of the BEM class.
Creates BEM class name according the vanilla BEM style . @param { string } block the main block @return { function } function that takes up to 2 parameters that determine the element and the modifier of the BEM class .
function bemHelper(block) {
  return function(element, modifier) {
    if (element && !modifier) {
      return `${block}--${element}`;
    }
    __modifier
    if (element && modifier) {
      return `${block}--${element}__${modifier}`;
    }
    if (!element && modifier) {
      return `${block}__${modifier}`;
    }
    return block;
  };
}
function bemHelper ( block ) { return function ( element , modifier ) { if ( element && ! modifier ) { return ` ${ block } ${ element } ` ; } if ( element && modifier ) { return ` ${ block } ${ element } ${ modifier } ` ; } if ( ! element && modifier ) { return ` ${ block } ${ modifier } ` ; } return block ; } ; }
Creates BEM class name according the vanilla BEM style.
Creates BEM class name according the vanilla BEM style .
// block--element // block--element__modifier // block__modifier