mirror of
https://github.com/lutinglt/gitea-github-theme.git
synced 2025-10-26 13:00:31 +00:00
支持柔和的暗色主题
This commit is contained in:
1
.github/release.md
vendored
1
.github/release.md
vendored
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
- 支持自动颜色主题 (跟随系统)
|
- 支持自动颜色主题 (跟随系统)
|
||||||
- 支持亮色主题
|
- 支持亮色主题
|
||||||
|
- 支持柔和的暗色主题 (dark-dimmed)
|
||||||
|
|
||||||
## 🌈 Style
|
## 🌈 Style
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@@ -20,7 +20,7 @@ jobs:
|
|||||||
export TZ=Asia/Shanghai
|
export TZ=Asia/Shanghai
|
||||||
TAG="v$(npm run -s version).$(date +%y%m%d%H%M)"
|
TAG="v$(npm run -s version).$(date +%y%m%d%H%M)"
|
||||||
cd dist
|
cd dist
|
||||||
tar -zcf theme-github.tar.gz --remove-files theme-github-auto.css theme-github-light.css theme-github-dark.css
|
tar -zcf theme-github.tar.gz --remove-files theme-github-auto.css theme-github-light.css theme-github-dark.css theme-github-soft-dark.css
|
||||||
gh release create "$TAG" * --notes-file .github/release.md --draft -t $TAG
|
gh release create "$TAG" * --notes-file .github/release.md --draft -t $TAG
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ github.token }}
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
```ini
|
```ini
|
||||||
[ui]
|
[ui]
|
||||||
THEMES = gitea-auto, gitea-light, gitea-dark, github-auto, github-light, github-dark
|
THEMES = gitea-auto, gitea-light, gitea-dark, github-auto, github-light, github-dark, github-soft-dark
|
||||||
```
|
```
|
||||||
|
|
||||||
详细请查看 Gitea 文档
|
详细请查看 Gitea 文档
|
||||||
|
|||||||
1
TODO.md
1
TODO.md
@@ -4,7 +4,6 @@
|
|||||||
- issue/PR 列表样式 github 布局
|
- issue/PR 列表样式 github 布局
|
||||||
- styles/themes 库组件导出整理
|
- styles/themes 库组件导出整理
|
||||||
- defineTheme 颜色生成代码重构
|
- defineTheme 颜色生成代码重构
|
||||||
- 自动颜色主题生成
|
|
||||||
|
|
||||||
### 其他
|
### 其他
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { saturate } from "polished";
|
import { saturate } from "polished";
|
||||||
import type { Console, Diff, Other } from "src";
|
import type { Console, Diff, Other } from "src";
|
||||||
import { scaleColorLight } from "src/functions";
|
import { scaleColorLight } from "src/functions";
|
||||||
import type { Github } from "src/types";
|
import type { Chroma, Github } from "src/types";
|
||||||
import { themeVars } from "src/types/vars";
|
import { themeVars } from "src/types/vars";
|
||||||
import { defineTheme } from "./color";
|
import { defineTheme } from "./color";
|
||||||
import type { Theme } from "./theme";
|
import type { Theme } from "./theme";
|
||||||
@@ -144,7 +144,7 @@ export type GithubColor = {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
export function defineGithubTheme(githubColor: GithubColor): Theme {
|
export function defineGithubTheme(githubColor: GithubColor, chroma: Chroma | null = null): Theme {
|
||||||
const console: Console = {
|
const console: Console = {
|
||||||
fg: {
|
fg: {
|
||||||
self: githubColor.fgColor.default,
|
self: githubColor.fgColor.default,
|
||||||
@@ -394,30 +394,33 @@ export function defineGithubTheme(githubColor: GithubColor): Theme {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
return defineTheme({
|
return defineTheme(
|
||||||
isDarkTheme: githubColor.isDarkTheme,
|
{
|
||||||
primary: githubColor.fgColor.accent,
|
isDarkTheme: githubColor.isDarkTheme,
|
||||||
primaryContrast: githubColor.fgColor.default,
|
primary: githubColor.fgColor.accent,
|
||||||
secondary: githubColor.borderColor.default,
|
primaryContrast: githubColor.fgColor.default,
|
||||||
red: githubColor.fgColor.danger,
|
secondary: githubColor.borderColor.default,
|
||||||
orange: githubColor.fgColor.severe,
|
red: githubColor.fgColor.danger,
|
||||||
yellow: githubColor.fgColor.attention,
|
orange: githubColor.fgColor.severe,
|
||||||
olive: githubColor.display.olive.fgColor,
|
yellow: githubColor.fgColor.attention,
|
||||||
green: githubColor.fgColor.success,
|
olive: githubColor.display.olive.fgColor,
|
||||||
cyan: githubColor.display.cyan.fgColor,
|
green: githubColor.fgColor.success,
|
||||||
teal: githubColor.display.teal.fgColor,
|
cyan: githubColor.display.cyan.fgColor,
|
||||||
blue: githubColor.fgColor.accent,
|
teal: githubColor.display.teal.fgColor,
|
||||||
violet: githubColor.display.indigo.fgColor,
|
blue: githubColor.fgColor.accent,
|
||||||
purple: githubColor.fgColor.done,
|
violet: githubColor.display.indigo.fgColor,
|
||||||
pink: githubColor.fgColor.sponsors,
|
purple: githubColor.fgColor.done,
|
||||||
brown: githubColor.display.brown.fgColor,
|
pink: githubColor.fgColor.sponsors,
|
||||||
black: githubColor.fgColor.black,
|
brown: githubColor.display.brown.fgColor,
|
||||||
grey: githubColor.fgColor.neutral,
|
black: githubColor.fgColor.black,
|
||||||
gold: githubColor.display.lemon.fgColor,
|
grey: githubColor.fgColor.neutral,
|
||||||
white: githubColor.fgColor.white,
|
gold: githubColor.display.lemon.fgColor,
|
||||||
console,
|
white: githubColor.fgColor.white,
|
||||||
diff,
|
console,
|
||||||
other,
|
diff,
|
||||||
github,
|
other,
|
||||||
});
|
github,
|
||||||
|
},
|
||||||
|
chroma
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,13 +24,13 @@ export default defineGithubTheme({
|
|||||||
default: "#f0f6fc",
|
default: "#f0f6fc",
|
||||||
disabled: "#656c7699",
|
disabled: "#656c7699",
|
||||||
done: "#ab7df8",
|
done: "#ab7df8",
|
||||||
|
muted: "#9198a1",
|
||||||
neutral: "#9198a1",
|
neutral: "#9198a1",
|
||||||
severe: "#db6d28",
|
severe: "#db6d28",
|
||||||
sponsors: "#db61a2",
|
sponsors: "#db61a2",
|
||||||
success: "#3fb950",
|
success: "#3fb950",
|
||||||
black: "#010409",
|
black: "#010409",
|
||||||
white: "#ffffff",
|
white: "#ffffff",
|
||||||
muted: "#9198a1",
|
|
||||||
},
|
},
|
||||||
bgColor: {
|
bgColor: {
|
||||||
accent: { emphasis: "#1f6feb", muted: "#388bfd1a" },
|
accent: { emphasis: "#1f6feb", muted: "#388bfd1a" },
|
||||||
|
|||||||
@@ -24,13 +24,13 @@ export default defineGithubTheme({
|
|||||||
default: "#1f2328",
|
default: "#1f2328",
|
||||||
disabled: "#818b98",
|
disabled: "#818b98",
|
||||||
done: "#8250df",
|
done: "#8250df",
|
||||||
|
muted: "#59636e",
|
||||||
neutral: "#59636e",
|
neutral: "#59636e",
|
||||||
severe: "#bc4c00",
|
severe: "#bc4c00",
|
||||||
sponsors: "#bf3989",
|
sponsors: "#bf3989",
|
||||||
success: "#1a7f37",
|
success: "#1a7f37",
|
||||||
black: "#1f2328",
|
black: "#1f2328",
|
||||||
white: "#ffffff",
|
white: "#ffffff",
|
||||||
muted: "#59636e",
|
|
||||||
},
|
},
|
||||||
bgColor: {
|
bgColor: {
|
||||||
accent: { emphasis: "#0969da", muted: "#ddf4ff" },
|
accent: { emphasis: "#0969da", muted: "#ddf4ff" },
|
||||||
|
|||||||
129
themes/soft-dark.css.ts
Normal file
129
themes/soft-dark.css.ts
Normal file
@@ -0,0 +1,129 @@
|
|||||||
|
import { defineGithubTheme } from "src/core/github";
|
||||||
|
import { prettylights2Chroma } from "src/core/prettylights";
|
||||||
|
|
||||||
|
export default defineGithubTheme(
|
||||||
|
{
|
||||||
|
isDarkTheme: true,
|
||||||
|
display: {
|
||||||
|
brown: { fgColor: "#b69a6d" },
|
||||||
|
cyan: { fgColor: "#07ace4" },
|
||||||
|
indigo: { fgColor: "#9899ec" },
|
||||||
|
lemon: { fgColor: "#ba9b12" },
|
||||||
|
olive: { fgColor: "#a2a626" },
|
||||||
|
teal: { fgColor: "#1cb0ab" },
|
||||||
|
},
|
||||||
|
diffBlob: {
|
||||||
|
addtionNum: { bgColor: "#57ab5a4d" },
|
||||||
|
addtionWord: { bgColor: "#46954a66" },
|
||||||
|
deletionNum: { bgColor: "#e5534b4d" },
|
||||||
|
deletionWord: { bgColor: "#e5534b66" },
|
||||||
|
hunkNum: { bgColor: { rest: "#143d79" } },
|
||||||
|
},
|
||||||
|
fgColor: {
|
||||||
|
accent: "#478be6",
|
||||||
|
attention: "#c69026",
|
||||||
|
danger: "#e5534b",
|
||||||
|
default: "#d1d7e0",
|
||||||
|
disabled: "#656c76",
|
||||||
|
done: "#986ee2",
|
||||||
|
muted: "#9198a1",
|
||||||
|
neutral: "#9198a1",
|
||||||
|
severe: "#cc6b2c",
|
||||||
|
sponsors: "#c96198",
|
||||||
|
success: "#57ab5a",
|
||||||
|
black: "#010409",
|
||||||
|
white: "#cdd9e5",
|
||||||
|
},
|
||||||
|
bgColor: {
|
||||||
|
accent: { emphasis: "#316dca", muted: "#4184e41a" },
|
||||||
|
attention: { muted: "#ae7c1426" },
|
||||||
|
success: { emphasis: "#347d39", muted: "#46954a26" },
|
||||||
|
danger: { muted: "#e5534b1a" },
|
||||||
|
done: { emphasis: "#8256d0" },
|
||||||
|
default: "#212830",
|
||||||
|
inset: "#151b23",
|
||||||
|
muted: "#262c36",
|
||||||
|
neutral: { muted: "#656c7633" },
|
||||||
|
},
|
||||||
|
borderColor: {
|
||||||
|
accent: { emphasis: "#316dca" },
|
||||||
|
default: "#3d444d",
|
||||||
|
attention: { emphasis: "#966600" },
|
||||||
|
success: { emphasis: "#347d39" },
|
||||||
|
done: { emphasis: "#8256d0" },
|
||||||
|
muted: "#3d444db3",
|
||||||
|
translucent: "#cdd9e526",
|
||||||
|
},
|
||||||
|
button: {
|
||||||
|
primary: { fgColor: { rest: "#ffffff" }, bgColor: { hover: "#3b8640" } },
|
||||||
|
danger: { fgColor: { rest: "#ea5c53", hover: "#ffffff" }, bgColor: { hover: "#ad2e2c" } },
|
||||||
|
},
|
||||||
|
control: {
|
||||||
|
bgColor: { active: "#3d444d", hover: "#2f3742", rest: "#2a313c" },
|
||||||
|
transparent: { bgColor: { active: "#656c7633", hover: "#656c7626", selected: "#656c761a" } },
|
||||||
|
},
|
||||||
|
shadow: { floating: { small: "#01040966" } },
|
||||||
|
overlay: { backdrop: { bgColor: "#262c3666" } },
|
||||||
|
underlineNav: { borderColor: { active: "#ec775c" } },
|
||||||
|
contribution: {
|
||||||
|
default: {
|
||||||
|
bgColor: { num0: "#2a313c", num1: "#1b4721", num2: "#2b6a30", num3: "#46954a", num4: "#6bc46d" },
|
||||||
|
borderColor: { num0: "#0104090d" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
prettylights2Chroma({
|
||||||
|
syntax: {
|
||||||
|
brackethighlighter: {
|
||||||
|
angle: "#9198a1",
|
||||||
|
unmatched: "#e5534b",
|
||||||
|
},
|
||||||
|
carriage: {
|
||||||
|
return: {
|
||||||
|
bg: "#ad2e2c",
|
||||||
|
text: "#f0f6fc",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
comment: "#9198a1",
|
||||||
|
constant: "#6cb6ff",
|
||||||
|
constantOtherReferenceLink: "#96d0ff",
|
||||||
|
entity: "#dcbdfb",
|
||||||
|
entityTag: "#8ddb8c",
|
||||||
|
invalid: {
|
||||||
|
illegal: {
|
||||||
|
bg: "#922323",
|
||||||
|
text: "#f0f6fc",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
keyword: "#f47067",
|
||||||
|
markup: {
|
||||||
|
bold: "#f0f6fc",
|
||||||
|
changed: {
|
||||||
|
bg: "#682d0f",
|
||||||
|
text: "#ffddb0",
|
||||||
|
},
|
||||||
|
deleted: {
|
||||||
|
bg: "#78191b",
|
||||||
|
text: "#ffd8d3",
|
||||||
|
},
|
||||||
|
heading: "#316dca",
|
||||||
|
ignored: {
|
||||||
|
bg: "#255ab2",
|
||||||
|
text: "#f0f6fc",
|
||||||
|
},
|
||||||
|
inserted: {
|
||||||
|
bg: "#1b4721",
|
||||||
|
text: "#b4f1b4",
|
||||||
|
},
|
||||||
|
italic: "#f0f6fc",
|
||||||
|
list: "#eac55f",
|
||||||
|
},
|
||||||
|
metaDiffRange: "#dcbdfb",
|
||||||
|
storageModifierImport: "#f0f6fc",
|
||||||
|
string: "#96d0ff",
|
||||||
|
stringRegexp: "#8ddb8c",
|
||||||
|
sublimelinterGutterMark: "#3d444d",
|
||||||
|
variable: "#f69d50",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
);
|
||||||
Reference in New Issue
Block a user