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

Add option for className of main element #43

Closed
Kilian opened this issue Feb 10, 2021 · 2 comments · May be fixed by vAHiD55555/proxy-provider-converter#4
Closed

Add option for className of main element #43

Kilian opened this issue Feb 10, 2021 · 2 comments · May be fixed by vAHiD55555/proxy-provider-converter#4
Labels
enhancement New feature or request

Comments

@Kilian
Copy link
Contributor

Kilian commented Feb 10, 2021

I'd like to add a class to this div through the props/options:

https://github.com/timolins/react-hot-toast/blob/main/src/components/toaster.tsx#L28

So that I can use CSS to catch for example hover and update the CSS for that (in my case, I'm adding a timeout animation that I need to pause for all toasts on hover)

It doesn't look hard to add, so let me know if I can open a PR for this.

@Systerr
Copy link

Systerr commented Mar 5, 2021

In our case we also want to adjust styles of internal div element (change position fixed to absolute). That's important for us, as our react app only part of main app and have no access to parent styles. With position fixed notifications go out of our container and mess up by Z-index (hidden by parent header). Class name of main element will fix it for us.

@Kilian
Copy link
Contributor Author

Kilian commented Mar 5, 2021

So, I ended up fixing it by just wrapping the Toast component in a div with a classname, then using that classname. Also works :)

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

Successfully merging a pull request may close this issue.

3 participants