4 ms·
I've found that these cases are non-issues when you use something like BEM. The downside is that the HTML then becomes horrible to look at: <div class='sid
by armandososa 11y ago
I've found that these cases are non-issues when you use something like BEM. The downside is that the HTML then becomes horrible to look at:
<div class='sidebar'>
<div class='sidebar__post'>
<h2 class='sidebar__post__title'>
Please kill me
</h2>
</div>
</div>
So… you have to chose between unmaintainable CSS or weird HTML.
I think that, in the end, something like this is the only sane outcome: https://medium.com/seek-ui-engineering/the-end-of-global-css-90d2a4a06284 https://medium.com/seek-ui-engineering/the-end-of-global-css...
- mikewhy 11y agoI probably wouldn't go so far as to use `sidebar__post__title `, just `sidebar--title` and `post--title`. That way if you want to style a post title in the sidebar, it's clearly `.sidebar .post--title` using something like BEM solves a lot of problems. Silly collisions and searchability are my big takeaways.