Compare commits

...

6 Commits

Author SHA1 Message Date
lutinglt
9bcea89fcb update readme 2025-08-14 23:31:41 +08:00
lutinglt
26deec78ff format code 2025-08-14 21:24:03 +08:00
lutinglt
ffb7fa810b 发布时的主题顺序 2025-08-14 20:51:56 +08:00
lutinglt
2083d3026b version 2025-08-14 20:37:00 +08:00
lutinglt
5037e46447 beta 2025-08-14 20:10:48 +08:00
lutinglt
cd2f7579b1 色盲主题打包 2025-08-14 20:02:57 +08:00
10 changed files with 60 additions and 27 deletions

2
.github/release.md vendored
View File

@@ -1,6 +1,6 @@
## ✨ Feature ## ✨ Feature
- 支持色盲主题 ( Colorblind & Tritanopia ) ( 红绿色盲和蓝色盲 ) - 支持色盲主题(Beta) ( 红绿色盲和蓝色盲 ) ( Colorblind & Tritanopia )
## 🐞 Fix ## 🐞 Fix

View File

@@ -19,7 +19,9 @@ jobs:
run: | run: |
export TZ=Asia/Shanghai export TZ=Asia/Shanghai
TAG="v$(npm run -s version)" TAG="v$(npm run -s version)"
tar -zcf dist/theme-github.tar.gz --remove-files dist/theme-github-auto.css dist/theme-github-light.css dist/theme-github-dark.css dist/theme-github-soft-dark.css tar -zcf dist/theme-github-base.tar.gz --remove-files dist/theme-github-auto.css dist/theme-github-light.css dist/theme-github-dark.css dist/theme-github-soft-dark.css
tar -zcf dist/theme-github-colorblind.tar.gz --remove-files dist/theme-github-colorblind-auto.css dist/theme-github-colorblind-light.css dist/theme-github-colorblind-dark.css
tar -zcf dist/theme-github-colorblind-tritanopia.tar.gz --remove-files dist/theme-github-tritanopia-auto.css dist/theme-github-tritanopia-light.css dist/theme-github-tritanopia-dark.css
gh release create "$TAG" dist/* --notes-file .github/release.md --draft -t $TAG gh release create "$TAG" dist/* --notes-file .github/release.md --draft -t $TAG
env: env:
GH_TOKEN: ${{ github.token }} GH_TOKEN: ${{ github.token }}

View File

@@ -95,8 +95,8 @@ npm run commit
请在颜色主题文件头部附加自己的作者信息, 方便 Issue 提问者找到你 `@`. 请在颜色主题文件头部附加自己的作者信息, 方便 Issue 提问者找到你 `@`.
推荐使用 `import { defineTheme, type ThemeColor } from "src"` 导入主题生成框架, 声明主题颜色, 然后使用 `defineTheme` 函数生成主题所有 CSS 变量, 推荐使用 `import { defineTheme, type ThemeColor } from "src"` 导入主题生成框架, 声明主题颜色, 然后使用 `defineTheme`
defineTheme 中设置了一些经过计算得到的 Gitea 变量可以减少工作量, 具体请查看函数说明和定义. 函数生成主题所有 CSS 变量, defineTheme 中设置了一些经过计算得到的 Gitea 变量可以减少工作量, 具体请查看函数说明和定义.
颜色计算函数可以从 `src/functions` 导入, 例如 `import { scaleColorLight } from "src/functions"`, 或者使用 `polished` 库. 颜色计算函数可以从 `src/functions` 导入, 例如 `import { scaleColorLight } from "src/functions"`, 或者使用 `polished` 库.

View File

@@ -15,7 +15,7 @@ Gitea 版本号格式: `1.大版本号.小版本号`
Gitea 理论上小版本号变更不会修改前端布局, 所以主题的小版本号适用于所有 Gitea 大版本号相同的 Gitea 版本. Gitea 理论上小版本号变更不会修改前端布局, 所以主题的小版本号适用于所有 Gitea 大版本号相同的 Gitea 版本.
比如: 主题版本 `1.24.4` 适用于 Gitea 版本 `>=1.24.0` ~ `<1.25.0` 比如: 主题版本 `1.24.5` 适用于 Gitea 版本 `>=1.24.0` `<1.25.0`
仅维护项目发布中的最新的 Gitea 版本, 其他旧版本主题不接受 Issue 和 PR. 仅维护项目发布中的最新的 Gitea 版本, 其他旧版本主题不接受 Issue 和 PR.
@@ -51,8 +51,9 @@ THEMES = gitea-auto, gitea-light, gitea-dark, github-auto, github-light, github-
```ini ```ini
THEMES = github-auto, github-light, github-dark, github-soft-dark THEMES = github-auto, github-light, github-dark, github-soft-dark
``` ```
<details open> <details open>
<summary>GitHub</summary> <summary>Base</summary>
<h4>theme-github-light.css</h4> <h4>theme-github-light.css</h4>
<img src="screenshots/light.png"/> <img src="screenshots/light.png"/>
<h4>theme-github-dark.css</h4> <h4>theme-github-dark.css</h4>
@@ -61,7 +62,7 @@ THEMES = github-auto, github-light, github-dark, github-soft-dark
<img src="screenshots/soft-dark.png"/> <img src="screenshots/soft-dark.png"/>
</details> </details>
### 色盲主题 ### 色盲主题 ( Beta )
```ini ```ini
THEMES = github-colorblind-auto, github-colorblind-light, github-colorblind-dark THEMES = github-colorblind-auto, github-colorblind-light, github-colorblind-dark
@@ -103,7 +104,7 @@ THEMES = github-tritanopia-auto, github-tritanopia-light, github-tritanopia-dark
| 变量名 | 描述 | 默认 | Github | 推荐 | 最小 | 最大 | | 变量名 | 描述 | 默认 | Github | 推荐 | 最小 | 最大 |
| :-------------------------------- | :-------------------------- | :---- | :----- | :---- | :---- | :---- | | :-------------------------------- | :-------------------------- | :---- | :----- | :---- | :---- | :---- |
| --custom-clone-menu-width | 克隆菜单宽度 | Gitea | 332px | 200px | 150px | 400px | | --custom-clone-menu-width | 克隆按钮的菜单宽度 | Gitea | 332px | 200px | 150px | 400px |
| --custom-explore-repolist-columns | 探索页面的仓库列表列数 | 2 | 2 | 2 | | | | --custom-explore-repolist-columns | 探索页面的仓库列表列数 | 2 | 2 | 2 | | |
| --custom-explore-userlist-columns | 探索页面的用户/组织列表列数 | 3 | 1 | 2/3 | | | | --custom-explore-userlist-columns | 探索页面的用户/组织列表列数 | 3 | 1 | 2/3 | | |
| --custom-user-repolist-columns | 用户页面的仓库列表列数 | 2 | 2 | 1/2 | | | | --custom-user-repolist-columns | 用户页面的仓库列表列数 | 2 | 2 | 1/2 | | |

View File

@@ -1,7 +1,7 @@
{ {
"name": "gitea-github-theme", "name": "gitea-github-theme",
"version": "1.24.5", "version": "1.24.6",
"description": "A theme to make Gitea look and feel like GitHub", "description": "A sophisticated theme to make Gitea look and feel like GitHub",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite build --mode dev", "dev": "vite build --mode dev",

View File

@@ -165,7 +165,9 @@ export function defineTheme(themeColor: ThemeColor, chroma: Chroma | null = null
const named: Named = { const named: Named = {
red: { red: {
self: themeColor.base.red, self: themeColor.base.red,
light: themeColor.isDarkTheme ? scaleColorLight(themeColor.base.red, 15) : scaleColorLight(themeColor.base.red, 25), light: themeColor.isDarkTheme
? scaleColorLight(themeColor.base.red, 15)
: scaleColorLight(themeColor.base.red, 25),
dark: { dark: {
num1: scaleColorLight(themeColor.base.red, -10), num1: scaleColorLight(themeColor.base.red, -10),
num2: scaleColorLight(themeColor.base.red, -20), num2: scaleColorLight(themeColor.base.red, -20),
@@ -180,7 +182,9 @@ export function defineTheme(themeColor: ThemeColor, chroma: Chroma | null = null
}, },
orange: { orange: {
self: themeColor.base.orange, self: themeColor.base.orange,
light: themeColor.isDarkTheme ? scaleColorLight(themeColor.base.orange, 15) : scaleColorLight(themeColor.base.orange, 25), light: themeColor.isDarkTheme
? scaleColorLight(themeColor.base.orange, 15)
: scaleColorLight(themeColor.base.orange, 25),
dark: { dark: {
num1: scaleColorLight(themeColor.base.orange, -10), num1: scaleColorLight(themeColor.base.orange, -10),
num2: scaleColorLight(themeColor.base.orange, -20), num2: scaleColorLight(themeColor.base.orange, -20),
@@ -195,7 +199,9 @@ export function defineTheme(themeColor: ThemeColor, chroma: Chroma | null = null
}, },
yellow: { yellow: {
self: themeColor.base.yellow, self: themeColor.base.yellow,
light: themeColor.isDarkTheme ? scaleColorLight(themeColor.base.yellow, 15) : scaleColorLight(themeColor.base.yellow, 25), light: themeColor.isDarkTheme
? scaleColorLight(themeColor.base.yellow, 15)
: scaleColorLight(themeColor.base.yellow, 25),
dark: { dark: {
num1: scaleColorLight(themeColor.base.yellow, -10), num1: scaleColorLight(themeColor.base.yellow, -10),
num2: scaleColorLight(themeColor.base.yellow, -20), num2: scaleColorLight(themeColor.base.yellow, -20),
@@ -210,7 +216,9 @@ export function defineTheme(themeColor: ThemeColor, chroma: Chroma | null = null
}, },
olive: { olive: {
self: themeColor.base.olive, self: themeColor.base.olive,
light: themeColor.isDarkTheme ? scaleColorLight(themeColor.base.olive, 15) : scaleColorLight(themeColor.base.olive, 25), light: themeColor.isDarkTheme
? scaleColorLight(themeColor.base.olive, 15)
: scaleColorLight(themeColor.base.olive, 25),
dark: { dark: {
num1: scaleColorLight(themeColor.base.olive, -10), num1: scaleColorLight(themeColor.base.olive, -10),
num2: scaleColorLight(themeColor.base.olive, -20), num2: scaleColorLight(themeColor.base.olive, -20),
@@ -218,7 +226,9 @@ export function defineTheme(themeColor: ThemeColor, chroma: Chroma | null = null
}, },
green: { green: {
self: themeColor.base.green, self: themeColor.base.green,
light: themeColor.isDarkTheme ? scaleColorLight(themeColor.base.green, 15) : scaleColorLight(themeColor.base.green, 25), light: themeColor.isDarkTheme
? scaleColorLight(themeColor.base.green, 15)
: scaleColorLight(themeColor.base.green, 25),
dark: { dark: {
num1: scaleColorLight(themeColor.base.green, -10), num1: scaleColorLight(themeColor.base.green, -10),
num2: scaleColorLight(themeColor.base.green, -20), num2: scaleColorLight(themeColor.base.green, -20),
@@ -233,7 +243,9 @@ export function defineTheme(themeColor: ThemeColor, chroma: Chroma | null = null
}, },
teal: { teal: {
self: themeColor.base.teal, self: themeColor.base.teal,
light: themeColor.isDarkTheme ? scaleColorLight(themeColor.base.teal, 15) : scaleColorLight(themeColor.base.teal, 25), light: themeColor.isDarkTheme
? scaleColorLight(themeColor.base.teal, 15)
: scaleColorLight(themeColor.base.teal, 25),
dark: { dark: {
num1: scaleColorLight(themeColor.base.teal, -10), num1: scaleColorLight(themeColor.base.teal, -10),
num2: scaleColorLight(themeColor.base.teal, -20), num2: scaleColorLight(themeColor.base.teal, -20),
@@ -241,7 +253,9 @@ export function defineTheme(themeColor: ThemeColor, chroma: Chroma | null = null
}, },
blue: { blue: {
self: themeColor.base.blue, self: themeColor.base.blue,
light: themeColor.isDarkTheme ? scaleColorLight(themeColor.base.blue, 15) : scaleColorLight(themeColor.base.blue, 25), light: themeColor.isDarkTheme
? scaleColorLight(themeColor.base.blue, 15)
: scaleColorLight(themeColor.base.blue, 25),
dark: { dark: {
num1: scaleColorLight(themeColor.base.blue, -10), num1: scaleColorLight(themeColor.base.blue, -10),
num2: scaleColorLight(themeColor.base.blue, -20), num2: scaleColorLight(themeColor.base.blue, -20),
@@ -249,7 +263,9 @@ export function defineTheme(themeColor: ThemeColor, chroma: Chroma | null = null
}, },
violet: { violet: {
self: themeColor.base.violet, self: themeColor.base.violet,
light: themeColor.isDarkTheme ? scaleColorLight(themeColor.base.violet, 15) : scaleColorLight(themeColor.base.violet, 25), light: themeColor.isDarkTheme
? scaleColorLight(themeColor.base.violet, 15)
: scaleColorLight(themeColor.base.violet, 25),
dark: { dark: {
num1: scaleColorLight(themeColor.base.violet, -10), num1: scaleColorLight(themeColor.base.violet, -10),
num2: scaleColorLight(themeColor.base.violet, -20), num2: scaleColorLight(themeColor.base.violet, -20),
@@ -257,7 +273,9 @@ export function defineTheme(themeColor: ThemeColor, chroma: Chroma | null = null
}, },
purple: { purple: {
self: themeColor.base.purple, self: themeColor.base.purple,
light: themeColor.isDarkTheme ? scaleColorLight(themeColor.base.purple, 15) : scaleColorLight(themeColor.base.purple, 25), light: themeColor.isDarkTheme
? scaleColorLight(themeColor.base.purple, 15)
: scaleColorLight(themeColor.base.purple, 25),
dark: { dark: {
num1: scaleColorLight(themeColor.base.purple, -10), num1: scaleColorLight(themeColor.base.purple, -10),
num2: scaleColorLight(themeColor.base.purple, -20), num2: scaleColorLight(themeColor.base.purple, -20),
@@ -265,7 +283,9 @@ export function defineTheme(themeColor: ThemeColor, chroma: Chroma | null = null
}, },
pink: { pink: {
self: themeColor.base.pink, self: themeColor.base.pink,
light: themeColor.isDarkTheme ? scaleColorLight(themeColor.base.pink, 15) : scaleColorLight(themeColor.base.pink, 25), light: themeColor.isDarkTheme
? scaleColorLight(themeColor.base.pink, 15)
: scaleColorLight(themeColor.base.pink, 25),
dark: { dark: {
num1: scaleColorLight(themeColor.base.pink, -10), num1: scaleColorLight(themeColor.base.pink, -10),
num2: scaleColorLight(themeColor.base.pink, -20), num2: scaleColorLight(themeColor.base.pink, -20),
@@ -273,7 +293,9 @@ export function defineTheme(themeColor: ThemeColor, chroma: Chroma | null = null
}, },
brown: { brown: {
self: themeColor.base.brown, self: themeColor.base.brown,
light: themeColor.isDarkTheme ? scaleColorLight(themeColor.base.brown, 15) : scaleColorLight(themeColor.base.brown, 25), light: themeColor.isDarkTheme
? scaleColorLight(themeColor.base.brown, 15)
: scaleColorLight(themeColor.base.brown, 25),
dark: { dark: {
num1: scaleColorLight(themeColor.base.brown, -10), num1: scaleColorLight(themeColor.base.brown, -10),
num2: scaleColorLight(themeColor.base.brown, -20), num2: scaleColorLight(themeColor.base.brown, -20),
@@ -281,7 +303,9 @@ export function defineTheme(themeColor: ThemeColor, chroma: Chroma | null = null
}, },
black: { black: {
self: themeColor.base.black, self: themeColor.base.black,
light: themeColor.isDarkTheme ? scaleColorLight(themeColor.base.black, 15) : scaleColorLight(themeColor.base.black, 25), light: themeColor.isDarkTheme
? scaleColorLight(themeColor.base.black, 15)
: scaleColorLight(themeColor.base.black, 25),
dark: { dark: {
num1: scaleColorLight(themeColor.base.black, -10), num1: scaleColorLight(themeColor.base.black, -10),
num2: scaleColorLight(themeColor.base.black, -20), num2: scaleColorLight(themeColor.base.black, -20),
@@ -289,7 +313,9 @@ export function defineTheme(themeColor: ThemeColor, chroma: Chroma | null = null
}, },
grey: { grey: {
self: themeColor.base.grey, self: themeColor.base.grey,
light: themeColor.isDarkTheme ? scaleColorLight(themeColor.base.grey, 15) : scaleColorLight(themeColor.base.grey, 25), light: themeColor.isDarkTheme
? scaleColorLight(themeColor.base.grey, 15)
: scaleColorLight(themeColor.base.grey, 25),
}, },
gold: themeColor.base.gold, gold: themeColor.base.gold,
white: themeColor.base.white, white: themeColor.base.white,
@@ -338,7 +364,9 @@ export function defineTheme(themeColor: ThemeColor, chroma: Chroma | null = null
yellow: themeVars.color.yellow.light, yellow: themeVars.color.yellow.light,
blue: themeVars.color.blue.light, blue: themeVars.color.blue.light,
magenta: themeVars.color.pink.light, magenta: themeVars.color.pink.light,
cyan: themeColor.isDarkTheme ? scaleColorLight(themeColor.base.cyan, 10) : scaleColorLight(themeColor.base.cyan, 25), cyan: themeColor.isDarkTheme
? scaleColorLight(themeColor.base.cyan, 10)
: scaleColorLight(themeColor.base.cyan, 25),
white: themeVars.color.console.fg.self, white: themeVars.color.console.fg.self,
}, },
}; };

View File

@@ -1,8 +1,10 @@
import "./actions"; import "./actions";
import "./chroma";
import "./clone"; import "./clone";
import "./commit"; import "./commit";
import "./dashboard"; import "./dashboard";
import "./diff"; import "./diff";
import "./editor";
import "./explore"; import "./explore";
import "./filelist"; import "./filelist";
import "./heatmap"; import "./heatmap";
@@ -14,5 +16,3 @@ import "./repo";
import "./setting"; import "./setting";
import "./signin"; import "./signin";
import "./user"; import "./user";
import "./chroma";
import "./editor"

View File

@@ -1,4 +1,4 @@
import { css, themeVars, otherThemeVars } from "src/types/vars"; import { css, otherThemeVars, themeVars } from "src/types/vars";
export const attached = css` export const attached = css`
// 设置右面板的内容 // 设置右面板的内容

View File

@@ -37,6 +37,7 @@ export const colorblindDarkGithubColors: GithubColor = {
underlineNav: darkGithubColors.underlineNav, underlineNav: darkGithubColors.underlineNav,
contribution: darkGithubColors.contribution, contribution: darkGithubColors.contribution,
}; };
export const colorblindDarkPrettylights: prettylightsColor = { export const colorblindDarkPrettylights: prettylightsColor = {
syntax: { syntax: {
brackethighlighter: { angle: "#9198a1", unmatched: "#db6d28" }, brackethighlighter: { angle: "#9198a1", unmatched: "#db6d28" },

View File

@@ -37,6 +37,7 @@ export const colorblindLightGithubColors: GithubColor = {
underlineNav: lightGithubColors.underlineNav, underlineNav: lightGithubColors.underlineNav,
contribution: lightGithubColors.contribution, contribution: lightGithubColors.contribution,
}; };
export const colorblindLightPrettylights: prettylightsColor = { export const colorblindLightPrettylights: prettylightsColor = {
syntax: { syntax: {
brackethighlighter: { angle: "#59636e", unmatched: "#762c00" }, brackethighlighter: { angle: "#59636e", unmatched: "#762c00" },