Oh boy, I still remember pitching BEM to my colleagues in 2014. How they laughed.
I really like this approach, as it introduces component thinking. It takes some time to wrap your head around it, but when it clicks, it becomes the only way you write your CSS.
The only problem I always had, was when you want to modify your block and have its children affected:
card card--dark
card__header
card__body
This always resulted in two ways:
I created a modified version of every element inside;
or I stacked the elements (card--dark > .card_header).
I know the first solution is "cleaner", but sometimes it was really too much. What's your take on this?
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Oh boy, I still remember pitching BEM to my colleagues in 2014. How they laughed.
I really like this approach, as it introduces component thinking. It takes some time to wrap your head around it, but when it clicks, it becomes the only way you write your CSS.
The only problem I always had, was when you want to modify your block and have its children affected:
This always resulted in two ways:
card--dark > .card_header
).I know the first solution is "cleaner", but sometimes it was really too much. What's your take on this?