From 6d1fc3a0816688dbd6ae745c3a3b9ca30b203ab6 Mon Sep 17 00:00:00 2001 From: anti Date: Sat, 9 May 2026 04:15:44 -0400 Subject: [PATCH] fix(decnet_web/Layout): theme swap end-of-animation flash Without fill: 'forwards' the clip-path keyframes release at animation end and the pseudo reverts to its computed style (no clip-path), so the old layer flashes back at full size for a frame before View Transitions tears the pseudo-elements down. Pinning the final keyframe with fill-forwards keeps the old layer fully clipped through to teardown. --- decnet_web/src/lib/useThemeToggle.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/decnet_web/src/lib/useThemeToggle.ts b/decnet_web/src/lib/useThemeToggle.ts index 0a0ff10d..663a292f 100644 --- a/decnet_web/src/lib/useThemeToggle.ts +++ b/decnet_web/src/lib/useThemeToggle.ts @@ -86,6 +86,11 @@ function animateSwap(next: Theme, x: number, y: number): void { duration: 520, easing: 'cubic-bezier(0.4, 0, 0.2, 1)', pseudoElement: '::view-transition-old(root)', + /* Without 'forwards' the keyframes release on completion + * and the pseudo reverts to its computed style (no + * clip-path), making the old layer flash back at full + * size for a frame before View Transitions tears it down. */ + fill: 'forwards', }, ); }).catch(() => { /* user-cancelled or unsupported pseudo, ignore */ });