Replies: 2 comments 1 reply
|
I have it in a SvelteKit App and it works fine in Safari. Here is my Code of the root <script lang="ts">
import '../app.css';
import '$lib/fonts/fonts.css';
import {onNavigate} from "$app/navigation";
let { children } = $props();
onNavigate((navigation) => {
if (!document.startViewTransition) return;
return new Promise((resolve) => {
document.startViewTransition(async () => {
resolve();
await navigation.complete;
});
});
});
</script>
{@render children()}And here (part) of my @view-transition {
navigation: auto;
}
::view-transition-old(root) {
animation: fade-out 250ms ease forwards;
}
::view-transition-new(root) {
animation: fade-in 250ms ease forwards;
}
@keyframes fade-out { to { opacity: 0; } }
@keyframes fade-in { from { opacity: 0; } } |
|
The difference between your snippet and vekunz's working one is the CSS, specifically the missing So add it to your global CSS alongside your existing @view-transition {
navigation: auto;
}vekunz's example has exactly this and works in Safari; yours doesn't and fails there specifically, that lines up with a spec-conformance gap rather than anything wrong in how you're calling |
Uh oh!
There was an error while loading. Please reload this page.
Hello,
I'd like to know if anybody had any luck making view transitions work on Safari with SvelteKit. I am really implementing the basic example which you can find in most tutorials online and it works fine on Chrome but not on Safari. I know for sure my version of Safari (26)can have view transitions because I can test other examples online using view transitions and they work fine. So I suspect it is the way I trigger them inside SvelteKit that is not compatible with Safari.
For the sake of completeness, here is the javascript code I use :
And my CSS:
Anybody is having the same issue and/or knows how to make it work?
All reactions