CSS Modules, Shadow DOM and a countless number of naming conventions (such as BEM) have solved this problem long time ago in the community.
Stop using CSS in JavaScript for web development
Gajus Kuizinas
3.1K92

True to a degree. Any handwritten classname, such as bunch of BEM components, can conflict easily if you mash up CSS coming from different places. The only way to properly avoiding collisions is to not use classnames at all in fact. Using conventions will easily lets you slip up by creating element specific styles without considering the cascading effect.

For anyone who writes CSS that has to co-exist with arbitrary CSS, it would have been tremendously helpful if a websites host CSS was not written by a human, dictating properly named classnames.

Its hardly big enough of a reason in itself, but I would say that it does _a better job_ of solving the conflicts than the _countless number of naming conventions_.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.