Can a modifier on an element affect other elements of the same block nested within it? #271
Replies: 3 comments
-
Hi @artinboghosian! // --(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: |
Beta Was this translation helpful? Give feedback.
-
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 :) |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
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?
Beta Was this translation helpful? Give feedback.
All reactions