So I'm not entirely sure about all the specifics, but my understanding is that each time a new HTML element is created, it checks through all linked CSS files and inline styles to see if those styles should be applied to that element.
This suggests that there is a callback for style application whenever a function is executed to add a new node to the DOM or when a classname is changed. That's what I believe happens.
Regarding media queries, this indicates that there must be an event listener listening for viewportChange events (I just made up that term) and then checking if any specific DOM nodes need updating. Is that the process? It seems impractical, as rapidly changing the viewport from 1400px width to 1300px would trigger 100 events and require scanning through all CSS and inline styles each time.
If you have any relevant resources, I would greatly appreciate them, as I am eager to expand my knowledge about modern browsers.