HTML is an ECS
I just realized something cool: you can think of the relationship between HTML and CSS/JS as being like an entity component system (ECS) architecture. HTML classes are like the entities, attributes and events available in CSS and JS are like the components, and the browser’s rendering engine, along with JS event subscribers are like systems.
Within HTML, there’s also a bit of an ECS architecture, with elements being entities, classes being components, and the system being the browser as a whole. The difference here being that you’re composing classes to make elements, rather than composing styling and code to create reusable behaviors.
I’m probably a bit late to the party on this one, but it’s still pretty cool to have figured this out. Hopefully this is able to help someone else out!