Skip to content

Commit aa98fd3

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

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+
/* Keep topbar fixed at the top */
24+
#topbar-wrapper {
25+
position: fixed;
26+
top: 0;
27+
left: 0;
28+
right: 0;
29+
z-index: 1030;
30+
}
31+
32+
/* Offset body content for fixed topbar */
33+
#main-wrapper {
34+
padding-top: 3rem; /* equals $topbar-height */
35+
}
36+
37+
/* Keep right panel (trending tags + recent updates) sticky */
38+
#panel-wrapper .access {
39+
position: -webkit-sticky;
40+
position: sticky;
41+
top: 5rem; /* topbar height + some spacing */
42+
}

0 commit comments

Comments
 (0)