From aa023116aef446a59ed7ae165eb6a1126340156c Mon Sep 17 00:00:00 2001 From: lutinglt Date: Sun, 6 Jul 2025 11:48:09 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A1=AE=E8=AE=A4gitea=E6=96=B0=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E4=B8=8D=E5=86=8D=E4=BD=BF=E7=94=A8codemirror?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/github.ts | 10 ++++ src/types/color/github.ts | 8 ++++ styles/components/clone.tsx | 2 +- styles/public/codemirror.tsx | 89 ------------------------------------ styles/public/index.tsx | 1 - themes/dark.css.tsx | 5 ++ 6 files changed, 24 insertions(+), 91 deletions(-) delete mode 100644 styles/public/codemirror.tsx diff --git a/src/core/github.ts b/src/core/github.ts index 0df84b1..dc4af5c 100644 --- a/src/core/github.ts +++ b/src/core/github.ts @@ -121,6 +121,11 @@ export type GithubColor = { bgColor: string; }; }; + underlineNav: { + borderColor: { + active: string; + }; + }; contribution: { default: { bgColor: { @@ -358,6 +363,11 @@ export function defineGithubTheme(githubColor: GithubColor): Theme { small: `0px 0px 0px 1px ${themeVars.color.light.border}, 0px 6px 12px -3px ${themeVars.color.shadow.self}, 0px 6px 18px 0px ${themeVars.color.shadow.self};`, }, }, + underlineNav: { + borderColor: { + active: githubColor.underlineNav.borderColor.active, + }, + }, contribution: { default: { bgColor: { diff --git a/src/types/color/github.ts b/src/types/color/github.ts index 4d37200..0d968a5 100644 --- a/src/types/color/github.ts +++ b/src/types/color/github.ts @@ -175,6 +175,14 @@ export const github = { small: null, }, }, + underlineNav: { + borderColor: { + /** 下划线导航栏的边框颜色 + * @clone `clone` 按钮组的按钮下划线颜色 + */ + active: null, + }, + }, /** 热力图 */ contribution: { default: { diff --git a/styles/components/clone.tsx b/styles/components/clone.tsx index 3c3503b..a05105f 100644 --- a/styles/components/clone.tsx +++ b/styles/components/clone.tsx @@ -33,7 +33,7 @@ export const clone = css` left: 0; width: 100%; height: 2px; - background: #f78166; + background: ${themeVars.github.underlineNav.borderColor.active}; } } .item.active { diff --git a/styles/public/codemirror.tsx b/styles/public/codemirror.tsx deleted file mode 100644 index 47dd10a..0000000 --- a/styles/public/codemirror.tsx +++ /dev/null @@ -1,89 +0,0 @@ -import { css } from "src/types/vars"; - -export const codemirror = css` - .CodeMirror.cm-s-default, - .CodeMirror.cm-s-paper { - .cm-property { - color: #a0cc75; - } - .cm-header { - color: #9daccc; - } - - .cm-quote { - color: #090; - } - - .cm-keyword { - color: #cc8a61; - } - - .cm-atom { - color: #ef5e77; - } - - .cm-number { - color: #ff5656; - } - - .cm-def { - color: #e4e4e4; - } - - .cm-variable-2 { - color: #00bdbf; - } - - .cm-variable-3 { - color: #085; - } - - .cm-comment { - color: #8e9ab3; - } - - .cm-string { - color: #a77272; - } - - .cm-string-2 { - color: #f50; - } - - .cm-meta, - .cm-qualifier { - color: #ffb176; - } - - .cm-builtin { - color: #b7c951; - } - - .cm-bracket { - color: #997; - } - - .cm-tag { - color: #f1d273; - } - - .cm-attribute { - color: #bfcc70; - } - - .cm-hr { - color: #999; - } - - .cm-url { - color: #c5cfd0; - } - - .cm-link { - color: #d8c792; - } - .cm-error { - color: #dbdbeb; - } - } -`; diff --git a/styles/public/index.tsx b/styles/public/index.tsx index 606f65e..d669270 100644 --- a/styles/public/index.tsx +++ b/styles/public/index.tsx @@ -4,7 +4,6 @@ import "./radius"; // 圆角, 此样式为基础样式, 确保在其他样式之前导入 import "./button"; // 按钮 import "./chroma"; // 代码高亮 -import "./codemirror"; // codemirror 样式 import "./dropdown"; // 下拉框 import "./input"; // 输入框 import "./label"; // 标签 diff --git a/themes/dark.css.tsx b/themes/dark.css.tsx index 3c4d669..482e4de 100644 --- a/themes/dark.css.tsx +++ b/themes/dark.css.tsx @@ -119,6 +119,11 @@ const github: GithubColor = { bgColor: "#21283066", }, }, + underlineNav: { + borderColor: { + active: "#f78166", + }, + }, contribution: { default: { bgColor: {