Skip to content

Commit e0c3faf

Browse files
authored
fix(ui): slow script loading hides TOC fade-up effect in desktop (cotes2020#2120)
1 parent 1b4e318 commit e0c3faf

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

_sass/pages/_post.scss

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -220,14 +220,11 @@ header {
220220
@-webkit-keyframes fade-up {
221221
from {
222222
opacity: 0;
223-
position: relative;
224-
top: 2rem;
223+
margin-top: 4rem;
225224
}
226225

227226
to {
228227
opacity: 1;
229-
position: relative;
230-
top: 0;
231228
}
232229
}
233230

@@ -247,6 +244,7 @@ header {
247244
%top-cover {
248245
content: '';
249246
display: block;
247+
position: -webkit-sticky;
250248
position: sticky;
251249
top: 0;
252250
width: 100%;
@@ -257,13 +255,16 @@ header {
257255
#toc-wrapper {
258256
top: 0;
259257
transition: top 0.2s ease-in-out;
260-
-webkit-animation: fade-up 0.8s;
261-
animation: fade-up 0.8s;
262258
overflow-y: auto;
263259
max-height: 100vh;
264260
scrollbar-width: none;
265261
margin-top: 2rem;
266262

263+
&:not(.invisible) {
264+
-webkit-animation: fade-up 0.8s;
265+
animation: fade-up 0.8s;
266+
}
267+
267268
ul {
268269
list-style: none;
269270
font-size: 0.85rem;

0 commit comments

Comments
 (0)