A brief history
Some CSS conventions that became popular include BEM, SMACSS, and OOCSS. Each of these solutions required developers to learn the convention and remember to apply it correctly; otherwise, frustrating scoping issues could still occur.
CSS modules became a safer option, where developers would import CSS into JavaScript modules and a build step would automatically scope that CSS locally to that JavaScript module. The CSS itself is still written in a normal CSS (or SASS) file.
CSS-in-JS went one step further and allowed you to write your CSS directly in your JavaScript module, automatically scoping that CSS locally to the component. This felt right for a lot of developers; others didn't like it from the start. Some CSS-in-JS solutions, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access