News for hackers. Stuff that matters.
Re:Show HN: CSS Quality Guide by armandososa on Friday July 10, 2015 @02:07PM (#9865649)
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...

Re:Show HN: CSS Quality Guide by mikewhy on Friday July 10, 2015 @02:58PM (#9866013)
I 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.