MDN: CustomStateSet
Documentation of a built-in DOM interface that allows web components to define a custom state (or states) that the web component is in. The real magic here though is that you can access those states in CSS via the :state(foo-state) selector. Found via David Darnes' Mastodon post: https://mastodon.design/@DavidDarnes/113147905121075998, where he implemented a is-playing web component that allows a audio/video element to be styled when it is playing using a :state(playing) selector.