From e0c3fafa470eb12bd04ffdf198018bc28b6de20d Mon Sep 17 00:00:00 2001 From: Cotes Chung <11371340+cotes2020@users.noreply.github.com> Date: Sun, 15 Dec 2024 14:51:51 +0800 Subject: [PATCH] fix(ui): slow script loading hides TOC fade-up effect in desktop (#2120) --- _sass/pages/_post.scss | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/_sass/pages/_post.scss b/_sass/pages/_post.scss index f51f3b9d60d..9b8fa7e6d75 100644 --- a/_sass/pages/_post.scss +++ b/_sass/pages/_post.scss @@ -220,14 +220,11 @@ header { @-webkit-keyframes fade-up { from { opacity: 0; - position: relative; - top: 2rem; + margin-top: 4rem; } to { opacity: 1; - position: relative; - top: 0; } } @@ -247,6 +244,7 @@ header { %top-cover { content: ''; display: block; + position: -webkit-sticky; position: sticky; top: 0; width: 100%; @@ -257,13 +255,16 @@ header { #toc-wrapper { top: 0; transition: top 0.2s ease-in-out; - -webkit-animation: fade-up 0.8s; - animation: fade-up 0.8s; overflow-y: auto; max-height: 100vh; scrollbar-width: none; margin-top: 2rem; + &:not(.invisible) { + -webkit-animation: fade-up 0.8s; + animation: fade-up 0.8s; + } + ul { list-style: none; font-size: 0.85rem;