Switch branches/tags
v1.10.3 v1.10.2 v1.10.1 v1.10.0 v1.9.1 v1.9.0 v1.8.3 v1.8.2 v1.8.1 v1.8.0 v1.7.1 v1.7.0 v1.6.1 v1.6.0 v1.5.0 v1.4.0 v1.3.0 v1.2.0 v1.1.0 v1.0.0 v0.2.0 v0.1.1 v0.0.1 @bem/sdk.walk@0.5.0 @bem/sdk.walk@0.4.0 @bem/sdk.walk@0.3.2 @bem/sdk.walk@0.3.1 @bem/sdk.walk@0.3.0 @bem/sdk.walk@0.2.7 @bem/sdk.walk@0.2.6 @bem/sdk.walk@0.2.5 @bem/sdk.walk@0.2.4 @bem/sdk.walk@0.2.3 @bem/sdk.walk@0.2.2 @bem/sdk.walk@0.2.1 @bem/sdk.walk@0.2.0 @bem/sdk.walk@0.1.0 @bem/sdk.naming.presets@0.2.2 @bem/sdk.naming.presets@0.2.1 @bem/sdk.naming.presets@0.2.0 @bem/sdk.naming.presets@0.1.0 @bem/sdk.naming.presets@0.0.10 @bem/sdk.naming.presets@0.0.9 @bem/sdk.naming.presets@0.0.8 @bem/sdk.naming.presets@0.0.7 @bem/sdk.naming.presets@0.0.6 @bem/sdk.naming.presets@0.0.5 @bem/sdk.naming.presets@0.0.4 @bem/sdk.naming.presets@0.0.3 @bem/sdk.naming.presets@0.0.2 @bem/sdk.naming.file.stringify@0.1.10 @bem/sdk.naming.file.stringify@0.1.9 @bem/sdk.naming.file.stringify@0.1.8 @bem/sdk.naming.file.stringify@0.1.7 @bem/sdk.naming.file.stringify@0.1.6 @bem/sdk.naming.file.stringify@0.1.5 @bem/sdk.naming.file.stringify@0.1.4 @bem/sdk.naming.file.stringify@0.1.3 @bem/sdk.naming.file.stringify@0.1.2 @bem/sdk.naming.file.stringify@0.1.1 @bem/sdk.naming.file.stringify@0.1.0 @bem/sdk.naming.entity@0.2.10 @bem/sdk.naming.entity@0.2.9 @bem/sdk.naming.entity@0.2.8 @bem/sdk.naming.entity@0.2.7 @bem/sdk.naming.entity@0.2.6 @bem/sdk.naming.entity@0.2.5 @bem/sdk.naming.entity@0.2.4 @bem/sdk.naming.entity@0.2.3 @bem/sdk.naming.entity@0.2.2 @bem/sdk.naming.entity@0.2.1 @bem/sdk.naming.entity@0.2.0 @bem/sdk.naming.entity@0.1.0 @bem/sdk.naming.entity.stringify@1.1.1 @bem/sdk.naming.entity.stringify@1.1.0 @bem/sdk.naming.entity.stringify@1.0.6 @bem/sdk.naming.entity.stringify@1.0.5 @bem/sdk.naming.entity.stringify@1.0.4 @bem/sdk.naming.entity.stringify@1.0.3 @bem/sdk.naming.entity.stringify@1.0.2 @bem/sdk.naming.entity.stringify@1.0.1 @bem/sdk.naming.entity.stringify@1.0.0 @bem/sdk.naming.entity.stringify@0.2.2 @bem/sdk.naming.entity.stringify@0.2.1 @bem/sdk.naming.entity.stringify@0.2.0 @bem/sdk.naming.entity.stringify@0.1.0 @bem/sdk.naming.entity.parse@0.2.8 @bem/sdk.naming.entity.parse@0.2.7 @bem/sdk.naming.entity.parse@0.2.6 @bem/sdk.naming.entity.parse@0.2.5 @bem/sdk.naming.entity.parse@0.2.4 @bem/sdk.naming.entity.parse@0.2.3 @bem/sdk.naming.entity.parse@0.2.2 @bem/sdk.naming.entity.parse@0.2.1 @bem/sdk.naming.entity.parse@0.2.0 @bem/sdk.naming.entity.parse@0.1.0 @bem/sdk.naming.cell.stringify@0.0.12 @bem/sdk.naming.cell.stringify@0.0.11 @bem/sdk.naming.cell.stringify@0.0.10 @bem/sdk.naming.cell.stringify@0.0.9
Nothing to show
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
..
Failed to load latest commit information.
lib/schemes
test
CHANGELOG.md
LICENSE.txt
README.md
cell-stringify.js
package.json

README.md

naming.cell.stringify

BEM file system schemes.

Supported presets

Naming conventions

BEM naming convention.

  • origin.btn__text_fly, btn/__text/_fly/btn__text_fly_away.css
  • two-dashes.btn__text--fly_away, btn/__text/--fly/btn__text--fly_away.css
  • react.Btn-Text_fly_away, Btn/Text/_fly/Btn-Text_fly_away.css

Schemes

Usage

const BemCell = require('@bem/sdk.cell');

const cell = BemCell.create({
    block: 'b1',
    elem: 'e1',
    mod: {name: 'm1', val: 'v1'},
    tech: 'js'
});

const stringify = require('@bem/sdk.naming.cell.stringify')('origin')

stringify(cell); // b1/__e1/_m1/b1__e1_m1_v1.js

Options

dirNaming has meaning only for nested scheme.

Parameter Type Description Default
options object, string '"origin"'
options.naming object, string Defines delimeters and wordPattern check [@bem/naming] '"origin"'
options.elemDirDelim string Separates element's directory "__"
options.modDirDelim string Separates mod's directory "_"

Options could be one of these strings:

  • "origin"
  • "two-dashes"
  • "react"

check ./lib/presets

License

Code and documentation © 2015-2017 YANDEX LLC. Code released under the Mozilla Public License 2.0.

[@bem/naming] : https://github.com/bem/bem-sdk/tree/master/packages/naming#bemnaming-elem-mod-wordpattern-