Skip to content

Conversation

LeaVerou
Copy link
Owner

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.

Copy link

netlify bot commented May 10, 2025

Deploy Preview for style-observer ready!

Name Link
🔨 Latest commit f15c7ba
🔍 Latest deploy log https://app.netlify.com/sites/style-observer/deploys/68226f0de2a9f50008798de4
😎 Deploy Preview https://deploy-preview-104--style-observer.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@LeaVerou LeaVerou changed the title Start selector observer [Draft] Start selector observer May 10, 2025
Comment on lines 73 to 75
this.#roots.delete(root);

let sheet = this.#roots.get(root);
Copy link
Collaborator

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?

Copy link
Owner Author

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

root = root.ownerDocument ?? root;
let window = root.defaultView;
let root = options.root.getRootNode?.() ?? options.root ?? globalThis.document;
let window = options.root.defaultView;
Copy link
Collaborator

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?

Copy link
Owner Author

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]>
LeaVerou and others added 3 commits May 12, 2025 17:57
Co-authored-by: Dmitry Sharabin <[email protected]>
Co-authored-by: Dmitry Sharabin <[email protected]>
Co-authored-by: Dmitry Sharabin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants