From 453fc5383d06affc3428188f8d20fc3929136722 Mon Sep 17 00:00:00 2001 From: lutinglt Date: Fri, 11 Jul 2025 23:38:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5=20Issue/PR=20=E7=9A=84?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E7=BA=BF=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/release.md | 1 + src/core/github.ts | 3 +++ src/types/color/github.ts | 6 ++++++ styles/components/issue.tsx | 37 ++++++++++++++++++++++++++++++++++--- 4 files changed, 44 insertions(+), 3 deletions(-) diff --git a/.github/release.md b/.github/release.md index c9ef298..1d3367b 100644 --- a/.github/release.md +++ b/.github/release.md @@ -4,6 +4,7 @@ - 同步 PR 的合并提交头像样式 - 同步 PR 中的合并提交按钮颜色 +- 同步 Issue/PR 的时间线样式 ## 🎈 Perf diff --git a/src/core/github.ts b/src/core/github.ts index 5bda3ae..02255e3 100644 --- a/src/core/github.ts +++ b/src/core/github.ts @@ -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, diff --git a/src/types/color/github.ts b/src/types/color/github.ts index 87a514a..e31cd0c 100644 --- a/src/types/color/github.ts +++ b/src/types/color/github.ts @@ -158,6 +158,12 @@ export const github = { }, }, control: { + bgColor: { + /** 背景色 + * @issue `timeline` 时间线标签背景色 + */ + rest: null, + }, transparent: { bgColor: { /** 悬停色 diff --git a/styles/components/issue.tsx b/styles/components/issue.tsx index c9d3722..28f830e 100644 --- a/styles/components/issue.tsx +++ b/styles/components/issue.tsx @@ -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}; + } + } + } + } + } +`;