From 1c6b7540f38da423c6221c5759fac84d1f0e9b36 Mon Sep 17 00:00:00 2001 From: lutinglt Date: Thu, 3 Jul 2025 22:38:48 +0800 Subject: [PATCH] =?UTF-8?q?=E9=83=A8=E5=88=86=20label=20=E8=BF=81=E7=A7=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/release.md | 1 + src/core/github.ts | 10 +++++++++ src/types/color/github.ts | 12 +++++++++++ styles/components/issue.tsx | 41 +++++++++++++++++++++++++++++++++++++ styles/public/index.tsx | 1 + styles/public/label.scss | 36 -------------------------------- styles/public/label.tsx | 0 styles/public/radius.tsx | 2 -- themes/dark.css.tsx | 7 ++++--- 9 files changed, 69 insertions(+), 41 deletions(-) create mode 100644 styles/public/label.tsx diff --git a/.github/release.md b/.github/release.md index c44b438..ba86dc4 100644 --- a/.github/release.md +++ b/.github/release.md @@ -18,6 +18,7 @@ - 设置界面右上角小按钮样式同步 - 弹窗背景色和叠加背景色同步 - 全局圆角样式同步 +- 工单标签颜色同步 ## 🎈 Perf diff --git a/src/core/github.ts b/src/core/github.ts index 937bcb9..d6b65a0 100644 --- a/src/core/github.ts +++ b/src/core/github.ts @@ -45,11 +45,15 @@ export type GithubColor = { muted: string; }; success: { + emphasis: string; muted: string; }; danger: { muted: string; }; + done: { + emphasis: string; + }; default: string; inset: string; muted: string; @@ -262,6 +266,12 @@ export function defineGithubTheme(githubColor: GithubColor): Theme { accent: { emphasis: githubColor.bgColor.accent.emphasis, }, + success: { + emphasis: githubColor.bgColor.success.emphasis, + }, + done: { + emphasis: githubColor.bgColor.done.emphasis, + }, }, borderColor: { accent: { diff --git a/src/types/color/github.ts b/src/types/color/github.ts index 25737bb..a5adb12 100644 --- a/src/types/color/github.ts +++ b/src/types/color/github.ts @@ -32,6 +32,18 @@ export const github = { */ emphasis: null, }, + success: { + /** 成功的背景颜色 + * @issue `babel` 重新开启图标背景颜色 + */ + emphasis: null, + }, + done: { + /** 完成的背景颜色 + * @issue `babel` 工单已关闭图标背景颜色 + */ + emphasis: null + } }, borderColor: { accent: { diff --git a/styles/components/issue.tsx b/styles/components/issue.tsx index ba64568..dbc6d6a 100644 --- a/styles/components/issue.tsx +++ b/styles/components/issue.tsx @@ -23,3 +23,44 @@ export const button = css` } } `; + +export const babel = css` + .issue-content-left { + .badge { + // 时间线打开状态标签 + &.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; + } + } + } + // 工单&PR状态标签 + .ui.label.issue-state-label { + border-radius: 25px !important; + + &.green { + background-color: ${themeVars.github.bgColor.success.emphasis} !important; + border-color: ${themeVars.github.bgColor.success.emphasis} !important; + } + + &.red { + background-color: ${themeVars.github.bgColor.done.emphasis} !important; + border-color: ${themeVars.github.bgColor.done.emphasis} !important; + } + + &.purple { + background-color: ${themeVars.github.bgColor.done.emphasis} !important; + border-color: ${themeVars.github.bgColor.done.emphasis} !important; + } + } +`; diff --git a/styles/public/index.tsx b/styles/public/index.tsx index 9688309..fb2a279 100644 --- a/styles/public/index.tsx +++ b/styles/public/index.tsx @@ -2,6 +2,7 @@ import "./button"; // 按钮 import "./chroma"; // 代码高亮 import "./codemirror"; // codemirror 样式 import "./input"; // 输入框 +import "./label"; // 标签 import "./modal"; // 弹窗 import "./radius"; // 圆角 import "./svg"; // svg 图标 diff --git a/styles/public/label.scss b/styles/public/label.scss index 2303e90..12e68db 100644 --- a/styles/public/label.scss +++ b/styles/public/label.scss @@ -1,13 +1,4 @@ // Made by Luting ^-^ -.repo-buttons .ui.basic.label { - color: #f0f6fc; -} - -a.ui.basic.label:hover { - color: #f0f6fc; - background-color: #262c36; - border-color: var(--color-light-border); -} span, .org-visibility div { @@ -17,30 +8,7 @@ span, } } -.badge.tw-bg-green, -.ui.green.label.issue-state-label { - background-color: #238636 !important; -} - -.badge.tw-bg-red { - background-color: var(--color-purple) !important; -} - .ui.ui.ui { - &.purple.label { - border-radius: 25px !important; - } - - &.green.label.issue-state-label { - background: var(--color-primary); - border-radius: 25px !important; - } - - &.red.label.issue-state-label { - background: var(--color-purple); - border-radius: 25px !important; - } - &.primary.label { color: var(--color-blue); background-color: #388bfd33; @@ -86,10 +54,6 @@ a.ui.ui.ui { } } -.issue-list .text.red { - color: #ab7df8 !important; -} - // Runner&软件包&提交 标签 .ui.label { &.sha { diff --git a/styles/public/label.tsx b/styles/public/label.tsx new file mode 100644 index 0000000..e69de29 diff --git a/styles/public/radius.tsx b/styles/public/radius.tsx index 2459db2..9aac03b 100644 --- a/styles/public/radius.tsx +++ b/styles/public/radius.tsx @@ -58,8 +58,6 @@ export const radius = css` .ui.search.selection .prompt, .ui.pointing.dropdown > .menu, .ui.loading.form.segments:before, - .ui.secondary.menu .item, - .ui.secondary.menu .active.item, .ui.secondary.menu .dropdown.item > .menu, .ui.vertical.menu > .active.item:only-child, .ui.segments:not(.horizontal) > .segment:only-child, diff --git a/themes/dark.css.tsx b/themes/dark.css.tsx index 5575c69..d20d19f 100644 --- a/themes/dark.css.tsx +++ b/themes/dark.css.tsx @@ -41,14 +41,15 @@ const github: GithubColor = { muted: "#bb800926", }, success: { + emphasis: "#238636", muted: "#2ea04326", }, danger: { muted: "#f851491a", }, - // done: { - // emphasis: "#8957e5", - // }, + done: { + emphasis: "#8957e5", + }, default: "#0d1117", inset: "#010409", muted: "#151b23",