Compare commits

...

10 Commits

Author SHA1 Message Date
lutinglt
5b9b7372a6 fix ci 2026-01-23 19:05:54 +08:00
lutinglt
59b9c66c4e 1.25.4 & fix package details width on phone 2026-01-23 19:02:50 +08:00
lutinglt
ec0f8660e9 update readme 2025-12-22 20:34:26 +08:00
lutinglt
673b7a13de version change & update readme 2025-12-22 20:29:44 +08:00
lutinglt
de0cac06b2 1.25.3 release 2025-12-22 20:09:01 +08:00
lutinglt
bd7899114b Optimize the width of the left side of the workflow details page in different zoom levels 2025-12-10 10:21:14 +08:00
lutinglt
9c67ea1697 fix ci 2025-12-05 09:35:55 +08:00
lutinglt
4a60775c32 vite 8.0 2025-12-05 09:29:26 +08:00
lutinglt
d27376a800 typescript 7.0 (tsgo) 2025-12-04 15:38:22 +08:00
lutinglt
6494e4468b optimize readme header 2025-12-04 11:25:43 +08:00
20 changed files with 164 additions and 56 deletions

View File

@@ -14,5 +14,5 @@ trim_trailing_whitespace = true
max_line_length = 120 max_line_length = 120
# documentation, utils # documentation, utils
[*.{md,mdx,diff}] [*.{md,diff}]
trim_trailing_whitespace = false trim_trailing_whitespace = false

View File

@@ -15,6 +15,7 @@ jobs:
with: with:
filters: | filters: |
src: src:
- ".github/workflows/*.yml"
- "scripts/*" - "scripts/*"
- "src/**/*.ts" - "src/**/*.ts"
- "styles/**/*.ts" - "styles/**/*.ts"
@@ -53,4 +54,4 @@ jobs:
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: locales name: locales
path: dist/options/locale path: dist/options/locale

View File

@@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Build theme - name: Build theme
run: | run: |
npm install npm run install:vite8
npm run release npm run release
- name: Create release - name: Create release
run: | run: |

View File

@@ -4,6 +4,7 @@
"dbaeumer.vscode-eslint", "dbaeumer.vscode-eslint",
"usernamehw.errorlens", "usernamehw.errorlens",
"mikestead.dotenv", "mikestead.dotenv",
"styled-components.vscode-styled-components" "styled-components.vscode-styled-components",
"typescriptteam.native-preview"
] ]
} }

3
.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,3 @@
{
"typescript.experimental.useTsgo": false
}

View File

@@ -1,20 +1,3 @@
### 🌈 Style
#### More aligned with GitHub style
- Optimize the selection style of items in the menu.
- Optimize code block styles.
- Optimize some element styles on Issue/PR page
##### Template File
- Synchronized repository commit page layout and styles.
- Synchronized repository code list page layout and styles.
- Synchronized repository add file button menu styles.
### 🐞 Fix ### 🐞 Fix
- Fixed extra lines under heatmap. - Fix the width of the detailed page of the software package under the phone
- Supplement the PR operation panel status style in PR.
- Fixed avatar size for approving users in PR
- Fixed bot label styles in Issue/PR

View File

@@ -79,6 +79,20 @@ For details, please refer to the Gitea documentation
> >
> The template modifies Gitea's layout to make it closer to GitHub's layout. Do not use template files across versions, > The template modifies Gitea's layout to make it closer to GitHub's layout. Do not use template files across versions,
> as this may lead to missing functionality and other issues. > as this may lead to missing functionality and other issues.
>
> Template layout is bound to the Gitea instance and will affect all themes, impacting the experience of other
> non-project themes.
### Translation File Installation (Optional)
> [!TIP]
>
> Translation files are only needed when using this project's template files to provide support for non-English
> languages.
1. Download the latest translation files from the release page and place them in the `data/gitea/options/locale`
directory (This directory may not be available by default and needs to be manually created)
2. Restart Gitea
## Screenshots ## Screenshots

View File

@@ -70,6 +70,21 @@ THEMES = gitea-auto, gitea-light, gitea-dark, github-auto, github-light, github-
> [!IMPORTANT] > [!IMPORTANT]
> >
> 模板修改了 Gitea 的布局, 使其更接近 GitHub 的布局, 请勿跨版本使用模板文件, 可能会导致功能缺失等问题 > 模板修改了 Gitea 的布局, 使其更接近 GitHub 的布局, 请勿跨版本使用模板文件, 可能会导致功能缺失等问题
>
> 模板布局跟 Gitea 实例绑定, 所有主题都会生效, 会影响其他非本项目的主题的体验
### 翻译文件安装 (可选)
> [!TIP]
>
> 仅在使用本项目的模板文件时需要安装翻译文件以提供非英文语言的支持
1. 在发布页下载最新的翻译文件放入 `data/gitea/options/locale` 目录下 (默认可能没有此目录需手动创建)
2. 重启 Gitea
> [!NOTE]
>
> 中文翻译中还额外将 "工单" 替换为 "议题", "合并请求" 替换为 "拉取请求", 以与 GitHub 手机版中文保持一致
## 截图 ## 截图

View File

@@ -1,15 +1,14 @@
import js from "@eslint/js"; import js from "@eslint/js";
import { defineConfig } from "eslint/config";
import globals from "globals"; import globals from "globals";
import tseslint from "typescript-eslint"; import tseslint from "typescript-eslint";
export default tseslint.config( export default defineConfig({
{ ignores: ["dist"] }, ignores: ["dist"],
{ extends: [js.configs.recommended, ...tseslint.configs.recommended],
extends: [js.configs.recommended, ...tseslint.configs.recommended], files: ["**/*.{ts}"],
files: ["**/*.{ts}"], languageOptions: {
languageOptions: { ecmaVersion: 2020,
ecmaVersion: 2020, globals: globals.browser,
globals: globals.browser, },
}, });
}
);

View File

@@ -120,6 +120,13 @@
{{svg "octicon-question"}} {{svg "octicon-question"}}
{{ctx.Locale.Tr "help"}} {{ctx.Locale.Tr "help"}}
</a> </a>
{{if .IsAdmin}}
<div class="divider"></div>
<a class="{{if .PageIsAdmin}}active {{end}}item" href="{{AppSubUrl}}/-/admin">
{{svg "octicon-server"}}
{{ctx.Locale.Tr "admin_panel"}}
</a>
{{end}}
<div class="divider"></div> <div class="divider"></div>
<a class="item link-action" href data-url="{{AppSubUrl}}/user/logout"> <a class="item link-action" href data-url="{{AppSubUrl}}/user/logout">
{{svg "octicon-sign-out"}} {{svg "octicon-sign-out"}}

View File

@@ -1,23 +1,26 @@
{ {
"name": "gitea-github-theme", "name": "gitea-github-theme",
"version": "1.25.3.rc", "version": "1.25.4",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite build --mode dev", "dev": "vite build --mode dev",
"build": "tsc -b && vite build", "build": "tsgo -b && vite build",
"lint": "eslint .", "lint": "eslint .",
"format": "prettier --write .", "format": "prettier --write .",
"commit": "npm run lint && npm run format && npm run build", "commit": "npm run lint && npm run format && npm run build",
"version": "node scripts/version.cjs", "version": "node scripts/version.cjs",
"tr": "node scripts/translate.cjs", "tr": "node scripts/translate.cjs",
"tmpl": "node scripts/update_template.cjs",
"release": "npm run build && npm run tr", "release": "npm run build && npm run tr",
"install:clean": "npm cache clean --force && rm -rf node_modules package-lock.json && npm install" "install:clean": "npm cache clean --force && rm -rf node_modules package-lock.json && npm install",
"install:vite8": "npm install --force"
}, },
"devDependencies": { "devDependencies": {
"@babel/preset-typescript": "^7.28.4", "@babel/preset-typescript": "^7.28.4",
"@eslint/js": "^9.29.0", "@eslint/js": "^9.29.0",
"@linaria/core": "^6.3.0", "@linaria/core": "^6.3.0",
"@types/node": "^24.0.3", "@types/node": "^24.0.3",
"@typescript/native-preview": "^7.0.0-dev.20251203.1",
"@vanilla-extract/css": "^1.17.5", "@vanilla-extract/css": "^1.17.5",
"@vanilla-extract/vite-plugin": "^5.1.3", "@vanilla-extract/vite-plugin": "^5.1.3",
"@wyw-in-js/babel-preset": "^0.7.0", "@wyw-in-js/babel-preset": "^0.7.0",
@@ -30,10 +33,9 @@
"prettier": "3.5.3", "prettier": "3.5.3",
"prettier-plugin-organize-imports": "^4.1.0", "prettier-plugin-organize-imports": "^4.1.0",
"sass-embedded": "^1.89.2", "sass-embedded": "^1.89.2",
"typescript": "^5.8.3",
"typescript-eslint": "^8.34.1", "typescript-eslint": "^8.34.1",
"typescript-plugin-css-modules": "^5.1.0", "typescript-plugin-css-modules": "^5.1.0",
"vite": "^7.2.4" "vite": "^7.3.1"
}, },
"prettier": { "prettier": {
"printWidth": 120, "printWidth": 120,

View File

@@ -17,7 +17,7 @@ const localePath = "options/locale";
const [major, minor, patch, tag = ""] = pkg.version.split("."); const [major, minor, patch, tag = ""] = pkg.version.split(".");
console.log("Version: ", pkg.version); console.log("Version:", pkg.version);
let versionPath = ""; let versionPath = "";
if (tag.includes("rc") || patch.includes("latest")) { if (tag.includes("rc") || patch.includes("latest")) {
versionPath = `${githubBranchPath}/v${major}.${minor}`; versionPath = `${githubBranchPath}/v${major}.${minor}`;
@@ -26,14 +26,12 @@ if (tag.includes("rc") || patch.includes("latest")) {
} }
const githubUrl = `${githubSite}/${giteaRepo}/${versionPath}/${localePath}`; const githubUrl = `${githubSite}/${giteaRepo}/${versionPath}/${localePath}`;
const locales = fs.readdirSync(path.join(rootDir, localePath)).filter(file => file.endsWith(".ini")); const locales = fs.readdirSync(path.join(rootDir, localePath)).filter(file => file.endsWith(".ini"));
// 使用立即执行异步函数
(async () => { (async () => {
for (const locale of locales) { for (const locale of locales) {
const localUrl = `${githubUrl}/${locale}`; const localUrl = `${githubUrl}/${locale}`;
console.log("LocaleUrl: ", localUrl); console.log("LocaleUrl:", localUrl);
const themeLocale = fs.readFileSync(path.join(rootDir, localePath, locale), "utf-8"); const themeLocale = fs.readFileSync(path.join(rootDir, localePath, locale), "utf-8");
const response = await fetch(localUrl); const response = await fetch(localUrl);

View File

@@ -0,0 +1,54 @@
const fs = require("fs");
const path = require("path");
const rootDir = path.join(__dirname, "..");
const pkgPath = path.join(rootDir, "package.json");
const pkg = JSON.parse(fs.readFileSync(pkgPath));
const githubSite = "https://raw.githubusercontent.com";
const giteaRepo = "go-gitea/gitea";
const githubTagPath = "refs/tags";
const tmplPath = "templates";
const localTmplPath = path.join(rootDir, "gitea", tmplPath);
const [major, minor, patch = ""] = pkg.version.split(".");
console.log("Version:", pkg.version);
const versionPath = `${githubTagPath}/v${major}.${minor}.${patch}`;
const githubUrl = `${githubSite}/${giteaRepo}/${versionPath}/${tmplPath}`;
// 递归读取所有子目录中的 .tmpl 文件
function readTmplFilesRecursively(dir) {
const results = [];
const files = fs.readdirSync(dir);
for (const file of files) {
const filePath = path.join(dir, file);
const stat = fs.statSync(filePath);
if (stat.isDirectory()) {
// 如果是目录,递归读取
results.push(...readTmplFilesRecursively(filePath));
} else if (file.endsWith(".tmpl")) {
// 如果是 .tmpl 文件,添加到结果中(相对于模板目录的相对路径)
const relativePath = path.relative(localTmplPath, filePath);
results.push(relativePath);
}
}
return results;
}
// 读取所有模板文件
const tmpls = readTmplFilesRecursively(localTmplPath);
(async () => {
for (const tmpl of tmpls) {
const tmplUrl = `${githubUrl}/${tmpl}`;
console.log("TmplUrl:", tmplUrl);
const response = await fetch(tmplUrl);
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
let content = await response.text();
fs.writeFileSync(path.join(localTmplPath, tmpl), content);
}
})();

View File

@@ -163,9 +163,10 @@ export const actionViewHeader = css`
// 工作流左侧作业列表 // 工作流左侧作业列表
export const actionViewLeft = css` export const actionViewLeft = css`
.action-view-left { .action-view-left.action-view-left.action-view-left {
margin-right: 28px; margin-right: 28px;
border-top: 1px solid ${themeVars.color.console.border}; border-top: 1px solid ${themeVars.color.console.border};
max-width: 22vw;
&:before { &:before {
content: "Jobs"; content: "Jobs";
color: ${themeVars.color.console.fg.subtle}; color: ${themeVars.color.console.fg.subtle};

View File

@@ -101,11 +101,13 @@ export const repoFiles = css`
background: ${themeVars.color.body}; background: ${themeVars.color.body};
min-height: 48px; min-height: 48px;
padding: 0px 8px !important; padding: 0px 8px !important;
overflow-x: visible;
svg { svg {
color: ${themeVars.color.text.light.num1}; color: ${themeVars.color.text.light.num1};
} }
.file-header-left { .file-header-left {
padding: 8px !important; padding: 6px 8px !important;
line-height: 1.45;
// 伪元素宽度等于按钮宽度而不是父元素宽度 // 伪元素宽度等于按钮宽度而不是父元素宽度
position: relative; position: relative;
&:hover { &:hover {
@@ -116,7 +118,7 @@ export const repoFiles = css`
content: ""; content: "";
background: ${themeVars.github.underlineNav.borderColor.active}; background: ${themeVars.github.underlineNav.borderColor.active};
border-radius: ${otherThemeVars.border.radius}; border-radius: ${otherThemeVars.border.radius};
bottom: -7px; bottom: -8px;
left: 0; left: 0;
height: 2px; height: 2px;
position: absolute; position: absolute;
@@ -127,9 +129,19 @@ export const repoFiles = css`
text-decoration-line: none; text-decoration-line: none;
} }
} }
.file-header-right:hover { .file-header-right {
background: ${themeVars.github.control.transparent.bgColor.hover}; .btn-octicon {
border-radius: ${otherThemeVars.border.radius}; display: inline-flex;
align-items: center;
justify-content: center;
padding: 0px 8px;
border-radius: ${otherThemeVars.border.radius};
height: 28px;
width: 28px;
&:hover {
background: ${themeVars.github.control.transparent.bgColor.hover};
}
}
} }
} }
} }

View File

@@ -309,7 +309,7 @@ export const comment = css`
.ui.basic.label { .ui.basic.label {
${botLabelStyle} ${botLabelStyle}
} }
a:has(relative-time){ a:has(relative-time) {
text-decoration: underline; text-decoration: underline;
} }
// 已编辑按钮 // 已编辑按钮
@@ -564,7 +564,7 @@ export const timeline = css`
} }
.timeline-item, .timeline-item,
.timeline-item-group { .timeline-item-group {
padding: 16px 0; padding: 12px 0;
.comment-text-line { .comment-text-line {
color: ${themeVars.color.text.light.num1}; color: ${themeVars.color.text.light.num1};
} }

View File

@@ -123,3 +123,15 @@ export const packagesDetail = css`
} }
} }
`; `;
// 手机页面下的软件包详细信息页
export const packagesListMobile = css`
@media (max-width: 767.98px) {
.page-content.packages .packages-content {
.packages-content-left,
.packages-content-right {
width: 100%;
}
}
}
`;

View File

@@ -114,6 +114,13 @@
{{svg "octicon-question"}} {{svg "octicon-question"}}
{{ctx.Locale.Tr "help"}} {{ctx.Locale.Tr "help"}}
</a> </a>
{{if .IsAdmin}}
<div class="divider"></div>
<a class="{{if .PageIsAdmin}}active {{end}}item" href="{{AppSubUrl}}/-/admin">
{{svg "octicon-server"}}
{{ctx.Locale.Tr "admin_panel"}}
</a>
{{end}}
<div class="divider"></div> <div class="divider"></div>
<a class="item link-action" href data-url="{{AppSubUrl}}/user/logout"> <a class="item link-action" href data-url="{{AppSubUrl}}/user/logout">
{{svg "octicon-sign-out"}} {{svg "octicon-sign-out"}}

View File

@@ -30,11 +30,11 @@
"erasableSyntaxOnly": true, "erasableSyntaxOnly": true,
"noFallthroughCasesInSwitch": true, "noFallthroughCasesInSwitch": true,
"noUncheckedSideEffectImports": true, "noUncheckedSideEffectImports": true,
"baseUrl": ".",
"paths": { "paths": {
"src/*": ["src/*"], "*": ["./*"],
"styles/*": ["styles/*"], "src/*": ["./src/*"],
"themes/*": ["themes/*", "themes/*.css"] "styles/*": ["./styles/*"],
"themes/*": ["./themes/*", "./themes/*.css"]
} }
}, },
"include": ["src", "styles", "themes", "vite.config.ts"] "include": ["src", "styles", "themes", "vite.config.ts"]

View File

@@ -8,9 +8,8 @@ import * as sass from "sass-embedded";
import { defineConfig } from "vite"; import { defineConfig } from "vite";
import { themeInput, themePlugin } from "./src/core/vite"; import { themeInput, themePlugin } from "./src/core/vite";
dotenv.config({ quiet: true });
const require = createRequire(import.meta.url); const require = createRequire(import.meta.url);
dotenv.config({ quiet: true });
const outDir = "dist"; // 输出目录 const outDir = "dist"; // 输出目录
const themesDir = "themes"; // 颜色主题目录 const themesDir = "themes"; // 颜色主题目录