View Transitions for Static Sites, the Progressive-Enhancement Way
Cross-document View Transitions add native, GPU-smooth page fades to a plain multi-page site — with a two-line opt-in and a graceful fallback for everyone else.

On this page
Single-page frameworks sell smooth transitions as a reason to ship a router and a runtime. The cross-document View Transitions API gives a static, multi-page site the same fades — no JavaScript, no framework.
Opt in from CSS
For same-origin navigations, one at-rule turns on the default cross-fade:
@view-transition { navigation: auto; }
That’s the whole opt-in. The browser snapshots the old page, loads the new one, and cross-fades between them.
Name the elements that should persist
Give a shared element the same view-transition-name on both pages and the browser morphs it across the navigation instead of fading it — perfect for a hero image that continues from a card into its detail page:
.post-hero { view-transition-name: hero; }
Respect reduced motion
Wrap the animation in a preference query so people who ask for less motion get an instant swap:
@media (prefers-reduced-motion: reduce) {
::view-transition-group(*) { animation: none; }
}
Why it fits a Hugo site
There’s no client router to install and nothing to hydrate. Browsers without support just navigate normally — the fade is a pure enhancement layered on top of links that already work.
Related reading
Container Queries: Components That Adapt to Their Box
Media queries ask how big the screen is. Container queries ask how big the component's parent is — which is the question a reusable card actually needs answered.
Glassmorphism That Actually Performs
Backdrop filters are gorgeous and expensive. Here's how we get a premium frosted-glass feel without tanking scroll performance on mobile.
