-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
the --toastContainer*
css variables don't seem to be working
#76
Comments
Hey, if I'm understanding correctly, you're passing the I think there's opportunity for improvement re CSS var setup, but it feel it should be a |
I agree with @paulovieira. Passing toast.push('Yo!', {
theme: {
'--toastContainerTop': '3.5rem',
}
}) Adding the paul's styles as globals runs like a charm EDIT: But no stacked... |
Yes, I was setting them in
Thanks for the clarification. Yes, the documentation was a bit misleading since some css variables can be used in the Thanks again. |
Going to label this issue as an enhancement - the CSS vars should be refactored in |
First, congratulations for this great utility! It's the kind of thing we all have to do manually sooner or later, but here you have something robust and that works for everyone.
About the issue: I was playing with the several css variables and noticed that
--toastContainer*
css variables don't have any effect. After inspecting the source code the problem seems to be here: https://github.com/zerodevx/svelte-toast/blob/master/src/lib/SvelteToast.svelte#L25-L52You are using the
style
prop in the<li>
element, so the--toastContainer*
variables will be set here. However the_toastContainer
class (which uses those variables) is used in the parent element (the<ul>
). So the variables are not available for_toastContainer
.A simple solution would be unfold the css in that component into 2 selectors:
The text was updated successfully, but these errors were encountered: