Hacker News new | ask | show | jobs
by evan_ 3212 days ago
We did this for a long time but we still ran into problems where people would use the same CSS class name in two places and styles would interact poorly.

It's easy to just say "don't do that then" but with a large enough codebase, and devs of many different skill levels, it's easier just to move to a model that prevents CSS cross-talk altogether.

1 comments

The article advocates for using Scoped CSS, which it clearly sounds like you're not using. Mitigating against your problem is the entire point of Scoped CSS ;)

In our codebase (using import './styles.css' w/CSS Modules) every single component has a className called .root at the very top. Never conflicted once.