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

Commit

Permalink
docs(modifier): update example with simple modifier
Browse files Browse the repository at this point in the history
  • Loading branch information
blond committed Apr 9, 2017
1 parent 9735156 commit 343094f
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,21 +76,18 @@ new BemEntityName({
// ➜ EntityTypeError: the object `{ block: 'block', mod: { val: 'action' } }` is not valid BEM entity, the field `mod.name` is undefined
```

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

**Example:**

```js
// Boolean modifier of a block
new BemEntityName({
block: 'button',
mod: { name: 'focused', val: true }
});
// Simple modifier of a block
new BemEntityName({ block: 'button', mod: 'focused' });

// Shorthand for the boolean modifier of a block
// Is equivalent to simple modifier, if `mod.val` is `true`
new BemEntityName({
block: 'button',
mod: 'focused'
mod: { name: 'focused', val: true }
});
```

Expand Down

0 comments on commit 343094f

Please sign in to comment.