Skip to content

Commit 3828651

Browse files
committed
fix: kill all view transition animations — instant swap, no artifacts
1 parent 45bface commit 3828651

4 files changed

Lines changed: 7 additions & 37 deletions

File tree

site/src/components/DocsSidebar.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function isParentActive(item: NavItem): boolean {
1818
}
1919
---
2020

21-
<aside id="docs-sidebar" class="docs-sidebar hidden lg:block w-60 shrink-0" style="view-transition-name: sidebar;">
21+
<aside id="docs-sidebar" class="docs-sidebar hidden lg:block w-60 shrink-0">
2222
<div class="sticky top-16 h-[calc(100vh-4rem)] overflow-y-auto py-8 pr-4 pl-2">
2323
<nav aria-label="Documentation sidebar">
2424
{docsNav.map((group) => (

site/src/components/Nav.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const { isHome = false } = Astro.props;
66
const prefix = isHome ? '' : '/';
77
const isDocs = !isHome;
88
---
9-
<nav style="view-transition-name: nav;" class="fixed top-0 left-0 right-0 z-50 border-b border-outline-variant bg-surface/80 backdrop-blur-md">
9+
<nav class="fixed top-0 left-0 right-0 z-50 border-b border-outline-variant bg-surface/80 backdrop-blur-md">
1010
<div class={`nav-inner mx-auto px-6 flex items-center justify-between h-16 ${isHome ? 'max-w-[1200px]' : 'max-w-[1280px]'}`}>
1111
<!-- Logo -->
1212
<a href="/" class="font-mono text-lg font-bold text-on-surface tracking-tight">

site/src/layouts/Docs.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const { prev, next } = getPrevNext(currentPath);
4141
<DocsSidebar currentPath={currentPath} />
4242

4343
<!-- Main content -->
44-
<main id="main-content" class="flex-1 min-w-0 py-8 px-2 sm:px-6 lg:px-10" style="view-transition-name: docs-content;">
44+
<main id="main-content" class="flex-1 min-w-0 py-8 px-2 sm:px-6 lg:px-10">
4545
<article class="prose max-w-3xl">
4646
<slot />
4747
</article>

site/src/styles/global.css

Lines changed: 4 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,45 +2,15 @@
22

33
/* ── View Transitions ────────────────────────────────────────────── */
44

5-
/* Instant swap on the root — no fade, no flash */
6-
::view-transition-old(root),
7-
::view-transition-new(root) {
5+
/* Kill ALL view transition animations — instant swap, no visual artifacts */
6+
::view-transition-group(*),
7+
::view-transition-old(*),
8+
::view-transition-new(*) {
89
animation: none !important;
9-
mix-blend-mode: normal;
10-
}
11-
12-
/* Shell elements stay completely static — no transition */
13-
::view-transition-old(nav),
14-
::view-transition-new(nav),
15-
::view-transition-old(sidebar),
16-
::view-transition-new(sidebar) {
17-
animation: none !important;
18-
}
19-
20-
/* Content area gets a subtle slide-up transition */
21-
::view-transition-old(docs-content) {
22-
animation: vt-fade-out 150ms ease-out both;
23-
}
24-
::view-transition-new(docs-content) {
25-
animation: vt-fade-in 150ms ease-in 50ms both;
26-
}
27-
28-
@keyframes vt-fade-out {
29-
to { opacity: 0; transform: translateY(-4px); }
30-
}
31-
@keyframes vt-fade-in {
32-
from { opacity: 0; transform: translateY(4px); }
3310
}
3411

3512
/* Respect reduced motion */
3613
@media (prefers-reduced-motion: reduce) {
37-
::view-transition-old(docs-content),
38-
::view-transition-new(docs-content),
39-
::view-transition-old(root),
40-
::view-transition-new(root) {
41-
animation: none !important;
42-
}
43-
4414
[data-animate] {
4515
opacity: 1 !important;
4616
transform: none !important;

0 commit comments

Comments
 (0)