Skip to content

Commit

Permalink
Merge pull request #54 from barsoom/henrik-patch-1
Browse files Browse the repository at this point in the history
CSS styleguide: allow BEM-like naming with test and JS classes
  • Loading branch information
henrik committed Jan 23, 2020
2 parents 9ad733a + 2d1584f commit 7043d88
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions styleguide/css/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ These classes should not be used for styling or to find elements in JavaScript.

This means that we can confidently change our tests without breaking styling or JavaScript, and vice versa.

We don't use BEM-like naming for these: that's for styling.
We typically don't use BEM-like naming for test-only classes: we tend to do just `.test-title` or `.test-item-title` instead of `.test-item__title`, but it's allowed if you feel like it makes the grouping clearer.

Further reading:

Expand All @@ -173,7 +173,7 @@ These classes should not be used for styling or to find elements in tests. And s

This means that we can confidently change our JS without breaking styling or tests, and vice versa.

We don't use BEM-like naming for these: that's for styling.
We typically don't use BEM-like naming for JS-only classes: we tend to do e.g. `.js-item-title` instead of `.js-item__title`, but it's allowed if you feel like it makes the grouping clearer. [See an example.](https://github.com/barsoom/auctionet/commit/50eead4ae4295d259fcaa561db91667328b72e16#diff-a6b6479f9e076558de9794ddb079c702)

Further reading:

Expand Down

0 comments on commit 7043d88

Please sign in to comment.