Skip to content

Commit 79ac09d

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

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

assets/css/jekyll-theme-chirpy.scss

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,24 @@ 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+
}
36+
37+
/* Keep right panel (trending tags + recent updates) always sticky */
38+
#panel-wrapper > .access {
39+
position: -webkit-sticky !important;
40+
position: sticky !important;
41+
top: 5rem;
42+
}

0 commit comments

Comments
 (0)