mirror of
https://github.com/lutinglt/gitea-github-theme.git
synced 2026-04-13 23:11:37 +08:00
Compare commits
20 Commits
2b2f2e8a1e
...
v1.25.4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5b9b7372a6 | ||
|
|
59b9c66c4e | ||
|
|
ec0f8660e9 | ||
|
|
673b7a13de | ||
|
|
de0cac06b2 | ||
|
|
bd7899114b | ||
|
|
9c67ea1697 | ||
|
|
4a60775c32 | ||
|
|
d27376a800 | ||
|
|
6494e4468b | ||
|
|
1729cfe2df | ||
|
|
7a4851eb21 | ||
|
|
a0b51b863d | ||
|
|
13cd887d97 | ||
|
|
824eb26f1d | ||
|
|
6a0a92cd94 | ||
|
|
76e547987b | ||
|
|
86e488aafb | ||
|
|
b3cc3ab82f | ||
|
|
f2787efcd9 |
@@ -14,5 +14,5 @@ trim_trailing_whitespace = true
|
||||
max_line_length = 120
|
||||
|
||||
# documentation, utils
|
||||
[*.{md,mdx,diff}]
|
||||
[*.{md,diff}]
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
6
.gitattributes
vendored
6
.gitattributes
vendored
@@ -1,5 +1 @@
|
||||
.github/* linguist-vendored
|
||||
.vscode/* linguist-vendored
|
||||
screenshots/* linguist-vendored
|
||||
scripts/* linguist-vendored
|
||||
eslint.config.js linguist-vendored
|
||||
*.tmpl linguist-language=Handlebars
|
||||
57
.github/workflows/build.yml
vendored
Normal file
57
.github/workflows/build.yml
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
name: build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: dorny/paths-filter@v3
|
||||
id: changes
|
||||
with:
|
||||
filters: |
|
||||
src:
|
||||
- ".github/workflows/*.yml"
|
||||
- "scripts/*"
|
||||
- "src/**/*.ts"
|
||||
- "styles/**/*.ts"
|
||||
- "themes/*.css.ts"
|
||||
- "vite.config.ts"
|
||||
- "package.json"
|
||||
|
||||
- name: Build theme
|
||||
id: build
|
||||
if: steps.changes.outputs.src == 'true'
|
||||
run: |
|
||||
npm install
|
||||
npm run build
|
||||
|
||||
- name: Upload css assets
|
||||
if: steps.build.outcome == 'success'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: themes
|
||||
path: dist/*.css
|
||||
|
||||
- name: Upload templates assets
|
||||
if: steps.build.outcome == 'success'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: templates
|
||||
path: templates
|
||||
|
||||
- name: Build locales
|
||||
id: locales
|
||||
if: steps.build.outcome =='success'
|
||||
run: npm run tr
|
||||
|
||||
- name: Upload locales assets
|
||||
if: steps.locales.outcome =='success'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: locales
|
||||
path: dist/options/locale
|
||||
7
.github/workflows/release.yml
vendored
7
.github/workflows/release.yml
vendored
@@ -13,8 +13,8 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Build theme
|
||||
run: |
|
||||
npm install
|
||||
npm run build
|
||||
npm run install:vite8
|
||||
npm run release
|
||||
- name: Create release
|
||||
run: |
|
||||
tar -zcf dist/theme-github-base.tar.gz --remove-files \
|
||||
@@ -30,7 +30,8 @@ jobs:
|
||||
dist/theme-github-pink-auto.css dist/theme-github-pink-light.css dist/theme-github-pink-dark.css dist/theme-github-pink-soft-dark.css
|
||||
|
||||
tar -zcf dist/theme-github-templates.tar.gz templates
|
||||
tar -zcf dist/theme-github-translations.tar.gz --remove-files dist/options
|
||||
TAG="v$(npm run -s version)"
|
||||
gh release create "$TAG" dist/* --notes-file CHANGELOG.md --draft -t $TAG
|
||||
gh release create "$TAG" dist/*.tar.gz --notes-file CHANGELOG.md --draft -t $TAG
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
|
||||
3
.vscode/extensions.json
vendored
3
.vscode/extensions.json
vendored
@@ -4,6 +4,7 @@
|
||||
"dbaeumer.vscode-eslint",
|
||||
"usernamehw.errorlens",
|
||||
"mikestead.dotenv",
|
||||
"styled-components.vscode-styled-components"
|
||||
"styled-components.vscode-styled-components",
|
||||
"typescriptteam.native-preview"
|
||||
]
|
||||
}
|
||||
|
||||
3
.vscode/settings.json
vendored
Normal file
3
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"typescript.experimental.useTsgo": false
|
||||
}
|
||||
16
CHANGELOG.md
16
CHANGELOG.md
@@ -1,17 +1,3 @@
|
||||
### 🌈 Style
|
||||
|
||||
#### More aligned with GitHub style
|
||||
|
||||
- Optimize the selection style of items in the menu.
|
||||
- Optimize code block styles.
|
||||
|
||||
##### 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
|
||||
|
||||
- Fixed extra lines under heatmap.
|
||||
- Supplement the PR operation panel status style in PR.
|
||||
- Fix the width of the detailed page of the software package under the phone
|
||||
|
||||
14
README.md
14
README.md
@@ -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,
|
||||
> 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
|
||||
|
||||
|
||||
15
README_CN.md
15
README_CN.md
@@ -70,6 +70,21 @@ THEMES = gitea-auto, gitea-light, gitea-dark, github-auto, github-light, github-
|
||||
> [!IMPORTANT]
|
||||
>
|
||||
> 模板修改了 Gitea 的布局, 使其更接近 GitHub 的布局, 请勿跨版本使用模板文件, 可能会导致功能缺失等问题
|
||||
>
|
||||
> 模板布局跟 Gitea 实例绑定, 所有主题都会生效, 会影响其他非本项目的主题的体验
|
||||
|
||||
### 翻译文件安装 (可选)
|
||||
|
||||
> [!TIP]
|
||||
>
|
||||
> 仅在使用本项目的模板文件时需要安装翻译文件以提供非英文语言的支持
|
||||
|
||||
1. 在发布页下载最新的翻译文件放入 `data/gitea/options/locale` 目录下 (默认可能没有此目录需手动创建)
|
||||
2. 重启 Gitea
|
||||
|
||||
> [!NOTE]
|
||||
>
|
||||
> 中文翻译中还额外将 "工单" 替换为 "议题", "合并请求" 替换为 "拉取请求", 以与 GitHub 手机版中文保持一致
|
||||
|
||||
## 截图
|
||||
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
import js from "@eslint/js";
|
||||
import { defineConfig } from "eslint/config";
|
||||
import globals from "globals";
|
||||
import tseslint from "typescript-eslint";
|
||||
|
||||
export default tseslint.config(
|
||||
{ ignores: ["dist"] },
|
||||
{
|
||||
extends: [js.configs.recommended, ...tseslint.configs.recommended],
|
||||
files: ["**/*.{ts}"],
|
||||
languageOptions: {
|
||||
ecmaVersion: 2020,
|
||||
globals: globals.browser,
|
||||
},
|
||||
}
|
||||
);
|
||||
export default defineConfig({
|
||||
ignores: ["dist"],
|
||||
extends: [js.configs.recommended, ...tseslint.configs.recommended],
|
||||
files: ["**/*.{ts}"],
|
||||
languageOptions: {
|
||||
ecmaVersion: 2020,
|
||||
globals: globals.browser,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -120,6 +120,13 @@
|
||||
{{svg "octicon-question"}}
|
||||
{{ctx.Locale.Tr "help"}}
|
||||
</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>
|
||||
<a class="item link-action" href data-url="{{AppSubUrl}}/user/logout">
|
||||
{{svg "octicon-sign-out"}}
|
||||
|
||||
4
options/locale/locale_zh-CN.ini
Normal file
4
options/locale/locale_zh-CN.ini
Normal file
@@ -0,0 +1,4 @@
|
||||
[github-theme]
|
||||
verifed=已验证
|
||||
partially_verifed=部分验证
|
||||
unverifed=未验证
|
||||
14
package.json
14
package.json
@@ -1,21 +1,26 @@
|
||||
{
|
||||
"name": "gitea-github-theme",
|
||||
"version": "1.25.3",
|
||||
"version": "1.25.4",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite build --mode dev",
|
||||
"build": "tsc -b && vite build",
|
||||
"build": "tsgo -b && vite build",
|
||||
"lint": "eslint .",
|
||||
"format": "prettier --write .",
|
||||
"commit": "npm run lint && npm run format && npm run build",
|
||||
"version": "node scripts/version.cjs",
|
||||
"install:clean": "npm cache clean --force && rm -rf node_modules package-lock.json && npm install"
|
||||
"tr": "node scripts/translate.cjs",
|
||||
"tmpl": "node scripts/update_template.cjs",
|
||||
"release": "npm run build && npm run tr",
|
||||
"install:clean": "npm cache clean --force && rm -rf node_modules package-lock.json && npm install",
|
||||
"install:vite8": "npm install --force"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/preset-typescript": "^7.28.4",
|
||||
"@eslint/js": "^9.29.0",
|
||||
"@linaria/core": "^6.3.0",
|
||||
"@types/node": "^24.0.3",
|
||||
"@typescript/native-preview": "^7.0.0-dev.20251203.1",
|
||||
"@vanilla-extract/css": "^1.17.5",
|
||||
"@vanilla-extract/vite-plugin": "^5.1.3",
|
||||
"@wyw-in-js/babel-preset": "^0.7.0",
|
||||
@@ -28,10 +33,9 @@
|
||||
"prettier": "3.5.3",
|
||||
"prettier-plugin-organize-imports": "^4.1.0",
|
||||
"sass-embedded": "^1.89.2",
|
||||
"typescript": "^5.8.3",
|
||||
"typescript-eslint": "^8.34.1",
|
||||
"typescript-plugin-css-modules": "^5.1.0",
|
||||
"vite": "^7.2.4"
|
||||
"vite": "^7.3.1"
|
||||
},
|
||||
"prettier": {
|
||||
"printWidth": 120,
|
||||
|
||||
54
scripts/translate.cjs
Normal file
54
scripts/translate.cjs
Normal file
@@ -0,0 +1,54 @@
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const child_process = require("child_process");
|
||||
const dotenv = require("dotenv");
|
||||
|
||||
dotenv.config({ quiet: true });
|
||||
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 githubBranchPath = "refs/heads/release";
|
||||
const githubTagPath = "refs/tags";
|
||||
const localePath = "options/locale";
|
||||
|
||||
const [major, minor, patch, tag = ""] = pkg.version.split(".");
|
||||
|
||||
console.log("Version:", pkg.version);
|
||||
let versionPath = "";
|
||||
if (tag.includes("rc") || patch.includes("latest")) {
|
||||
versionPath = `${githubBranchPath}/v${major}.${minor}`;
|
||||
} else {
|
||||
versionPath = `${githubTagPath}/v${major}.${minor}.${patch}`;
|
||||
}
|
||||
|
||||
const githubUrl = `${githubSite}/${giteaRepo}/${versionPath}/${localePath}`;
|
||||
const locales = fs.readdirSync(path.join(rootDir, localePath)).filter(file => file.endsWith(".ini"));
|
||||
|
||||
(async () => {
|
||||
for (const locale of locales) {
|
||||
const localUrl = `${githubUrl}/${locale}`;
|
||||
console.log("LocaleUrl:", localUrl);
|
||||
const themeLocale = fs.readFileSync(path.join(rootDir, localePath, locale), "utf-8");
|
||||
|
||||
const response = await fetch(localUrl);
|
||||
if (!response.ok) {
|
||||
throw new Error(`HTTP error! status: ${response.status}`);
|
||||
}
|
||||
let content = await response.text();
|
||||
if (locale.includes("zh-CN")) {
|
||||
content = content.replaceAll("工单", "议题").replaceAll("合并请求", "拉取请求");
|
||||
}
|
||||
fs.mkdirSync(path.join(rootDir, "dist", localePath), { recursive: true });
|
||||
fs.writeFileSync(path.join(rootDir, "dist", localePath, locale), content + themeLocale);
|
||||
}
|
||||
|
||||
if (process.env.SSH_SERVER && process.env.GITEA_PATH && process.env.SSH_USER) {
|
||||
const cmd = `scp -r dist/options ${process.env.SSH_USER}@${process.env.SSH_SERVER}:${process.env.GITEA_PATH}`;
|
||||
console.log("[translate] exec:", cmd);
|
||||
child_process.execSync(cmd, { stdio: "inherit" });
|
||||
}
|
||||
})();
|
||||
54
scripts/update_template.cjs
Normal file
54
scripts/update_template.cjs
Normal 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);
|
||||
}
|
||||
})();
|
||||
@@ -139,13 +139,21 @@ export const runWorkflow = css`
|
||||
export const actionViewHeader = css`
|
||||
.action-view-header {
|
||||
.action-commit-summary {
|
||||
a:hover {
|
||||
text-decoration: inherit;
|
||||
}
|
||||
// 提前哈希
|
||||
> a.muted:first-of-type {
|
||||
text-decoration: underline;
|
||||
}
|
||||
// 分支标签按钮
|
||||
.ui.label {
|
||||
.ui.ui.ui.label {
|
||||
background-color: ${themeVars.github.bgColor.accent.muted};
|
||||
border-radius: ${otherThemeVars.border.radius};
|
||||
color: ${themeVars.github.fgColor.accent};
|
||||
font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, monospace);
|
||||
font-weight: 400;
|
||||
> a {
|
||||
font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
|
||||
font-weight: 400;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@@ -155,9 +163,10 @@ export const actionViewHeader = css`
|
||||
|
||||
// 工作流左侧作业列表
|
||||
export const actionViewLeft = css`
|
||||
.action-view-left {
|
||||
.action-view-left.action-view-left.action-view-left {
|
||||
margin-right: 28px;
|
||||
border-top: 1px solid ${themeVars.color.console.border};
|
||||
max-width: 22vw;
|
||||
&:before {
|
||||
content: "Jobs";
|
||||
color: ${themeVars.color.console.fg.subtle};
|
||||
|
||||
@@ -101,11 +101,13 @@ export const repoFiles = css`
|
||||
background: ${themeVars.color.body};
|
||||
min-height: 48px;
|
||||
padding: 0px 8px !important;
|
||||
overflow-x: visible;
|
||||
svg {
|
||||
color: ${themeVars.color.text.light.num1};
|
||||
}
|
||||
.file-header-left {
|
||||
padding: 8px !important;
|
||||
padding: 6px 8px !important;
|
||||
line-height: 1.45;
|
||||
// 伪元素宽度等于按钮宽度而不是父元素宽度
|
||||
position: relative;
|
||||
&:hover {
|
||||
@@ -116,7 +118,7 @@ export const repoFiles = css`
|
||||
content: "";
|
||||
background: ${themeVars.github.underlineNav.borderColor.active};
|
||||
border-radius: ${otherThemeVars.border.radius};
|
||||
bottom: -7px;
|
||||
bottom: -8px;
|
||||
left: 0;
|
||||
height: 2px;
|
||||
position: absolute;
|
||||
@@ -127,9 +129,19 @@ export const repoFiles = css`
|
||||
text-decoration-line: none;
|
||||
}
|
||||
}
|
||||
.file-header-right:hover {
|
||||
background: ${themeVars.github.control.transparent.bgColor.hover};
|
||||
border-radius: ${otherThemeVars.border.radius};
|
||||
.file-header-right {
|
||||
.btn-octicon {
|
||||
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};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -275,6 +275,11 @@ export const prBranch = css`
|
||||
}
|
||||
`;
|
||||
|
||||
const botLabelStyle = {
|
||||
height: "20px",
|
||||
padding: "0 6px!important",
|
||||
marginLeft: "4px",
|
||||
};
|
||||
// 评论
|
||||
export const comment = css`
|
||||
.comment .comment-container {
|
||||
@@ -299,6 +304,26 @@ export const comment = css`
|
||||
.comment-header {
|
||||
padding: 4px 4px 4px 16px;
|
||||
min-height: 38px;
|
||||
.comment-header-left {
|
||||
// bot 标签
|
||||
.ui.basic.label {
|
||||
${botLabelStyle}
|
||||
}
|
||||
a:has(relative-time) {
|
||||
text-decoration: underline;
|
||||
}
|
||||
// 已编辑按钮
|
||||
.content-history-menu {
|
||||
color: ${themeVars.color.text.light.num1} !important;
|
||||
.menu .item {
|
||||
font-size: 12px;
|
||||
.ui.avatar {
|
||||
height: 20px;
|
||||
width: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.comment-header-right {
|
||||
> .item,
|
||||
@@ -311,12 +336,6 @@ export const comment = css`
|
||||
height: 20px;
|
||||
padding: 0 6px;
|
||||
}
|
||||
// 隐藏顶部菜单的表情按钮
|
||||
// 无法使用此样式, 评论无表情时底部的表情按钮元素不会渲染, 这是一个先有鸡还是先有蛋的问题
|
||||
// 很蛋疼, 希望 Gitea 早日使用 Github 的样式, 因为 Github 的更合理, 无论是操作的方便程度还是按钮的冗余度
|
||||
// .ui.dropdown.action.select-reaction {
|
||||
// display: none;
|
||||
// }
|
||||
.context-dropdown {
|
||||
height: 28px;
|
||||
padding: 0 6px;
|
||||
@@ -526,11 +545,9 @@ export const prMerge = css`
|
||||
padding: 16px;
|
||||
display: grid;
|
||||
gap: 8px;
|
||||
&.no-header {
|
||||
&::before,
|
||||
&::after {
|
||||
display: none;
|
||||
}
|
||||
&::before,
|
||||
&::after {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -547,7 +564,7 @@ export const timeline = css`
|
||||
}
|
||||
.timeline-item,
|
||||
.timeline-item-group {
|
||||
padding: 16px 0;
|
||||
padding: 12px 0;
|
||||
.comment-text-line {
|
||||
color: ${themeVars.color.text.light.num1};
|
||||
}
|
||||
@@ -555,10 +572,20 @@ export const timeline = css`
|
||||
&.event {
|
||||
// 修复覆盖后的位置问题
|
||||
padding-left: 15px;
|
||||
.avatar {
|
||||
// 避免锚中批准的头像
|
||||
.avatar-with-link .avatar {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
}
|
||||
// 批准时间的头像
|
||||
// 头部居中偏移量(头像高度 - 标准行信息高度) / 2: (40px - 32px) / 2 = 4px
|
||||
.timeline-avatar {
|
||||
top: -4px;
|
||||
}
|
||||
// bot 标签
|
||||
.comment-text-line .ui.basic.label {
|
||||
${botLabelStyle}
|
||||
}
|
||||
.badge {
|
||||
border: 2px solid ${themeVars.color.body};
|
||||
}
|
||||
@@ -659,6 +686,18 @@ export const issueSidebar = css`
|
||||
margin-top: 0 !important;
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
// 评审人
|
||||
.ui.relaxed.list {
|
||||
.item {
|
||||
// 操作图标按钮
|
||||
a.muted.icon {
|
||||
color: ${themeVars.color.text.light.num1};
|
||||
&:hover {
|
||||
color: ${themeVars.color.primary.self};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 标签菜单项
|
||||
.ui.dropdown > .menu > .scrolling.menu > .item:has(.item-secondary-info) {
|
||||
// 修复标签菜单中描述文本过长没有换行挤掉标签的问题
|
||||
|
||||
@@ -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%;
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -129,6 +129,8 @@ export const shaLabel = css`
|
||||
// 验证提交附带的图标
|
||||
span.ui.label.commit-is-signed {
|
||||
height: 25px;
|
||||
min-width: 35px;
|
||||
justify-content: center;
|
||||
// 验证信任
|
||||
&.sign-trusted {
|
||||
border: 1.5px solid ${themeVars.color.green.badge.self} !important;
|
||||
@@ -161,11 +163,19 @@ export const shaLabel = css`
|
||||
background-color: ${themeVars.color.red.badge.hover.bg} !important;
|
||||
}
|
||||
}
|
||||
span {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
span.ui.label.commit-is-signed,
|
||||
.ui.label.commit-id-short,
|
||||
.ui.label.commit-sign-badge {
|
||||
font-size: 12px;
|
||||
.ui.avatar {
|
||||
border-radius: 9999px;
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
|
||||
@@ -32,4 +32,10 @@ export const commitSignBadge = css`
|
||||
}
|
||||
}
|
||||
}
|
||||
.ui.label.commit-sign-badge.github-theme-commit-sign-badge {
|
||||
font-family:
|
||||
-apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji",
|
||||
"Segoe UI Emoji";
|
||||
font-weight: 500;
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -114,6 +114,13 @@
|
||||
{{svg "octicon-question"}}
|
||||
{{ctx.Locale.Tr "help"}}
|
||||
</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>
|
||||
<a class="item link-action" href data-url="{{AppSubUrl}}/user/logout">
|
||||
{{svg "octicon-sign-out"}}
|
||||
|
||||
@@ -55,21 +55,37 @@ so this template should be kept as small as possible, DO NOT put large component
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $github_verifed := "github-theme.verifed" -}}
|
||||
{{- $ctx_github_verifed := ctx.Locale.Tr $github_verifed -}}
|
||||
{{- $github_partially_verifed := "github-theme.partially_verifed" -}}
|
||||
{{- $ctx_github_partially_verifed := ctx.Locale.Tr $github_partially_verifed -}}
|
||||
{{- $github_unverifed := "github-theme.unverifed" -}}
|
||||
{{- $ctx_github_unverifed := ctx.Locale.Tr $github_unverifed -}}
|
||||
|
||||
{{- if $commit -}}
|
||||
<a {{if $commitBaseLink}}href="{{$commitBaseLink}}/{{$commit.ID}}"{{end}} class="ui label commit-id-short {{$extraClass}} github-theme-commit-sha" rel="nofollow">
|
||||
{{- end -}}
|
||||
{{- if or (not $commit) $extraClass}}{{/* only show the lock icon if there is no commit info (icon only) or the commit is really signed */}}
|
||||
<span class="ui label commit-sign-badge {{$extraClass}}">
|
||||
<span class="ui label commit-sign-badge github-theme-commit-sign-badge {{$extraClass}}">
|
||||
{{- if $verified -}}
|
||||
{{- if and $signingUser $signingUser.ID -}}
|
||||
<span data-tooltip-content="{{$msgReason}}">{{svg "gitea-lock"}}</span>
|
||||
<span data-tooltip-content="{{$msgReason}}">
|
||||
{{if eq $ctx_github_verifed $github_verifed }}Verified
|
||||
{{else}}{{$ctx_github_verifed}}{{end}}
|
||||
</span>
|
||||
<span data-tooltip-content="{{$msgSigningKey}}">{{ctx.AvatarUtils.Avatar $signingUser 16}}</span>
|
||||
{{- else -}}
|
||||
<span data-tooltip-content="{{$msgReason}}">{{svg "gitea-lock-cog"}}</span>
|
||||
<span data-tooltip-content="{{$msgReason}}">
|
||||
{{if eq $ctx_github_partially_verifed $github_partially_verifed }}Partially verified
|
||||
{{else}}{{$ctx_github_partially_verifed}}{{end}}
|
||||
</span>
|
||||
<span data-tooltip-content="{{$msgSigningKey}}">{{ctx.AvatarUtils.AvatarByEmail $signingEmail "" 16}}</span>
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
<span data-tooltip-content="{{$msgReason}}">{{svg "gitea-unlock"}}</span>
|
||||
<span data-tooltip-content="{{$msgReason}}">
|
||||
{{if eq $ctx_github_unverifed $github_unverifed }}Unverified
|
||||
{{else}}{{$ctx_github_unverifed}}{{end}}
|
||||
</span>
|
||||
{{- end -}}
|
||||
</span>
|
||||
{{- end -}}
|
||||
|
||||
@@ -30,11 +30,11 @@
|
||||
"erasableSyntaxOnly": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"noUncheckedSideEffectImports": true,
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"src/*": ["src/*"],
|
||||
"styles/*": ["styles/*"],
|
||||
"themes/*": ["themes/*", "themes/*.css"]
|
||||
"*": ["./*"],
|
||||
"src/*": ["./src/*"],
|
||||
"styles/*": ["./styles/*"],
|
||||
"themes/*": ["./themes/*", "./themes/*.css"]
|
||||
}
|
||||
},
|
||||
"include": ["src", "styles", "themes", "vite.config.ts"]
|
||||
|
||||
@@ -8,9 +8,8 @@ import * as sass from "sass-embedded";
|
||||
import { defineConfig } from "vite";
|
||||
import { themeInput, themePlugin } from "./src/core/vite";
|
||||
|
||||
dotenv.config({ quiet: true });
|
||||
|
||||
const require = createRequire(import.meta.url);
|
||||
dotenv.config({ quiet: true });
|
||||
|
||||
const outDir = "dist"; // 输出目录
|
||||
const themesDir = "themes"; // 颜色主题目录
|
||||
|
||||
Reference in New Issue
Block a user