Skip to content
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

Support for ShadowDOM #139

Open
fregante opened this issue Dec 11, 2021 · 7 comments
Open

Support for ShadowDOM #139

fregante opened this issue Dec 11, 2021 · 7 comments
Labels
enhancement New feature or request

Comments

@fregante
Copy link

fregante commented Dec 11, 2021

If I use a closed shadow DOM, the styles appended by Goober to the document’s head no longer reach it

const root = document.createElement("div");
document.body.append(root);
+ root.attachShadow({mode: "closed"})
render(<Toaster />, root);

Can you expose Goober’s target? https://github.com/cristianbote/goober/blob/e3f99e960a59d606fe7d4584383834465883ec8d/docs/docs/api/targets.md#L15

For example:

const root = document.createElement("div");
document.body.append(root);
root.attachShadow({mode: "closed"})
- render(<Toaster />, root);
+ render(<Toaster styleLocation={root} />, root);

Edit: Also asked in:

@fregante
Copy link
Author

Can you expose Goober’s target? cristianbote/goober@e3f99e9/docs/docs/api/targets.md#L15

Rather, is it possible to automatically detect and use React’s root instead?

@timolins timolins added the enhancement New feature or request label Jan 4, 2022
@kkosmowski
Copy link

what's the status on this one? It should be pretty straightforward to implement. Is there any other way I can tell react-hot-toast where to put the styles (that usually are added to document.head)?

@clintj42
Copy link

+1 on this. I'm seeing the same problem. The styles aren't getting applied in the shadow DOM. Any workarounds you guys are aware of?

@fregante
Copy link
Author

Related issue upstream:

@goldmont
Copy link

Same here

@meekr
Copy link

meekr commented Jul 17, 2023

@fregante I cannot apply styles to shadow root even its mode is "open". Can you guide me how to do that?

@dimadolgopolovn
Copy link

Experiencing the same issue here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

7 participants