Skip to content
This repository was archived by the owner on Feb 4, 2018. It is now read-only.

Commit 343094f

Browse files
author
blond
committed
docs(modifier): update example with simple modifier
1 parent 9735156 commit 343094f

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

README.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,21 +76,18 @@ new BemEntityName({
7676
// ➜ EntityTypeError: the object `{ block: 'block', mod: { val: 'action' } }` is not valid BEM entity, the field `mod.name` is undefined
7777
```
7878

79-
To describe the simple modifier, field `mod.val` must be specified as `true`.
79+
To describe a simple modifier the `mod.val` field must be omitted.
8080

8181
**Example:**
8282

8383
```js
84-
// Boolean modifier of a block
85-
new BemEntityName({
86-
block: 'button',
87-
mod: { name: 'focused', val: true }
88-
});
84+
// Simple modifier of a block
85+
new BemEntityName({ block: 'button', mod: 'focused' });
8986

90-
// Shorthand for the boolean modifier of a block
87+
// Is equivalent to simple modifier, if `mod.val` is `true`
9188
new BemEntityName({
9289
block: 'button',
93-
mod: 'focused'
90+
mod: { name: 'focused', val: true }
9491
});
9592
```
9693

0 commit comments

Comments
 (0)