I used the recommended default template when setting up Astro and followed the documentation about View Transitions but there weren't clear points made when using a custom Layout component. I'm choosing the following method in order to avoid repetition
Layout.astro
<!doctype html>
<html transition:animate="none">
<head>
<meta charset="UTF-8" />
<meta name="description" content="Astro description" />
<meta name="viewport" content="width=device-width" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="generator" content={Astro.generator} />
<title>{title}</title>
<CommonHead />
<ViewTransitions />
</head>
<body>
<slot />
....
pages/index.astro
---
import Layout from "../layouts/Layout.astro";
---
<Layout title="Welcome to Astro.">
<main transition:animate="slide">
<p>This is Index page</p>
</main>
</Layout>
pages/test.astro
---
import Layout from "../layouts/Layout.astro";
---
---
import Layout from "../layouts/Layout.astro";
---
<Layout title="Test">
<main transition:animate="slide">
<p>This is a test page.</p>
</main>
</Layout>
With this, transitions do not work at all. Neither, when I tried to wrap the <slot/>
Is there a way to even do it this way or what i'm I doing wrong?
View transitions do work when I don't mark the layout html tag with transition:animate="none" but all I'm able to use in that case is fade effect.