Can a modifier on an element affect other elements of the same block nested within it?
Let's say I have a calendar block with following markup
If i added modifier to calendar_cell, say calendar__cell--future, would BEM allow modifying the calendar__day element as a result?
Hi @artinboghosian! I'm not sure if BEM says something about this but I prefer use the inherited as usual.
// --(Modifier) Future Calendar Cell
.calendar__cell--future {
background-color: #aff;
// --(Inherited modifier) Future Calendar Cell Day
.calendar__day {
background-color: #0aa;
color: #fff;
}
}
Here I created a visual example: http://codepen.io/unavezfui/pen/BzOrGZ
Hey here Maxim Shirshin says in Smashing Magazine yes to use cascade like in my last example.
https://www.smashingmagazine.com/2014/07/bem-methodology-for-small-projects/#bye-bye-cascade
:)
Thank you very much for responding manumorante. I took the inheritance approach you recommended. it's easier than having to apply modifier to each element individually within the cell.