Would you like to clone this notebook?

When you clone a notebook you are able to make changes without affecting the original notebook.

Cancel

naming.cell.stringify: using a custom naming convention

node v10.16.3
version: 1.0.0
endpointsharetweet
const bemNaming = require('@bem/sdk.naming.entity'); // This is required, cause RunKit cannot load this package itself. const options = { fs: { scheme: 'flat' } }; const originFlatNaming = require('@bem/sdk.naming.presets/create')(options); const stringify = require('@bem/sdk.naming.cell.stringify')(originFlatNaming); const BemCell = require('@bem/sdk.cell'); var myBemCell; myBemCell = BemCell.create({block: 'my-block', tech: 'css' }); stringify(myBemCell);
myBemCell = BemCell.create({block: 'my-block', tech: 'js' }); stringify(myBemCell);
myBemCell = BemCell.create({block: 'my-block', layer: 'my-layer', tech: 'css' }); stringify(myBemCell);
myBemCell = BemCell.create({block: 'my-block', mod: 'my-modifier', tech: 'css' }); stringify(myBemCell);
myBemCell = BemCell.create({block: 'my-block', mod: 'my-modifier', val: 'some-value', tech: 'css' }); stringify(myBemCell);
myBemCell = BemCell.create({block: 'my-block', elem: 'my-element', tech: 'css' }); stringify(myBemCell);
myBemCell = BemCell.create({block: 'my-block', elem: 'my-element', mod: 'my-modifier', tech: 'css' }); stringify(myBemCell);
Loading…

no comments

    sign in to comment