Compare commits

...

2 Commits

Author SHA1 Message Date
lutinglt
73b5397d77 优化文件树的顶部和底部间隔 2025-08-16 20:58:10 +08:00
lutinglt
134c383cdb 优化查看代码文件内容时的体验 2025-08-16 20:51:07 +08:00
4 changed files with 48 additions and 13 deletions

View File

@@ -1,11 +1,17 @@
## 🎉 ### 🎉
## ✨ Feature ### ✨ Feature
#### CSS 变量 #### CSS 变量
## 🌈 Style ### 🌈 Style
#### 更符合 GitHub 风格 ##### 更符合 GitHub 风格
## 🐞 Fix ### 🐞 Fix
## 📃 English
#### CSS Variable
##### More GitHub-like style

21
.github/release.md vendored
View File

@@ -1,4 +1,23 @@
## 🐞 Fix ### 🌈 Style
##### 更符合 GitHub 风格
- 优化查看代码文件内容时的体验 (滚动到底部时不会导致文件树部分内容遮挡)
### 🐞 Fix
- 修复红绿色盲主题的代码高亮色 - 修复红绿色盲主题的代码高亮色
- 修复仓库中文 README 时的按钮下划线长度 - 修复仓库中文 README 时的按钮下划线长度
## 📃 English (From AI)
### 🌈 Style
##### More GitHub-like style
- Improved code file viewing experience (scrolling to bottom no longer causes file tree content overlap)
### 🐞 Fix
- Fixed code highlight colors for red-green color blindness theme
- Fixed button underline length for Chinese README in repositories

View File

@@ -73,7 +73,7 @@ export function prettylights2Chroma(prettylights: prettylightsColor): Chroma {
string: { string: {
self: prettylights.syntax.string, self: prettylights.syntax.string,
affix: prettylights.syntax.string, affix: prettylights.syntax.string,
backtick: prettylights.syntax.string, backtick: prettylights.syntax.constant,
char: prettylights.syntax.string, char: prettylights.syntax.string,
delimiter: prettylights.syntax.string, delimiter: prettylights.syntax.string,
doc: prettylights.syntax.comment, doc: prettylights.syntax.comment,

View File

@@ -148,6 +148,13 @@ export const repoFilesMobile = css`
// 仓库打开文件时的视图 // 仓库打开文件时的视图
export const repoFileView = css` export const repoFileView = css`
// 隐藏主内容的下内容和页脚, 避免滚动文件树时滚动条遮挡
body > .full.height:has(.repo-view-file-tree-container) {
padding-bottom: 0;
+ .page-footer {
display: none;
}
}
.page-content.repository.file.list { .page-content.repository.file.list {
> .ui.container.fluid { > .ui.container.fluid {
max-width: calc(100% - calc(2 * 16px)); max-width: calc(100% - calc(2 * 16px));
@@ -157,16 +164,17 @@ export const repoFileView = css`
top: 0; top: 0;
// 左侧文件树 // 左侧文件树
.repo-view-file-tree-container { .repo-view-file-tree-container {
height: 100vh; height: calc(100vh - 64px); // 减去头部高度
// 固定头部
position: sticky; position: sticky;
top: 0; top: 0;
&:after { &:after {
content: ""; content: "";
position: absolute; position: absolute;
top: -14px; top: -14px; // 导航栏元素的偏移高度补齐
right: 0; right: 0;
width: 1px; width: 1.5;
height: calc(100% + 14px); height: calc(100% + 14px + 64px); // 导航栏偏移高度 + 头部高度
background: ${themeVars.color.secondary.self}; background: ${themeVars.color.secondary.self};
} }
> .repo-button-row { > .repo-button-row {
@@ -174,6 +182,7 @@ export const repoFileView = css`
background: ${themeVars.color.body}; background: ${themeVars.color.body};
height: 64px; height: 64px;
margin: 0; margin: 0;
// 固定头部, 早期父元素有多余的页脚和内容高度导致滚动时无法固定, 修复后也可保留此属性无需删除
position: sticky; position: sticky;
top: 0; top: 0;
&:after { &:after {
@@ -188,11 +197,12 @@ export const repoFileView = css`
} }
.view-file-tree-items { .view-file-tree-items {
margin-right: 0; margin-right: 0;
padding: 16px 16px 16px 0; padding: 12px 16px 8px 0;
} }
} }
// 右侧文件视图内容 // 右侧文件视图内容
.repo-view-content { .repo-view-content {
padding-bottom: 40px;
.repo-button-row { .repo-button-row {
align-content: center; align-content: center;
background: ${themeVars.color.box.header}; background: ${themeVars.color.box.header};