From 16298f2b11b0c7ed7504bc350a6ca08a3ea9b56c Mon Sep 17 00:00:00 2001 From: lutinglt Date: Fri, 27 Jun 2025 01:13:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A3=B0=E6=98=8E=E5=85=A8=E9=83=A8=E9=A2=9C?= =?UTF-8?q?=E8=89=B2=E5=8F=98=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/types/color/based.ts | 103 +++++++++++++++++++++++++++++++++++++ src/types/color/index.ts | 3 +- src/types/color/main.ts | 3 ++ src/types/color/named.ts | 6 +-- src/types/index.ts | 2 +- src/types/vars.ts | 13 ++++- themes/dark/gitea-dark.css | 28 +++++++--- 7 files changed, 145 insertions(+), 13 deletions(-) create mode 100644 src/types/color/based.ts diff --git a/src/types/color/based.ts b/src/types/color/based.ts new file mode 100644 index 0000000..a981ff6 --- /dev/null +++ b/src/types/color/based.ts @@ -0,0 +1,103 @@ +export const based = { + /** 未知 */ + git: null, + /** 主要背景色 */ + body: null, + /** 页面底部状态栏背景色 */ + footer: null, + /** Issue 等页面时间线的线颜色 */ + timeline: null, + /** 一些盒子颜色, 比如仓库文件列表 */ + box: { + header: null, + body: { + self: null, + highlight: null, + }, + }, + /** 文本 */ + text: { + self: null, + light: { + self: null, + num1: null, + num2: null, + num3: null, + }, + dark: null, + }, + /** 输入框 */ + input: { + background: null, + border: { + self: null, + hover: null, + }, + text: null, + toggleBackgound: "color-input-toggle-background", + }, + light: { + self: null, + mimicEnabled: "color-light-mimic-enabled", + border: null, + }, + hover: { + self: null, + opaque: null, + }, + active: null, + menu: null, + card: null, + markup: { + tableRow: "color-markup-table-row", + code: { + block: null, + inline: null, + }, + }, + button: null, + codeBg: "color-code-bg", + shadow: { + self: null, + opaque: null, + }, + secondaryBg: "color-secondary-bg", + expandButton: "color-expand-button", + placeholderText: "color-placeholder-text", + editorLineHighlight: "color-editor-line-highlight", + projectColumnBg: "color-project-column-bg", + caret: null, + reaction: { + bg: null, + hoverBg: "color-reaction-hover-bg", + activeBg: "color-reaction-active-bg", + }, + tooltip: { + text: null, + bg: null, + }, + nav: { + bg: null, + hoverBg: "color-nav-hover-bg", + text: null, + }, + secondaryNavBg: "color-secondary-nav-bg", + /** 标签 */ + label: { + text: null, + bg: null, + hover: { + bg: null, + }, + active: { + bg: null, + }, + }, + accent: null, + smallAccent: "color-small-accent", + highlight: { + bg: null, + fg: null, + }, + overlayBackdrop: "color-overlay-backdrop", +}; diff --git a/src/types/color/index.ts b/src/types/color/index.ts index f1a4fe3..0a3ee70 100644 --- a/src/types/color/index.ts +++ b/src/types/color/index.ts @@ -1,5 +1,6 @@ +export { based } from "./based"; export { ansi, console } from "./console"; export { diff } from "./diff"; export { primary, secondary } from "./main"; export { error, info, success, warning } from "./message"; -export { self } from "./named"; +export { named } from "./named"; diff --git a/src/types/color/main.ts b/src/types/color/main.ts index c342eb2..908b41d 100644 --- a/src/types/color/main.ts +++ b/src/types/color/main.ts @@ -48,4 +48,7 @@ export const secondary = { num4: null, }, alpha: alpha, + button: null, + hover: null, + active: null, }; diff --git a/src/types/color/named.ts b/src/types/color/named.ts index 16f014b..d783e2a 100644 --- a/src/types/color/named.ts +++ b/src/types/color/named.ts @@ -21,7 +21,7 @@ const commitColor = { }, }; -export const self = { +export const named = { /** 红色/提交警告签名颜色 */ red: { ...commitColor, @@ -35,13 +35,13 @@ export const self = { /** 黄色/提交未信任签名颜色 */ yellow: { ...commitColor, - ...baseColor + ...baseColor, }, olive: baseColor, /** 绿色/提交信任签名颜色 */ green: { ...commitColor, - ...baseColor + ...baseColor, }, teal: baseColor, blue: baseColor, diff --git a/src/types/index.ts b/src/types/index.ts index 646880f..9628757 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -3,4 +3,4 @@ import * as color from "./color"; export type Primary = MapLeafNodes; export type Secondary = MapLeafNodes; -export type Self = MapLeafNodes; +export type Named = MapLeafNodes; diff --git a/src/types/vars.ts b/src/types/vars.ts index 278cd90..1f38028 100644 --- a/src/types/vars.ts +++ b/src/types/vars.ts @@ -14,8 +14,19 @@ const vars = { /** 用于标识当前是否为暗色主题: `"true"` 暗色 `"false"` 亮色 */ isDarkTheme: "is-dark-theme", color: { - blue: null, primary: color.primary, + secondary: color.secondary, + self: { + ...color.based, + ...color.named, + }, + ansi: color.ansi, + console: color.console, + diff: color.diff, + error: color.error, + success: color.success, + warning: color.warning, + info: color.info, }, }; diff --git a/themes/dark/gitea-dark.css b/themes/dark/gitea-dark.css index 40a638f..267f813 100644 --- a/themes/dark/gitea-dark.css +++ b/themes/dark/gitea-dark.css @@ -212,43 +212,57 @@ --color-input-border: var(--color-light-border); --color-input-border-hover: var(--color-light-border); - --color-header-wrapper: #0d1117; - --color-header-wrapper-transparent: #20243000; - --color-light: #00000028; --color-light-mimic-enabled: rgba(0, 0, 0, calc(40 / 255 * 222 / 255 / var(--opacity-disabled))); --color-light-border: #3d444d; + --color-hover: #656c7633; + --color-hover-opaque: ; + --color-active: #161a21; --color-menu: #0d1117; --color-card: #0d1117; --color-markup-table-row: #ffffff06; --color-markup-code-block: #ffffff16; + --color-markup-code-inline: ; + --color-button: #212830; --color-code-bg: #0d1117; - --color-code-sidebar-bg: #232834; + --color-shadow: #00000060; + --color-shadow-opaque: ; + --color-secondary-bg: #ffffff26; - --color-text-focus: #fff; + --color-expand-button: #3c404d; --color-placeholder-text: #8a8e99; --color-editor-line-highlight: var(--color-primary-light-5); - --color-project-board-bg: var(--color-secondary-light-2); + --color-project-column-bg: var(--color-secondary-light-2); + --color-caret: var(--color-text); + --color-reaction-bg: #ffffff12; --color-reaction-hover-bg: var(--color-primary-light-4); --color-reaction-active-bg: var(--color-primary-light-5); + --color-tooltip-text: #fff; --color-tooltip-bg: #000000f0; + --color-nav-bg: #010409; --color-nav-hover-bg: var(--color-hover); + --color-nav-text: ; + --color-secondary-nav-bg: ; + --color-label-text: #fff; --color-label-bg: #7c84974b; --color-label-hover-bg: #7c8497a0; --color-label-active-bg: #7c8497; --color-accent: var(--color-primary-light-1); --color-small-accent: var(--color-primary-light-5); - --color-active-line: #534d1b; + + --color-highlight-bg: ; + --color-highlight-fg: ; + --color-overlay-backdrop: ; accent-color: var(--color-accent); color-scheme: dark; }