From 8c45f44309ea45dc2b140c0706d18f9833528101 Mon Sep 17 00:00:00 2001 From: lutinglt Date: Wed, 13 Aug 2025 23:35:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9F=A5=E7=9C=8B=E4=BB=A3=E7=A0=81=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E9=A1=B5=E9=9D=A2=E6=96=87=E4=BB=B6=E6=A0=91=E5=A4=B4?= =?UTF-8?q?=E9=83=A8=E6=9C=89=E6=97=B6=E4=B8=8D=E4=BC=9A=E5=9B=BA=E5=AE=9A?= =?UTF-8?q?=E4=BD=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/release.md | 1 + styles/components/filelist.ts | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/release.md b/.github/release.md index 3e555c1..2ac0f31 100644 --- a/.github/release.md +++ b/.github/release.md @@ -1,3 +1,4 @@ ## 🐞 Fix - 查看代码文件页面路径栏有时内容不会居中 +- 查看代码文件页面文件树头部有时不会固定住 diff --git a/styles/components/filelist.ts b/styles/components/filelist.ts index 0ee913b..d29c9f5 100644 --- a/styles/components/filelist.ts +++ b/styles/components/filelist.ts @@ -151,6 +151,8 @@ export const repoFileView = css` max-width: calc(100% - calc(2 * 16px)); } .repo-view-container { + position: sticky; + top: 0; // 左侧文件树 .repo-view-file-tree-container { height: 100vh; @@ -166,18 +168,26 @@ export const repoFileView = css` background: ${themeVars.color.secondary.self}; } > .repo-button-row { - height: 32px; - margin: 16px 0; + align-content: center; + background: ${themeVars.color.body}; + height: 64px; + margin: 0; + position: sticky; + top: 0; &:after { content: ""; position: absolute; - top: 32px + 32px; + top: 64px; left: -16px; width: calc(100% + 16px); height: 1px; background: ${themeVars.color.secondary.self}; } } + .view-file-tree-items { + margin-right: 0; + padding: 16px 16px 16px 0; + } } // 右侧文件视图内容 .repo-view-content {