diff --git a/src/core/github.ts b/src/core/github.ts index 72a2295..d2378cf 100644 --- a/src/core/github.ts +++ b/src/core/github.ts @@ -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 }; }; }; }; diff --git a/src/core/prettylights.ts b/src/core/prettylights.ts index 43170fb..162df8e 100644 --- a/src/core/prettylights.ts +++ b/src/core/prettylights.ts @@ -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; }; diff --git a/src/core/theme.ts b/src/core/theme.ts index 0783168..7e0ae41 100644 --- a/src/core/theme.ts +++ b/src/core/theme.ts @@ -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: { diff --git a/src/types/color/main.ts b/src/types/color/main.ts index 908b41d..5bb40c1 100644 --- a/src/types/color/main.ts +++ b/src/types/color/main.ts @@ -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, diff --git a/src/types/color/message.ts b/src/types/color/message.ts index effbf63..9d4b502 100644 --- a/src/types/color/message.ts +++ b/src/types/color/message.ts @@ -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 }; diff --git a/src/types/color/named.ts b/src/types/color/named.ts index d783e2a..dac81b7 100644 --- a/src/types/color/named.ts +++ b/src/types/color/named.ts @@ -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, }; diff --git a/src/types/vars.ts b/src/types/vars.ts index cd02d3a..a8651f8 100644 --- a/src/types/vars.ts +++ b/src/types/vars.ts @@ -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()); diff --git a/styles/components/actions.ts b/styles/components/actions.ts index b041e7c..eb2c76c 100644 --- a/styles/components/actions.ts +++ b/styles/components/actions.ts @@ -221,6 +221,7 @@ export const actionViewRight = css` padding: 8px 10px; &.selected { + // 滚动时固定在顶部的高度与 job-info-header 高度相同 top: 80px; }