mirror of
https://github.com/lutinglt/gitea-github-theme.git
synced 2025-10-26 13:00:31 +00:00
代码整理
This commit is contained in:
@@ -39,107 +39,40 @@ export type GithubColor = {
|
||||
muted: string;
|
||||
};
|
||||
bgColor: {
|
||||
accent: {
|
||||
emphasis: string;
|
||||
muted: string;
|
||||
};
|
||||
attention: {
|
||||
muted: string;
|
||||
};
|
||||
success: {
|
||||
emphasis: string;
|
||||
muted: string;
|
||||
};
|
||||
danger: {
|
||||
muted: string;
|
||||
};
|
||||
done: {
|
||||
emphasis: string;
|
||||
};
|
||||
accent: { emphasis: string; muted: string };
|
||||
attention: { muted: string };
|
||||
success: { emphasis: string; muted: string };
|
||||
danger: { muted: string };
|
||||
done: { emphasis: string };
|
||||
default: string;
|
||||
inset: string;
|
||||
muted: string;
|
||||
neutral: {
|
||||
muted: string;
|
||||
};
|
||||
neutral: { muted: string };
|
||||
};
|
||||
borderColor: {
|
||||
accent: {
|
||||
emphasis: string;
|
||||
};
|
||||
attention: {
|
||||
emphasis: string;
|
||||
};
|
||||
accent: { emphasis: string };
|
||||
attention: { emphasis: string };
|
||||
default: string;
|
||||
success: {
|
||||
emphasis: string;
|
||||
};
|
||||
done: {
|
||||
emphasis: string;
|
||||
};
|
||||
success: { emphasis: string };
|
||||
done: { emphasis: string };
|
||||
muted: string;
|
||||
translucent: string;
|
||||
};
|
||||
button: {
|
||||
primary: {
|
||||
fgColor: {
|
||||
rest: string;
|
||||
};
|
||||
bgColor: {
|
||||
hover: string;
|
||||
};
|
||||
};
|
||||
danger: {
|
||||
fgColor: {
|
||||
rest: string;
|
||||
hover: string;
|
||||
};
|
||||
bgColor: {
|
||||
hover: string;
|
||||
};
|
||||
};
|
||||
primary: { fgColor: { rest: string }; bgColor: { hover: string } };
|
||||
danger: { fgColor: { rest: string; hover: string }; bgColor: { hover: string } };
|
||||
};
|
||||
control: {
|
||||
bgColor: {
|
||||
active: string;
|
||||
hover: string;
|
||||
rest: string;
|
||||
};
|
||||
transparent: {
|
||||
bgColor: {
|
||||
active: string;
|
||||
hover: string;
|
||||
selected: string;
|
||||
};
|
||||
};
|
||||
};
|
||||
shadow: {
|
||||
floating: {
|
||||
small: string;
|
||||
};
|
||||
};
|
||||
overlay: {
|
||||
backdrop: {
|
||||
bgColor: string;
|
||||
};
|
||||
};
|
||||
underlineNav: {
|
||||
borderColor: {
|
||||
active: string;
|
||||
};
|
||||
bgColor: { active: string; hover: string; rest: string };
|
||||
transparent: { bgColor: { active: string; hover: string; selected: string } };
|
||||
};
|
||||
shadow: { floating: { small: string } };
|
||||
overlay: { backdrop: { bgColor: string } };
|
||||
underlineNav: { borderColor: { active: string } };
|
||||
contribution: {
|
||||
default: {
|
||||
bgColor: {
|
||||
num0: string;
|
||||
num1: string;
|
||||
num2: string;
|
||||
num3: string;
|
||||
num4: string;
|
||||
};
|
||||
borderColor: {
|
||||
num0: string;
|
||||
};
|
||||
bgColor: { num0: string; num1: string; num2: string; num3: string; num4: string };
|
||||
borderColor: { num0: string };
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -2,47 +2,22 @@ import type { Chroma } from "src/types";
|
||||
|
||||
export type prettylightsColor = {
|
||||
syntax: {
|
||||
brackethighlighter: {
|
||||
angle: string;
|
||||
unmatched: string;
|
||||
};
|
||||
carriage: {
|
||||
return: {
|
||||
bg: string;
|
||||
text: string;
|
||||
};
|
||||
};
|
||||
brackethighlighter: { angle: string; unmatched: string };
|
||||
carriage: { return: { bg: string; text: string } };
|
||||
comment: string;
|
||||
constant: string;
|
||||
constantOtherReferenceLink: string;
|
||||
entity: string;
|
||||
entityTag: string;
|
||||
invalid: {
|
||||
illegal: {
|
||||
bg: string;
|
||||
text: string;
|
||||
};
|
||||
};
|
||||
invalid: { illegal: { bg: string; text: string } };
|
||||
keyword: string;
|
||||
markup: {
|
||||
bold: string;
|
||||
changed: {
|
||||
bg: string;
|
||||
text: string;
|
||||
};
|
||||
deleted: {
|
||||
bg: string;
|
||||
text: string;
|
||||
};
|
||||
changed: { bg: string; text: string };
|
||||
deleted: { bg: string; text: string };
|
||||
heading: string;
|
||||
ignored: {
|
||||
bg: string;
|
||||
text: string;
|
||||
};
|
||||
inserted: {
|
||||
bg: string;
|
||||
text: string;
|
||||
};
|
||||
ignored: { bg: string; text: string };
|
||||
inserted: { bg: string; text: string };
|
||||
italic: string;
|
||||
list: string;
|
||||
};
|
||||
|
||||
@@ -39,9 +39,7 @@ export function createTheme(theme: Theme): void {
|
||||
}
|
||||
createGlobalTheme(":root", themeVars, theme);
|
||||
createGlobalTheme(":root", otherThemeVars, {
|
||||
border: {
|
||||
radius: "6px",
|
||||
},
|
||||
border: { radius: "6px" },
|
||||
color: {
|
||||
git: "#f05133",
|
||||
light: {
|
||||
|
||||
@@ -1,12 +1,4 @@
|
||||
const num = {
|
||||
num1: null,
|
||||
num2: null,
|
||||
num3: null,
|
||||
num4: null,
|
||||
num5: null,
|
||||
num6: null,
|
||||
num7: null,
|
||||
};
|
||||
const num = { num1: null, num2: null, num3: null, num4: null, num5: null, num6: null, num7: null };
|
||||
|
||||
const alpha = {
|
||||
num10: null,
|
||||
@@ -20,33 +12,12 @@ const alpha = {
|
||||
num90: null,
|
||||
};
|
||||
|
||||
export const primary = {
|
||||
self: null,
|
||||
contrast: null,
|
||||
dark: num,
|
||||
light: num,
|
||||
alpha: alpha,
|
||||
hover: null,
|
||||
active: null,
|
||||
};
|
||||
export const primary = { self: null, contrast: null, dark: num, light: num, alpha: alpha, hover: null, active: null };
|
||||
|
||||
export const secondary = {
|
||||
self: null,
|
||||
dark: {
|
||||
num8: null,
|
||||
num9: null,
|
||||
num10: null,
|
||||
num11: null,
|
||||
num12: null,
|
||||
num13: null,
|
||||
...num,
|
||||
},
|
||||
light: {
|
||||
num1: null,
|
||||
num2: null,
|
||||
num3: null,
|
||||
num4: null,
|
||||
},
|
||||
dark: { num8: null, num9: null, num10: null, num11: null, num12: null, num13: null, ...num },
|
||||
light: { num1: null, num2: null, num3: null, num4: null },
|
||||
alpha: alpha,
|
||||
button: null,
|
||||
hover: null,
|
||||
|
||||
@@ -1,32 +1,8 @@
|
||||
const msg = {
|
||||
bg: null,
|
||||
border: null,
|
||||
text: null,
|
||||
};
|
||||
const msg = { bg: null, border: null, text: null };
|
||||
|
||||
const error = {
|
||||
...msg,
|
||||
bg: {
|
||||
self: null,
|
||||
active: null,
|
||||
hover: null,
|
||||
},
|
||||
};
|
||||
const error = { ...msg, bg: { self: null, active: null, hover: null } };
|
||||
const success = { ...msg };
|
||||
const warning = { ...msg };
|
||||
const info = { ...msg };
|
||||
|
||||
const success = {
|
||||
...msg,
|
||||
};
|
||||
|
||||
const warning = {
|
||||
...msg,
|
||||
};
|
||||
const info = {
|
||||
...msg,
|
||||
};
|
||||
|
||||
export const message = {
|
||||
error,
|
||||
success,
|
||||
warning,
|
||||
info,
|
||||
};
|
||||
export const message = { error, success, warning, info };
|
||||
|
||||
@@ -1,11 +1,4 @@
|
||||
const baseColor = {
|
||||
self: null,
|
||||
light: null,
|
||||
dark: {
|
||||
num1: null,
|
||||
num2: null,
|
||||
},
|
||||
};
|
||||
const baseColor = { self: null, light: null, dark: { num1: null, num2: null } };
|
||||
|
||||
const commitColor = {
|
||||
/** 提交哈希值颜色 */
|
||||
@@ -23,26 +16,14 @@ const commitColor = {
|
||||
|
||||
export const named = {
|
||||
/** 红色/提交警告签名颜色 */
|
||||
red: {
|
||||
...commitColor,
|
||||
...baseColor,
|
||||
},
|
||||
red: { ...commitColor, ...baseColor },
|
||||
/** 橙色/提交未匹配签名颜色 */
|
||||
orange: {
|
||||
...commitColor,
|
||||
...baseColor,
|
||||
},
|
||||
orange: { ...commitColor, ...baseColor },
|
||||
/** 黄色/提交未信任签名颜色 */
|
||||
yellow: {
|
||||
...commitColor,
|
||||
...baseColor,
|
||||
},
|
||||
yellow: { ...commitColor, ...baseColor },
|
||||
olive: baseColor,
|
||||
/** 绿色/提交信任签名颜色 */
|
||||
green: {
|
||||
...commitColor,
|
||||
...baseColor,
|
||||
},
|
||||
green: { ...commitColor, ...baseColor },
|
||||
teal: baseColor,
|
||||
blue: baseColor,
|
||||
violet: baseColor,
|
||||
@@ -50,10 +31,7 @@ export const named = {
|
||||
pink: baseColor,
|
||||
brown: baseColor,
|
||||
black: baseColor,
|
||||
grey: {
|
||||
self: null,
|
||||
light: null,
|
||||
},
|
||||
grey: { self: null, light: null },
|
||||
gold: null,
|
||||
white: null,
|
||||
};
|
||||
|
||||
@@ -8,9 +8,7 @@ function varMapper(prefix: string | null = null) {
|
||||
path = path.map(item => item.replace(/^num/, ""));
|
||||
value = path.join("-");
|
||||
}
|
||||
if (prefix) {
|
||||
value = `${prefix}-${value}`;
|
||||
}
|
||||
if (prefix) value = `${prefix}-${value}`;
|
||||
return value;
|
||||
};
|
||||
}
|
||||
@@ -32,26 +30,13 @@ const vars = {
|
||||
github: color.github,
|
||||
};
|
||||
|
||||
const otherVars = {
|
||||
border: {
|
||||
radius: null,
|
||||
},
|
||||
color: {
|
||||
...color.otherAuto,
|
||||
},
|
||||
};
|
||||
const otherVars = { border: { radius: null }, color: { ...color.otherAuto } };
|
||||
|
||||
const customVars = {
|
||||
cloneMenuWidth: "clone-menu-width",
|
||||
explore: {
|
||||
repolistColumns: "explore-repolist-columns",
|
||||
userlistColumns: "explore-userlist-columns",
|
||||
},
|
||||
explore: { repolistColumns: "explore-repolist-columns", userlistColumns: "explore-userlist-columns" },
|
||||
userRepolistColumns: "user-repolist-columns",
|
||||
org: {
|
||||
repolistColumns: "org-repolist-columns",
|
||||
userlistColumns: "org-userlist-columns",
|
||||
},
|
||||
org: { repolistColumns: "org-repolist-columns", userlistColumns: "org-userlist-columns" },
|
||||
};
|
||||
|
||||
export const themeVars = createGlobalThemeContract(vars, varMapper());
|
||||
|
||||
@@ -221,6 +221,7 @@ export const actionViewRight = css`
|
||||
padding: 8px 10px;
|
||||
|
||||
&.selected {
|
||||
// 滚动时固定在顶部的高度与 job-info-header 高度相同
|
||||
top: 80px;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user