Hey there, really interesting library. I was surprised about how little code there was!
Curious how this works:
This uses MutationObserver to monitor the DOM, and the moment a <style> tag is seen, it scopes the styles to whatever the parent element is. No flashing or popping.
Do MutationObserver observers always kick in before styling is applied? I would have expected a race between the mutation observers firing and the styles being applied, where sometimes mutation observers win, sometimes <style> wins