kbrgl / svelte-french-toast

🍞🥂 Buttery smooth toast notifications for Svelte
https://svelte-french-toast.vercel.app/
MIT License
838 stars 30 forks source link

Toast position not working properly in electron #7

Closed karmaral closed 2 years ago

karmaral commented 2 years ago

Hello. The positioning of the toast appears to malfunction inside electron. I'm not sure if it's electron specific or rather the create-svelte-electron-app template.

I tried it on a repl and it works just fine, but using electron, the position seems to be stuck to the top-left. The toasts also don't stack. It would seem the inline styling is not getting applied to the elements.

I've created a blank project with the issue. If you clone it and try to run it, the problem should be apparent. Here is the link

kbrgl commented 2 years ago

Thank you for opening an issue and including a repo that reproduces it!

From a cursory look, it appears that the issue is not with Svelte French Toast but with the template. On opening the browser devtools, it's clear that the build system isn't correctly configured to compile style directives:

Screen Shot 2022-07-21 at 11 45 58 PM

You likely need to change rollup.config.js to correctly compile them. Here's the rollup.config.js that was used in Svelte French Toast before I switched to SvelteKit's library mode. You can try using it to fix your issue:

https://github.com/kbrgl/svelte-french-toast/blob/910f0dff30fc07398272ede7dca1adb2430ed445/packages/svelte-french-toast/rollup.config.js

kbrgl commented 2 years ago

Yep, that was the issue. Here's a working version of your repo with a fixed rollup configuration:

https://github.com/kbrgl/svelte-french-toast-electron-issue

karmaral commented 2 years ago

Ah, that's tricky. I didn't catch that from the devtools. Thank you, I'll fix it. Off I go to the template repo to report it then 😅 Do you mind if I link them to your fork/this issue?

kbrgl commented 2 years ago

Off I go to the template repo to report it then 😅 Do you mind if I link them to your fork/this issue?

Of course! Feel free. 😄