声明全部颜色变量

This commit is contained in:
lutinglt
2025-06-27 01:13:52 +08:00
parent b5dc00e853
commit 16298f2b11
7 changed files with 145 additions and 13 deletions

103
src/types/color/based.ts Normal file
View File

@@ -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",
};

View File

@@ -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";

View File

@@ -48,4 +48,7 @@ export const secondary = {
num4: null,
},
alpha: alpha,
button: null,
hover: null,
active: null,
};

View File

@@ -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,

View File

@@ -3,4 +3,4 @@ import * as color from "./color";
export type Primary = MapLeafNodes<typeof color.primary, string>;
export type Secondary = MapLeafNodes<typeof color.secondary, string>;
export type Self = MapLeafNodes<typeof color.self, string>;
export type Named = MapLeafNodes<typeof color.named, string>;

View File

@@ -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,
},
};

View File

@@ -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;
}