Yeti-or / bem-object

Data abstraction for gulp-bem

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bem-object

NPM version Build Status Dependency Status

Properties

Each object will contain next properties:

  • block - name of the block
  • elem - name of the element
  • modName - name of the modificator
  • modVal - value of the modificator
  • level - level of definition of current block (full path to level directory)
  • tech - postfix of file (index.deps.js tech is deps.js)

Functions:

  • path - function, that should return full path to file, that described by this bem object.

Getters

bemObject.id

alias bem

BEM identifier, composed from block, elem, mod and val.

API

object(props, [options])

Constructs BEM Object.

props can be:

  • String - specifies level and properties: some/level/block__elem_mod_val.js (extension is required)
  • Object - contains properties to assign

options will be passed to bem-naming instance.

object.copy(target)

Copy properties block, elem, modName, modVal in this order. That means, if target has modName only - block and elem will be copied.

tech property always copied, if not defined in target.

License

MIT (c) 2014 Vsevolod Strukchinsky

About

Data abstraction for gulp-bem


Languages

Language:JavaScript 100.0%