Skip to content

Commit 9fbb815

Browse files
feat: 添加固定顶部导航和右侧面板粘性效果
Signed-off-by: wangsimiao1 <wangsimiao1@xiaomi.com>
1 parent 56359b4 commit 9fbb815

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

assets/css/jekyll-theme-chirpy.scss

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,27 @@ html {
1919
html::-webkit-scrollbar {
2020
display: none; /* Chrome, Safari, Opera */
2121
}
22+
23+
/* Fix: overflow:hidden on #main-wrapper breaks sticky positioning.
24+
Use overflow:clip instead — same visual clipping, but doesn't create a scroll container */
25+
#main-wrapper {
26+
overflow: clip;
27+
}
28+
29+
/* Keep topbar sticky at the top */
30+
#topbar-wrapper {
31+
position: -webkit-sticky;
32+
position: sticky;
33+
top: 0;
34+
z-index: 1030;
35+
background-color: var(--topbar-bg);
36+
opacity: 1;
37+
}
38+
39+
/* Keep right panel (trending tags + recent updates) always sticky */
40+
#panel-wrapper > .access {
41+
position: -webkit-sticky !important;
42+
position: sticky !important;
43+
top: 5rem;
44+
transition: none !important; /* remove the top transition that causes the jump */
45+
}

0 commit comments

Comments
 (0)