I hate to be the one to tell you but writing CSS is half thinking about scope. You don’t always need them, but there are plenty of tools out there that help with scoping one way or another. They are worth considering as they help with a variety of problems a team can run into while building and maintaining a website. CSS itself is getting in on the action with @scope, a relatively new at-rule. It’s got some interesting tricks up it’s sleeve, but doesn’t do the same sort of things that build tools can do related to scope. So I guess we’d better talk about it all together.
Slides: https://frontendmasters.com/blog/scope-in-css/
***
A session from CSS Day, the CSS conference. Each June in Amsterdam; see https://cssday.nl for more information.
Conference announcements in your inbox? https://cssday.nl/subscribe