-
Notifications
You must be signed in to change notification settings - Fork 9
[Draft] Start selector observer #104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for style-observer ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
src/selector-observer.js
Outdated
this.#roots.delete(root); | ||
|
||
let sheet = this.#roots.get(root); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought we had already removed the root
from roots
(in the line above) and can't get the style sheet associated with it, no? Shouldn't we move this.#roots.delete(root)
at the end of unobserveRoot
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gah, you are 100% right
src/util/adopt-css.js
Outdated
root = root.ownerDocument ?? root; | ||
let window = root.defaultView; | ||
let root = options.root.getRootNode?.() ?? options.root ?? globalThis.document; | ||
let window = options.root.defaultView; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we operate root
here, not options.root
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes!
Co-authored-by: Dmitry Sharabin <[email protected]>
Co-authored-by: Dmitry Sharabin <[email protected]>
Co-authored-by: Dmitry Sharabin <[email protected]>
Co-authored-by: Dmitry Sharabin <[email protected]>
Still very early.
Looks like both an animation and a transition based approach might be workable. We might want to use both to minimize clashes with transitions & animations being overridden on the element (then it would only fail on those that have both). Or maybe over time one of them will prove clearly better.