Skip to content

Commit

Permalink
Updated README files
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewblond committed Nov 5, 2014
1 parent 022f888 commit f6784c6
Show file tree
Hide file tree
Showing 2 changed files with 95 additions and 5 deletions.
55 changes: 50 additions & 5 deletions README.md
Expand Up @@ -6,7 +6,7 @@ bem-naming
About
-----

This tool allows getting information about BEM-entity using [string](#string-representation) as well as forming string representation based on [BEM-naming](#bem-naming).
This tool allows getting information about BEM entity using [string](#string-representation) as well as forming string representation based on [BEM-naming](#bem-naming).

String representation
---------------------
Expand Down Expand Up @@ -47,10 +47,55 @@ BEM-naming

BEM-entities can be defined with a help of js-object with the following fields:

* `block` — block's name. The field is required because block is the only independent BEM-entity.
* `elem` — element's name.
* `modName` — modifier's name.
* `modVal` — modifier's value.
* `block` — a block name. The field is required because only a block exists as an independent BEM entity
* `elem` — an element name.
* `modName` — a modifier name.
* `modVal` — a modifier value.

The modifier consists of a pair of fields `modName` and `modVal`. This means that the field `modVal` without `modName` has no meaning.

Example:

```js
// The block modifier
{
block: 'block',
modName: 'mod',
modVal: 'val'
}

// Not valid BEM-notation
{
block: 'block',
modVal: 'val'
}
```

To describe the boolean modifier field `modVal` must be specified as `true`.

Example:

```js
// Boolean modifier of a block
{
block: 'block',
modName: 'mod',
modVal: true
}

// Shorthand for the boolean modifier of a block
{
block: 'block',
modName: 'mod'
}

// Not valid BEM-notation
{
block: 'block',
modName: 'mod',
modVal: false
}
```

API
---
Expand Down
45 changes: 45 additions & 0 deletions README.ru.md
Expand Up @@ -52,6 +52,51 @@ bem-naming
* `modName` — название модификатора.
* `modVal` — значение модификатора.

Модификатор состоит из пары `modName` и `modVal`. Это означает, что поле `modVal` без `modName` не имеет никакого смысла.

Пример:

```js
// Модификатор блока
{
block: 'block',
modName: 'mod',
modVal: 'val'
}

// Невалидная БЭМ-нотация
{
block: 'block',
modVal: 'val'
}
```

Чтобы задать булевый модификатор поле modVal должно быть указано со значением `true`. В таком случае отображаться будет только имя модификатора.

Пример:

```js
// Булевый модификатор блока
{
block: 'block',
modName: 'mod',
modVal: true
}

// Сокращенная запись булевого модификатора блока
{
block: 'block',
modName: 'mod'
}

// Невалидная БЭМ-нотация
{
block: 'block',
modName: 'mod',
modVal: false
}
```

API
---

Expand Down

0 comments on commit f6784c6

Please sign in to comment.