同步 Issue/PR 的时间线样式

This commit is contained in:
lutinglt
2025-07-11 23:38:49 +08:00
parent 4fa1d4ff18
commit 453fc5383d
4 changed files with 44 additions and 3 deletions

1
.github/release.md vendored
View File

@@ -4,6 +4,7 @@
- 同步 PR 的合并提交头像样式
- 同步 PR 中的合并提交按钮颜色
- 同步 Issue/PR 的时间线样式
## 🎈 Perf

View File

@@ -350,6 +350,9 @@ export function defineGithubTheme(githubColor: GithubColor): Theme {
},
},
control: {
bgColor: {
rest: githubColor.control.bgColor.rest,
},
transparent: {
bgColor: {
hover: githubColor.control.transparent.bgColor.hover,

View File

@@ -158,6 +158,12 @@ export const github = {
},
},
control: {
bgColor: {
/** 背景色
* @issue `timeline` 时间线标签背景色
*/
rest: null,
},
transparent: {
bgColor: {
/** 悬停色

View File

@@ -26,17 +26,14 @@ export const babel = css`
// 时间线打开状态标签
&.tw-bg-green {
background-color: ${themeVars.github.bgColor.success.emphasis} !important;
border-color: ${themeVars.github.bgColor.success.emphasis} !important;
}
// 时间线关闭状态标签
&.tw-bg-red {
background-color: ${themeVars.github.bgColor.done.emphasis} !important;
border-color: ${themeVars.github.bgColor.done.emphasis} !important;
}
// 时间线合并状态标签
&.tw-bg-purple {
background-color: ${themeVars.github.bgColor.done.emphasis} !important;
border-color: ${themeVars.github.bgColor.done.emphasis} !important;
}
}
}
@@ -141,3 +138,37 @@ export const prMerge = css`
}
}
`;
// 时间线
export const timeline = css`
.repository.view.issue {
.comment-list .timeline-item {
// 事件
&.event {
.badge {
border: 2px solid ${themeVars.color.body};
}
// 仅匹配只有 badge
.badge:not([class*=" "]) {
background-color: ${themeVars.github.control.bgColor.rest};
svg {
color: ${themeVars.color.text.light.num1};
}
}
}
// 提交
&.commits-list {
.badge svg {
color: ${themeVars.color.text.light.num1};
}
// 仅覆盖左侧 commit 不覆盖右侧 SHA
a.muted {
color: ${themeVars.color.text.light.num1};
&:hover {
color: ${themeVars.color.primary.self};
}
}
}
}
}
`;