Prevent flashing during navigation
This commit is contained in:
@@ -48,6 +48,28 @@
|
||||
--reading-width: 60rem;
|
||||
}
|
||||
|
||||
/* Cross-document view transitions: page navigations stay full reloads, but the
|
||||
browser holds the old frame until the new page is ready and swaps them
|
||||
without a blank flash. The header and tree rail are named so they swap in
|
||||
place (no crossfade) — only the rest of the page fades, and only briefly. */
|
||||
@view-transition { navigation: auto; }
|
||||
body > header { view-transition-name: app-header; }
|
||||
.tree-sidebar { view-transition-name: tree-sidebar; }
|
||||
::view-transition-group(*),
|
||||
::view-transition-old(*),
|
||||
::view-transition-new(*) { animation-duration: 0.12s; }
|
||||
::view-transition-group(app-header),
|
||||
::view-transition-group(tree-sidebar),
|
||||
::view-transition-old(app-header),
|
||||
::view-transition-new(app-header),
|
||||
::view-transition-old(tree-sidebar),
|
||||
::view-transition-new(tree-sidebar) { animation: none; }
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
::view-transition-group(*),
|
||||
::view-transition-old(*),
|
||||
::view-transition-new(*) { animation: none; }
|
||||
}
|
||||
|
||||
/* Anchor / TOC jumps are handled by the .center scroll container's own
|
||||
scroll-padding-top (the header no longer overlaps content in the app-shell),
|
||||
so no html-level scroll padding is needed. */
|
||||
|
||||
Reference in New Issue
Block a user