Open
Description
In your (awesome) code:
window.cssScope ??= new MutationObserver(mutations => { // Allow 1 observer.
...
}).observe(document.documentElement, {childList: true, subtree: true})
It seems you want the observer to be a singleton, but .observe() is not chainable, so window.cssScope always ends up as undefined.
Probably in normal HTML pages it's not important, but I'm playing with HTMX/FastHTML in Notebooks and it's easy to get several observers running simultaneasly.
Metadata
Metadata
Assignees
Labels
No labels