getbem.github.io icon indicating copy to clipboard operation
getbem.github.io copied to clipboard

Can a modifier apply to an element instead of a block?

Open pupeno opened this issue 8 years ago • 1 comments

For example, if you have an a list, with list items, and one of those items are active, should it be specified like this:


.list { }
.list__item { }
.list__item--active { }

How would one differentiate from a list that is active instead of a list item that is active?

pupeno avatar Aug 03 '17 06:08 pupeno

.list__item--active is already an element modifier.

If you want a modifier for your list, just add it to the block:

.list--active__item--active.

This way you have a selector for an item--active for a list--active

madroneropaulo avatar Nov 20 '17 17:11 madroneropaulo