Compare commits

...

25 Commits

Author SHA1 Message Date
lutinglt
f91d295b42 1.25.2 2025-11-23 11:07:46 +08:00
lutinglt
6e3f207c6c Fix the spacing of Issue WIP prompts 2025-11-22 17:46:45 +08:00
lutinglt
5c36998d5e release templates 2025-11-21 14:31:31 +08:00
lutinglt
a83fe43cbb Navigation bar Issue & PR moved to the right side. 2025-11-21 14:28:40 +08:00
lutinglt
678beb2c0d Optimize pr branch label 2025-11-13 20:44:55 +08:00
lutinglt
fd12236144 Optimize top navbar style on mobile 2025-11-13 20:32:45 +08:00
lutinglt
f33a0ae81c Optimize action list line height 2025-11-13 18:40:52 +08:00
鲁汀
a1d531ba36 Remove Downloads History from README
Removed Downloads History section and associated images.
2025-11-12 00:10:40 +08:00
lutinglt
32d0274b56 star history 2025-11-09 23:14:30 +08:00
lutinglt
74c98fbd5d update 2025-11-09 23:07:23 +08:00
lutinglt
d6567618d9 update readme 2025-11-09 23:04:29 +08:00
lutinglt
0cc4f61984 update readme 2025-11-09 22:59:42 +08:00
lutinglt
fd20862833 add --color-logo 2025-11-09 22:15:45 +08:00
lutinglt
ea49cf94dd Fix packages details page style 2025-11-09 10:04:35 +08:00
lutinglt
4fd01c50b0 Optimize organization detail page style 2025-11-09 09:50:25 +08:00
lutinglt
f500f2aae3 remove org label style 2025-11-08 23:56:21 +08:00
lutinglt
b220a17829 fix label 2025-11-08 23:51:20 +08:00
lutinglt
0a0cd77b3f Optimize repository header name style 2025-11-08 20:38:26 +08:00
lutinglt
aa36f52d83 Optimize repository header style 2025-11-08 20:37:23 +08:00
lutinglt
a841636737 Optimize global line height 2025-11-08 20:09:13 +08:00
lutinglt
fb1ebd6f18 fuck issue 2025-11-07 09:00:54 +08:00
lutinglt
4ae9a2754f Optimize the workflow log page style 2025-11-06 19:24:51 +08:00
lutinglt
914d5228e3 perf action step container 2025-11-06 18:05:12 +08:00
lutinglt
efec911021 Fix fixed height when scrolling through step titles on workflow detail pages 2025-11-06 17:43:10 +08:00
lutinglt
5e3f2ec2c2 Fix the disabled operation button interval in the code preview interface 2025-11-06 17:36:09 +08:00
31 changed files with 699 additions and 120 deletions

View File

@@ -5,4 +5,6 @@ SSH_SERVER=localhost
# 上传到服务器的用户名称, 不支持密码, 请确保有 SSH 免密登录权限
SSH_USER=root
# 上传到服务器的主题路径, 请使用绝对路径
GITEA_THEME_PATH=/data/gitea/public/assets/css/
GITEA_THEME_PATH=/data/gitea/public/assets/css/
# Gitea 数据路径, 用于上传到服务器的模板路径, 请使用绝对路径
GITEA_PATH=/data/gitea/

View File

@@ -6,7 +6,9 @@
### 🌈 Style
##### 更符合 GitHub 风格
#### 更符合 GitHub 风格
##### 模板文件
### 🐞 Fix
@@ -14,7 +16,9 @@
#### CSS Variable
##### More GitHub-like style
#### More GitHub-like style
##### Template File
```text
在 English 下方补充上面 Feature 以下部分的内容的中译英​

View File

@@ -5,6 +5,7 @@ body:
- type: markdown
attributes:
value: |
!!! Please read the readme and ensure that the theme is used correctly before submitting !!!
1. Please use the latest theme and refresh the page with Ctrl+F5 to see if the Bug has disappeared.
2. Please check the CHANGELOG.md file in the project root directory for descriptions of fixes related to this Bug.
3. If there are related descriptions, you can check if the Bug has been fixed by compiling the development version yourself in the README.md.

View File

@@ -29,6 +29,7 @@ jobs:
tar -zcf dist/theme-github-extra-pink.tar.gz --remove-files \
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
TAG="v$(npm run -s version)"
gh release create "$TAG" dist/* --notes-file CHANGELOG.md --draft -t $TAG
env:

View File

@@ -1,7 +1,27 @@
### ✨ Feature
- Added template files to make Gitea's layout more similar to GitHub. (This is optional, you can choose whether to use
template files based on your needs)
### 🌈 Style
##### More aligned with GitHub style
#### More aligned with GitHub style
- Optimize global line height.
- Optimize the workflow log page style.
- Optimize repository header name style.
- Optimize organization detail page style.
- Optimize top navbar style on mobile.
##### Template File
- Navigation bar Issue & PR moved to the right side.
### 🐞 Fix
- Fix the problem of missing background color and width when there is a unicode character in the diff
- Fix the problem of missing background color and width when there is a unicode character in the diff.
- Fix the disabled operation button interval in the code preview interface.
- Fix fixed height when scrolling through step titles on workflow detail pages.
- Fix packages details page style.
- Fix the color of missing icons and text on the homepage when not logged in.
- Fix the spacing of Issue WIP prompts.

View File

@@ -68,6 +68,16 @@ For details, please refer to the Gitea documentation
>
> Automatic color theme requires both light and dark theme files.
### Template File Installation (Optional)
1. Download the latest template files from the release page and place them in the `gitea/templates` directory
2. Restart Gitea
> [!IMPORTANT]
>
> 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.
## Screenshots
### Basic Themes
@@ -169,3 +179,13 @@ npm run build
After compilation, theme files will be generated in the `dist` directory. You can place the theme files into the
`gitea/public/assets/css` directory, then add the theme name to the end of `THEMES` in `gitea/conf/app.ini`
## Star History
<a href="https://www.star-history.com/#lutinglt/gitea-github-theme&type=date&legend=top-left">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=lutinglt/gitea-github-theme&type=date&theme=dark&legend=top-left" />
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=lutinglt/gitea-github-theme&type=date&legend=top-left" />
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=lutinglt/gitea-github-theme&type=date&legend=top-left" />
</picture>
</a>

View File

@@ -62,6 +62,15 @@ THEMES = gitea-auto, gitea-light, gitea-dark, github-auto, github-light, github-
>
> 自动颜色主题需要亮色和暗色的主题文件
### 模板文件安装 (可选)
1. 在发布页下载最新的模板文件放入 `gitea/templates` 目录下
2. 重启 Gitea
> [!IMPORTANT]
>
> 模板修改了 Gitea 的布局, 使其更接近 GitHub 的布局, 请勿跨版本使用模板文件, 可能会导致功能缺失等问题
## 截图
### 基本主题

1
gitea/README.md Normal file
View File

@@ -0,0 +1 @@
模板的原始文件

View File

@@ -0,0 +1,173 @@
<nav id="navbar" aria-label="{{ctx.Locale.Tr "aria.navbar"}}">
<div class="navbar-left">
<!-- the logo -->
<a class="item" id="navbar-logo" href="{{AppSubUrl}}/" aria-label="{{if .IsSigned}}{{ctx.Locale.Tr "dashboard"}}{{else}}{{ctx.Locale.Tr "home"}}{{end}}">
<img width="30" height="30" src="{{AssetUrlPrefix}}/img/logo.svg" alt="{{ctx.Locale.Tr "logo"}}" aria-hidden="true">
</a>
<!-- mobile right menu, it must be here because in mobile view, each item is a flex column, the first item is a full row column -->
<div class="ui secondary menu navbar-mobile-right only-mobile">
{{template "base/head_navbar_icons" dict "PageGlobalData" .PageGlobalData}}
<button class="item ui icon mini button tw-m-0" id="navbar-expand-toggle" aria-label="{{ctx.Locale.Tr "home.nav_menu"}}">{{svg "octicon-three-bars"}}</button>
</div>
<!-- navbar links non-mobile -->
{{if and .IsSigned .MustChangePassword}}
{{/* No links */}}
{{else if .IsSigned}}
{{if not ctx.Consts.RepoUnitTypeIssues.UnitGlobalDisabled}}
<a class="item{{if .PageIsIssues}} active{{end}}" href="{{AppSubUrl}}/issues">{{ctx.Locale.Tr "issues"}}</a>
{{end}}
{{if not ctx.Consts.RepoUnitTypePullRequests.UnitGlobalDisabled}}
<a class="item{{if .PageIsPulls}} active{{end}}" href="{{AppSubUrl}}/pulls">{{ctx.Locale.Tr "pull_requests"}}</a>
{{end}}
{{if not (and ctx.Consts.RepoUnitTypeIssues.UnitGlobalDisabled ctx.Consts.RepoUnitTypePullRequests.UnitGlobalDisabled)}}
{{if .ShowMilestonesDashboardPage}}
<a class="item{{if .PageIsMilestonesDashboard}} active{{end}}" href="{{AppSubUrl}}/milestones">{{ctx.Locale.Tr "milestones"}}</a>
{{end}}
{{end}}
<a class="item{{if .PageIsExplore}} active{{end}}" href="{{AppSubUrl}}/explore/repos">{{ctx.Locale.Tr "explore"}}</a>
{{else if .IsLandingPageOrganizations}}
<a class="item{{if .PageIsExplore}} active{{end}}" href="{{AppSubUrl}}/explore/organizations">{{ctx.Locale.Tr "explore"}}</a>
{{else}}
<a class="item{{if .PageIsExplore}} active{{end}}" href="{{AppSubUrl}}/explore/repos">{{ctx.Locale.Tr "explore"}}</a>
{{end}}
{{template "custom/extra_links" .}}
{{if not .IsSigned}}
<a class="item" target="_blank" rel="noopener noreferrer" href="https://docs.gitea.com">{{ctx.Locale.Tr "help"}}</a>
{{end}}
</div>
<!-- the full dropdown menus -->
<div class="navbar-right">
{{if and .IsSigned .MustChangePassword}}
<div class="ui dropdown jump item" data-tooltip-content="{{ctx.Locale.Tr "user_profile_and_more"}}">
<span class="text">
{{ctx.AvatarUtils.Avatar .SignedUser 24 "tw-mr-1"}}
<span class="only-mobile">{{.SignedUser.Name}}</span>
<span class="not-mobile">{{svg "octicon-triangle-down"}}</span>
</span>
<div class="menu user-menu">
<div class="header">
{{ctx.Locale.Tr "signed_in_as"}} <strong>{{.SignedUser.Name}}</strong>
</div>
<div class="divider"></div>
<a class="item link-action" href data-url="{{AppSubUrl}}/user/logout">
{{svg "octicon-sign-out"}}
{{ctx.Locale.Tr "sign_out"}}
</a>
</div><!-- end content avatar menu -->
</div><!-- end dropdown avatar menu -->
{{else if .IsSigned}}
{{template "base/head_navbar_icons" dict "ItemExtraClass" "not-mobile" "PageGlobalData" .PageGlobalData}}
<div class="ui dropdown jump item" data-tooltip-content="{{ctx.Locale.Tr "create_new"}}">
<span class="text">
{{svg "octicon-plus"}}
<span class="not-mobile">{{svg "octicon-triangle-down"}}</span>
<span class="only-mobile">{{ctx.Locale.Tr "create_new"}}</span>
</span>
<div class="menu">
<a class="item" href="{{AppSubUrl}}/repo/create">
{{svg "octicon-plus"}} {{ctx.Locale.Tr "new_repo"}}
</a>
{{if not .DisableMigrations}}
<a class="item" href="{{AppSubUrl}}/repo/migrate">
{{svg "octicon-repo-push"}} {{ctx.Locale.Tr "new_migrate"}}
</a>
{{end}}
{{if .SignedUser.CanCreateOrganization}}
<a class="item" href="{{AppSubUrl}}/org/create">
{{svg "octicon-organization"}} {{ctx.Locale.Tr "new_org"}}
</a>
{{end}}
</div><!-- end content create new menu -->
</div><!-- end dropdown menu create new -->
<div class="ui dropdown jump item" data-tooltip-content="{{ctx.Locale.Tr "user_profile_and_more"}}">
<span class="text">
{{ctx.AvatarUtils.Avatar .SignedUser 24 "tw-mr-1"}}
<span class="only-mobile">{{.SignedUser.Name}}</span>
<span class="not-mobile">{{svg "octicon-triangle-down"}}</span>
</span>
<div class="menu user-menu">
<div class="header">
{{ctx.Locale.Tr "signed_in_as"}} <strong>{{.SignedUser.Name}}</strong>
</div>
<div class="divider"></div>
<a class="item" href="{{.SignedUser.HomeLink}}">
{{svg "octicon-person"}}
{{ctx.Locale.Tr "your_profile"}}
</a>
{{if not .DisableStars}}
<a class="item" href="{{.SignedUser.HomeLink}}?tab=stars">
{{svg "octicon-star"}}
{{ctx.Locale.Tr "your_starred"}}
</a>
{{end}}
<a class="item" href="{{AppSubUrl}}/notifications/subscriptions">
{{svg "octicon-bell"}}
{{ctx.Locale.Tr "notification.subscriptions"}}
</a>
<a class="{{if .PageIsUserSettings}}active {{end}}item" href="{{AppSubUrl}}/user/settings">
{{svg "octicon-tools"}}
{{ctx.Locale.Tr "your_settings"}}
</a>
<a class="item" target="_blank" rel="noopener noreferrer" href="https://docs.gitea.com">
{{svg "octicon-question"}}
{{ctx.Locale.Tr "help"}}
</a>
<div class="divider"></div>
<a class="item link-action" href data-url="{{AppSubUrl}}/user/logout">
{{svg "octicon-sign-out"}}
{{ctx.Locale.Tr "sign_out"}}
</a>
</div><!-- end content avatar menu -->
</div><!-- end dropdown avatar menu -->
{{else}}
{{if .ShowRegistrationButton}}
<a class="item{{if .PageIsSignUp}} active{{end}}" href="{{AppSubUrl}}/user/sign_up">
{{svg "octicon-person"}}
<span class="tw-ml-1">{{ctx.Locale.Tr "register"}}</span>
</a>
{{end}}
<a class="item{{if .PageIsSignIn}} active{{end}}" rel="nofollow" href="{{AppSubUrl}}/user/login{{if not .PageIsSignIn}}?redirect_to={{.CurrentURL}}{{end}}">
{{svg "octicon-sign-in"}}
<span class="tw-ml-1">{{ctx.Locale.Tr "sign_in"}}</span>
</a>
{{end}}
</div><!-- end full right menu -->
{{$activeStopwatch := and .PageGlobalData (call .PageGlobalData.GetActiveStopwatch)}}
{{if $activeStopwatch}}
<div class="active-stopwatch-popup tippy-target">
<div class="tw-flex tw-items-center tw-gap-2 tw-p-3">
<a class="stopwatch-link tw-flex tw-items-center tw-gap-2 muted" href="{{$activeStopwatch.IssueLink}}">
{{svg "octicon-issue-opened" 16}}
<span class="stopwatch-issue">{{$activeStopwatch.RepoSlug}}#{{$activeStopwatch.IssueIndex}}</span>
</a>
<div class="tw-flex tw-gap-1">
<form class="stopwatch-commit form-fetch-action" method="post" action="{{$activeStopwatch.IssueLink}}/times/stopwatch/stop">
{{.CsrfTokenHtml}}
<button
type="submit"
class="ui button mini compact basic icon tw-mr-0"
data-tooltip-content="{{ctx.Locale.Tr "repo.issues.stop_tracking"}}"
>{{svg "octicon-square-fill"}}</button>
</form>
<form class="stopwatch-cancel form-fetch-action" method="post" action="{{$activeStopwatch.IssueLink}}/times/stopwatch/cancel">
{{.CsrfTokenHtml}}
<button
type="submit"
class="ui button mini compact basic icon tw-mr-0"
data-tooltip-content="{{ctx.Locale.Tr "repo.issues.cancel_tracking"}}"
>{{svg "octicon-trash"}}</button>
</form>
</div>
</div>
</div>
{{end}}
</nav>

View File

@@ -0,0 +1,25 @@
{{- $itemExtraClass := .ItemExtraClass -}}
{{- $data := .PageGlobalData -}}
{{if and $data $data.IsSigned}}{{/* data may not exist, for example: rendering 503 page before the PageGlobalData middleware */}}
{{- $activeStopwatch := call $data.GetActiveStopwatch -}}
{{- $notificationUnreadCount := call $data.GetNotificationUnreadCount -}}
{{if $activeStopwatch}}
<a class="item active-stopwatch {{$itemExtraClass}}" href="{{$activeStopwatch.IssueLink}}" title="{{ctx.Locale.Tr "active_stopwatch"}}" data-seconds="{{$activeStopwatch.Seconds}}">
<div class="tw-relative">
{{svg "octicon-stopwatch"}}
<span class="header-stopwatch-dot"></span>
</div>
</a>
{{end}}
<a class="item {{$itemExtraClass}}" href="{{AppSubUrl}}/notifications" data-tooltip-content="{{ctx.Locale.Tr "notifications"}}">
<div class="tw-relative">
{{svg "octicon-bell"}}
<span class="notification_count{{if not $notificationUnreadCount}} tw-hidden{{end}}">{{$notificationUnreadCount}}</span>
</div>
</a>
{{if $data.IsSiteAdmin}}
<a class="item {{$itemExtraClass}}" href="{{AppSubUrl}}/-/admin" data-tooltip-content="{{ctx.Locale.Tr "admin_panel"}}">
{{svg "octicon-server"}}
</a>
{{end}}
{{end}}

View File

@@ -132,6 +132,7 @@ export function github2ThemeColor(githubColor: GithubColor): ThemeColor {
};
const other: Other = {
logo: themeVars.color.primary.self,
body: githubColor.bgColor.default,
box: {
header: githubColor.bgColor.muted,

View File

@@ -121,17 +121,28 @@ export function themePlugin(): Plugin {
const server = process.env.SSH_SERVER;
const user = process.env.SSH_USER || "root";
const theme_path = process.env.GITEA_THEME_PATH;
if (server && theme_path) {
const cmd = `scp dist/${prefix}*.css ${user}@${server}:${theme_path}`;
console.log("[themePlugin] exec:", cmd);
const gitea_path = process.env.GITEA_PATH;
if (server) {
try {
execSync(cmd, { stdio: "inherit" });
// eslint-disable-next-line @typescript-eslint/no-unused-vars
if (theme_path) {
const cmd = `scp dist/${prefix}*.css ${user}@${server}:${theme_path}`;
console.log("[themePlugin] exec:", cmd);
execSync(cmd, { stdio: "inherit" });
} else {
console.log("[themePlugin] no GITEA_THEME_PATH, skip upload");
}
if (gitea_path) {
const cmd = `scp -r templates ${user}@${server}:${gitea_path}`;
console.log("[themePlugin] exec:", cmd);
execSync(cmd, { stdio: "inherit" });
} else {
console.log("[themePlugin] no GITEA_TMPL_PATH, skip upload");
}
} catch (_) {
// continue regardless of error
}
} else {
console.log("[themePlugin] no SSH_SERVER or GITEA_THEME_PATH, skip upload");
console.log("[themePlugin] no SSH_SERVER, skip upload");
}
console.log("[themePlugin] exec end.");
},

View File

@@ -8,6 +8,8 @@ export const otherAuto = {
};
export const other = {
/** 未登录时的介绍首页的 SVG 和链接文字颜色 */
logo: null,
/** 主要背景色 */
body: null,
/** 页面底部状态栏背景色 */

View File

@@ -63,6 +63,7 @@ export const actions = css`
color: ${themeVars.github.fgColor.accent};
font-family: var(--fonts-monospace);
font-weight: 400;
padding: 0px 6px;
&:hover {
background-color: ${themeVars.github.bgColor.accent.muted};
color: ${themeVars.github.fgColor.accent};
@@ -76,6 +77,7 @@ export const actions = css`
.flex-item {
padding: 16px;
line-height: 18px;
.flex-item-leading {
align-self: flex-start;
margin-top: 2px;
@@ -156,7 +158,6 @@ export const actionViewLeft = css`
.action-view-left {
margin-right: 28px;
border-top: 1px solid ${themeVars.color.console.border};
&:before {
content: "Jobs";
color: ${themeVars.color.console.fg.subtle};
@@ -168,52 +169,53 @@ export const actionViewLeft = css`
top: -8px;
left: 15px;
}
.job-group-section {
padding-right: 8px;
padding-bottom: 8px;
border-bottom: 1px solid ${themeVars.color.console.border};
.job-brief-item {
border-radius: ${otherThemeVars.border.radius} !important;
padding: 8px;
position: relative;
margin-left: 0.5rem;
&.selected {
.job-brief-list {
gap: 4px;
// 双重确保覆盖原始样式
.job-brief-item.job-brief-item {
border-radius: ${otherThemeVars.border.radius} !important;
padding: 8px;
position: relative;
margin-left: 0.5rem;
&:hover {
background-color: ${themeVars.color.console.hoverBg};
}
&:after {
overflow: visible;
background: ${themeVars.github.borderColor.accent.emphasis};
border-radius: ${otherThemeVars.border.radius};
content: "";
height: 24px;
left: calc(0.5rem * -1);
position: absolute;
top: calc(50% - 12px);
width: 4px;
}
}
.job-brief-item-right {
svg.job-brief-rerun {
display: none;
color: ${themeVars.color.console.fg.subtle};
&:hover {
color: ${themeVars.color.text.self};
&.selected {
&:after {
overflow: visible;
background: ${themeVars.github.borderColor.accent.emphasis};
border-radius: ${otherThemeVars.border.radius};
content: "";
height: 24px;
left: calc(0.5rem * -1);
position: absolute;
top: calc(50% - 12px);
width: 4px;
}
}
.step-summary-duration {
color: ${themeVars.color.console.fg.subtle};
font-family: var(--fonts-monospace);
}
}
&:hover {
.job-brief-item-right {
svg.job-brief-rerun {
display: inline-block;
display: none;
color: ${themeVars.color.console.fg.subtle};
&:hover {
color: ${themeVars.color.text.self};
}
}
.step-summary-duration {
color: ${themeVars.color.console.fg.subtle};
font-family: var(--fonts-monospace);
font-size: 12px;
}
}
&:hover {
.job-brief-item-right {
svg.job-brief-rerun {
display: inline-block;
}
}
}
}
@@ -253,52 +255,57 @@ export const actionViewRight = css`
}
.job-step-container {
// 步骤标题
.job-step-summary {
color: ${themeVars.color.console.fg.subtle};
padding: 8px 10px !important;
&.selected {
// 滚动时固定在顶部的高度与 job-info-header 高度相同
top: 80px;
}
&.step-expandable:hover {
padding: 8px;
.job-step-section {
margin: 0 4px 4px;
// 步骤标题, 双重确保覆盖原始样式
.job-step-summary.job-step-summary {
color: ${themeVars.color.console.fg.subtle};
}
padding: 8px !important;
height: 36px;
.tw-mr-2:not(.svg) svg.svg {
margin: 1.5px 6px 0px 2px;
}
/* 绿色步骤状态改为白色 */
svg.svg.text.green {
color: ${themeVars.color.console.fg.subtle} !important;
}
&.selected {
// 滚动时固定在顶部的高度与 job-info-header 高度相同
top: 80px;
}
&.selected {
/* 不被 hover 效果影响 */
color: ${themeVars.color.console.fg.self} !important;
background-color: ${themeVars.color.console.activeBg} !important;
&.step-expandable:hover {
color: ${themeVars.color.console.fg.subtle};
}
.tw-mr-2:not(.svg) svg.svg {
margin: 1.5px 6px 0px 2px;
}
/* 绿色步骤状态改为白色 */
svg.svg.text.green {
color: ${themeVars.color.console.fg.subtle} !important;
}
&.selected {
/* 不被 hover 效果影响 */
color: ${themeVars.color.console.fg.self} !important;
background-color: ${themeVars.color.console.activeBg} !important;
svg.svg.text.green {
color: ${themeVars.color.console.fg.self} !important;
}
}
// 步骤耗时
.step-summary-duration {
font-size: 12px;
font-family: var(--fonts-monospace);
}
}
// 步骤耗时
.step-summary-duration {
font-size: 12px;
font-family: var(--fonts-monospace);
}
}
// 步骤日志
.job-step-logs {
animation: ${animationDown};
/* 日志字体颜色白色 */
.job-log-line {
color: ${themeVars.color.console.fg.self};
/* 被 hover 时覆盖 ANSI 颜色 */
.log-msg:hover * {
color: ${themeVars.color.console.fg.self} !important;
// 步骤日志
.job-step-logs {
animation: ${animationDown};
/* 日志字体颜色白色 */
.job-log-line {
color: ${themeVars.color.console.fg.self};
/* 被 hover 时覆盖 ANSI 颜色 */
.log-msg:hover * {
color: ${themeVars.color.console.fg.self} !important;
}
}
}
}

View File

@@ -1,4 +1,5 @@
import { css, otherThemeVars, themeVars } from "src/types/vars";
import { labelStyle } from "styles/public/label";
export const dashboard = css`
// 首页仪表板, 避免选中管理员后台的维护管理面板
@@ -38,6 +39,9 @@ export const dashboard = css`
font-weight: 400;
background-color: unset !important;
margin-bottom: 0.25rem;
.ui.label {
border-color: #00000000;
}
}
// 仓库/组织列表
.ui.attached.segment {
@@ -47,6 +51,13 @@ export const dashboard = css`
&.repos-search {
border-top-left-radius: 12px;
border-top-right-radius: 12px;
> .menu.repos-filter {
.ui.circular.label {
border-color: #00000000;
min-height: fit-content;
padding: ${labelStyle.padding} !important;
}
}
}
&.table {
&:last-child {
@@ -58,6 +69,7 @@ export const dashboard = css`
li {
border-radius: ${otherThemeVars.border.radius};
padding: 6px 8px !important;
height: 32px;
&:not(:last-child) {
border-bottom: 0;
}

View File

@@ -316,6 +316,10 @@ export const repoFileView = css`
&:last-of-type {
border-top-right-radius: ${otherThemeVars.border.radius};
border-bottom-right-radius: ${otherThemeVars.border.radius};
// 与无权限按钮之间的间距
+ .btn-octicon.disabled {
margin-left: 8px;
}
}
&:hover {
background: ${themeVars.color.hover.self};
@@ -395,18 +399,19 @@ export const repoSidebarTop = css`
padding: 10px 0 0 0;
// 仓库描述本身
.flex-item-title {
margin-top: 12px;
margin-top: 10px;
}
// 仓库描述内容
.flex-item-body {
> .tw-flex:first-child {
margin-top: 21px !important;
margin-top: 16px !important;
gap: 8px !important;
}
.repo-description {
color: ${themeVars.color.text.self};
}
#repo-topics {
margin: 10px 0px !important;
margin: 8px 0px !important;
}
.flex-text-block {
font-size: 14px;
@@ -444,7 +449,6 @@ export const repoSidebarBottom = css`
.flex-item-leading {
svg.svg.octicon-tag {
color: ${themeVars.color.green.self};
margin-top: 2px;
}
}
.flex-item-header .flex-item-title {

View File

@@ -263,7 +263,7 @@ export const prBranch = css`
font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, monospace);
font-size: 12px;
padding: 0 5px;
line-height: 20px;
line-height: 18px;
}
.repository.view.issue .pull-desc code {
@@ -592,6 +592,8 @@ export const issueSidebar = css`
color: ${themeVars.color.text.light.num1};
font-size: 12px;
}
// WIP 前缀提示
> a,
.ui.dropdown.select-branch,
.ui.form,
a.fixed-text.muted,

View File

@@ -4,8 +4,12 @@ import { css, customThemeVars, otherThemeVars, themeVars } from "src/types/vars"
export const navbarRight = css`
#navbar {
border-bottom: 0;
padding: 0px 16px;
padding: 8px 16px; // 上下内边距 + .navbar-left & .navbar-right 的 min-height = 64px
min-height: 64px;
.navbar-left,
.navbar-right {
min-height: 48px;
}
.navbar-left {
gap: 8px;
> .item {
@@ -32,15 +36,12 @@ export const navbarRight = css`
gap: 8px;
// 右侧按钮, 但不包括头像
> .item:not(:last-child) {
display: grid;
gap: 4px;
grid-auto-columns: max-content;
align-items: center;
align-content: center;
justify-content: center;
gap: 4px;
border: 1px solid ${themeVars.color.light.border};
border-radius: ${otherThemeVars.border.radius};
padding: unset;
padding: 0;
height: 32px;
min-width: 32px;
min-height: 32px;
@@ -127,13 +128,33 @@ export const navbarRight = css`
}
}
}
// 手机下的创建菜单按钮
// 手机下的导航栏
@media (max-width: 767.98px) {
#navbar .navbar-right:has(.user-menu) > .item:not(:last-child) {
display: none;
}
#navbar.navbar-menu-open .navbar-right:has(.user-menu) > .item:not(:last-child) {
display: grid;
#navbar {
&.navbar-menu-open {
gap: 8px;
}
.navbar-mobile-right {
gap: 8px;
> .item {
align-items: center;
justify-content: center;
border: 1px solid ${themeVars.color.light.border};
border-radius: ${otherThemeVars.border.radius};
padding: 0;
height: 32px;
min-width: 32px;
min-height: 32px;
// 纠正内容保证居中
.tw-relative {
height: 16px;
width: 16px;
}
.svg {
margin: 0;
}
}
}
}
}
`;

View File

@@ -153,7 +153,7 @@ export const notification = css`
box-shadow: 2px 0 0 ${themeVars.github.borderColor.accent.emphasis} inset;
color: ${themeVars.color.text.self};
}
> .notifications-link > div{
> .notifications-link > div {
&:first-child {
font-size: 12px !important;
}

View File

@@ -2,8 +2,24 @@ import { css, themeVars } from "src/types/vars";
export const org = css`
.page-content.organization {
// 组织成员头像
.members .ui.avatar {
border-radius: 9999px;
}
// 组织头像
.org-avatar {
margin: 8px 24px 16px 0px;
}
// 组织信息
#org-info {
.ui.header {
margin-top: 8px; // 与头像对齐
gap: 8px;
// 组织名称
> .ui.header {
font-size: 24px;
> .org-visibility {
margin-left: 8px;
}
// 组织页面的 RSS 订阅按钮
.ui.label.button {
padding: 4px 16px;
@@ -16,6 +32,17 @@ export const org = css`
}
}
}
// 组织描述
> .markup {
color: ${themeVars.color.text.light.num1};
}
// 组织信息
> .meta {
font-size: 12px;
svg {
color: ${themeVars.color.text.light.num1};
}
}
}
}
`;

View File

@@ -50,8 +50,9 @@ export const packagesDetail = css`
.issue-title-header > div {
color: ${themeVars.color.text.light.num1};
}
.issue-content {
.issue-content-left {
.packages-content {
.packages-content-left {
width: calc(100% - 304px - 16px);
.ui.top.attached.header {
font-size: 14px;
padding: 16px;
@@ -79,9 +80,10 @@ export const packagesDetail = css`
}
}
}
.issue-content-right {
.packages-content-right {
border: 0;
padding: 0px 16px;
width: 304px;
> strong {
font-size: 16px;
}

View File

@@ -17,10 +17,10 @@ export const repoHeader = css`
display: flex;
align-items: center;
color: ${themeVars.color.text.self};
font-size: 16px;
font-size: 18px;
text-decoration: none !important;
min-width: 3ch;
padding: 4px 6px;
padding: 0px 6px;
border-radius: ${otherThemeVars.border.radius};
margin-top: 0.5rem;
margin-bottom: 0.5rem;
@@ -74,7 +74,8 @@ export const repoTopic = css`
border-radius: 9999px;
font-size: 12px;
font-weight: 500;
padding: 2.5px 10px;
padding: 0px 10px;
line-height: 22px;
background-color: ${themeVars.github.bgColor.accent.muted};
color: ${themeVars.github.fgColor.accent};
&:hover {

View File

@@ -83,3 +83,12 @@ export const label = css`
}
}
`;
// 修复组织设置界面的组织设置中多余的边框
export const fixOrgSetting = css`
.page-content.organization.settings {
.org-setting-content {
border: 0;
}
}
`;

View File

@@ -2,7 +2,7 @@ import { css } from "src/types/vars";
export const body = css`
body {
line-height: 18px;
line-height: 1.5;
}
a {
text-underline-offset: 0.2rem; // 0.2rem 可以始终保持下划线不受 overflow: hidden 的影响

View File

@@ -5,6 +5,7 @@ import "./base"; // 基础样式, 确保在其他样式之前导入
import "./radius"; // 圆角, 此样式为基础样式, 确保在其他样式之前导入
import "./animation"; // 动画效果
import "./transition"; // 过渡效果
import "./table"; // 表格
import "./text"; // 文本或 SVG 的基本颜色
import "./button"; // 按钮
import "./dropdown"; // 下拉框

View File

@@ -40,7 +40,7 @@ export const input = css`
align-items: center;
}
// 下拉菜单的输入框
.ui.dropdown.dropdown .menu>.input {
.ui.dropdown.dropdown .menu > .input {
margin: 12px 10px;
}
`;

View File

@@ -1,6 +1,13 @@
import { css, themeVars } from "src/types/vars";
export const labelStyle = {
padding: "0px 6px",
};
export const label = css`
.ui.label {
border: 1px solid #00000000;
}
/* 所有标签, 但不包括 a 标签 */
/* a 标签比如仓库点星等按钮旁边的数字标签按钮,提交图中的 tag 标签 */
div.label,
@@ -9,7 +16,11 @@ export const label = css`
span.labels-list a.label {
&.ui.ui.ui {
border-radius: 9999px;
padding: 1.5px 6px;
${labelStyle}
line-height: 18px;
&.mini {
line-height: 16px;
}
// 多个标签的组合标签的圆角修复
&.scope-parent {
.scope-left {
@@ -103,7 +114,6 @@ export const shaLabel = css`
background-color: ${themeVars.color.label.hoverBg} !important;
}
span.ui.label.commit-is-signed {
padding: 3px 5px;
margin-left: 5px;
height: 25px;
}
@@ -118,6 +128,7 @@ export const shaLabel = css`
}
// 验证提交附带的图标
span.ui.label.commit-is-signed {
height: 25px;
// 验证信任
&.sign-trusted {
border: 1.5px solid ${themeVars.color.green.badge.self} !important;
@@ -151,6 +162,11 @@ export const shaLabel = css`
}
}
}
span.ui.label.commit-is-signed,
.ui.label.commit-id-short,
.ui.label.commit-sign-badge {
font-size: 12px;
}
`;
// 任务状态标签, 目前仅在管理员页面 Runner 状态中看到
@@ -194,10 +210,6 @@ export const repoLabel = css`
color: ${themeVars.color.text.light.num1};
font-size: 12px;
font-weight: 500;
padding: 1.5px 6px;
}
}
.org-visibility span.ui.basic.label {
font-size: 14px;
}
`;

View File

@@ -1,4 +1,5 @@
import { css, otherThemeVars, themeVars } from "src/types/vars";
import { labelStyle } from "./label";
export const activeItemAfterStyle = {
backgroundColor: themeVars.github.borderColor.accent.emphasis,
@@ -140,8 +141,8 @@ export const menu = css`
}
}
// 菜单标签样式
.ui.menu .item>.label:not(.floating) {
padding: 1.5px 6px;
.ui.menu .item > .label:not(.floating) {
${labelStyle}
}
`;

8
styles/public/table.ts Normal file
View File

@@ -0,0 +1,8 @@
import { css, themeVars } from "src/types/vars";
export const table = css`
.ui.table > tr > td,
.ui.table > tbody > tr > td {
border-top: 1px solid ${themeVars.color.secondary.alpha.num70};
}
`;

View File

@@ -0,0 +1,167 @@
<nav id="navbar" aria-label="{{ctx.Locale.Tr "aria.navbar"}}">
<div class="navbar-left">
<!-- the logo -->
<a class="item" id="navbar-logo" href="{{AppSubUrl}}/" aria-label="{{if .IsSigned}}{{ctx.Locale.Tr "dashboard"}}{{else}}{{ctx.Locale.Tr "home"}}{{end}}">
<img width="30" height="30" src="{{AssetUrlPrefix}}/img/logo.svg" alt="{{ctx.Locale.Tr "logo"}}" aria-hidden="true">
</a>
<!-- mobile right menu, it must be here because in mobile view, each item is a flex column, the first item is a full row column -->
<div class="ui secondary menu navbar-mobile-right only-mobile">
{{template "base/head_navbar_icons" dict "PageGlobalData" .PageGlobalData}}
<button class="item ui icon mini button tw-m-0" id="navbar-expand-toggle" aria-label="{{ctx.Locale.Tr "home.nav_menu"}}">{{svg "octicon-three-bars"}}</button>
</div>
<!-- navbar links non-mobile -->
{{if and .IsSigned .MustChangePassword}}
{{/* No links */}}
{{else if .IsSigned}}
{{if not (and ctx.Consts.RepoUnitTypeIssues.UnitGlobalDisabled ctx.Consts.RepoUnitTypePullRequests.UnitGlobalDisabled)}}
{{if .ShowMilestonesDashboardPage}}
<a class="item{{if .PageIsMilestonesDashboard}} active{{end}}" href="{{AppSubUrl}}/milestones">{{ctx.Locale.Tr "milestones"}}</a>
{{end}}
{{end}}
<a class="item{{if .PageIsExplore}} active{{end}}" href="{{AppSubUrl}}/explore/repos">{{ctx.Locale.Tr "explore"}}</a>
{{else if .IsLandingPageOrganizations}}
<a class="item{{if .PageIsExplore}} active{{end}}" href="{{AppSubUrl}}/explore/organizations">{{ctx.Locale.Tr "explore"}}</a>
{{else}}
<a class="item{{if .PageIsExplore}} active{{end}}" href="{{AppSubUrl}}/explore/repos">{{ctx.Locale.Tr "explore"}}</a>
{{end}}
{{template "custom/extra_links" .}}
{{if not .IsSigned}}
<a class="item" target="_blank" rel="noopener noreferrer" href="https://docs.gitea.com">{{ctx.Locale.Tr "help"}}</a>
{{end}}
</div>
<!-- the full dropdown menus -->
<div class="navbar-right">
{{if and .IsSigned .MustChangePassword}}
<div class="ui dropdown jump item" data-tooltip-content="{{ctx.Locale.Tr "user_profile_and_more"}}">
<span class="text">
{{ctx.AvatarUtils.Avatar .SignedUser 24 "tw-mr-1"}}
<span class="only-mobile">{{.SignedUser.Name}}</span>
<span class="not-mobile">{{svg "octicon-triangle-down"}}</span>
</span>
<div class="menu user-menu">
<div class="header">
{{ctx.Locale.Tr "signed_in_as"}} <strong>{{.SignedUser.Name}}</strong>
</div>
<div class="divider"></div>
<a class="item link-action" href data-url="{{AppSubUrl}}/user/logout">
{{svg "octicon-sign-out"}}
{{ctx.Locale.Tr "sign_out"}}
</a>
</div><!-- end content avatar menu -->
</div><!-- end dropdown avatar menu -->
{{else if .IsSigned}}
<div class="ui dropdown jump item" data-tooltip-content="{{ctx.Locale.Tr "create_new"}}">
<span class="text">
{{svg "octicon-plus"}}
<span class="not-mobile">{{svg "octicon-triangle-down"}}</span>
<span class="only-mobile">{{ctx.Locale.Tr "create_new"}}</span>
</span>
<div class="menu">
<a class="item" href="{{AppSubUrl}}/repo/create">
{{svg "octicon-plus"}} {{ctx.Locale.Tr "new_repo"}}
</a>
{{if not .DisableMigrations}}
<a class="item" href="{{AppSubUrl}}/repo/migrate">
{{svg "octicon-repo-push"}} {{ctx.Locale.Tr "new_migrate"}}
</a>
{{end}}
{{if .SignedUser.CanCreateOrganization}}
<a class="item" href="{{AppSubUrl}}/org/create">
{{svg "octicon-organization"}} {{ctx.Locale.Tr "new_org"}}
</a>
{{end}}
</div><!-- end content create new menu -->
</div><!-- end dropdown menu create new -->
{{template "base/head_navbar_icons" dict "ItemExtraClass" "not-mobile" "PageGlobalData" .PageGlobalData}}
<div class="ui dropdown jump item" data-tooltip-content="{{ctx.Locale.Tr "user_profile_and_more"}}">
<span class="text">
{{ctx.AvatarUtils.Avatar .SignedUser 24 "tw-mr-1"}}
<span class="only-mobile">{{.SignedUser.Name}}</span>
<span class="not-mobile">{{svg "octicon-triangle-down"}}</span>
</span>
<div class="menu user-menu">
<div class="header">
{{ctx.Locale.Tr "signed_in_as"}} <strong>{{.SignedUser.Name}}</strong>
</div>
<div class="divider"></div>
<a class="item" href="{{.SignedUser.HomeLink}}">
{{svg "octicon-person"}}
{{ctx.Locale.Tr "your_profile"}}
</a>
{{if not .DisableStars}}
<a class="item" href="{{.SignedUser.HomeLink}}?tab=stars">
{{svg "octicon-star"}}
{{ctx.Locale.Tr "your_starred"}}
</a>
{{end}}
<a class="item" href="{{AppSubUrl}}/notifications/subscriptions">
{{svg "octicon-bell"}}
{{ctx.Locale.Tr "notification.subscriptions"}}
</a>
<a class="{{if .PageIsUserSettings}}active {{end}}item" href="{{AppSubUrl}}/user/settings">
{{svg "octicon-tools"}}
{{ctx.Locale.Tr "your_settings"}}
</a>
<a class="item" target="_blank" rel="noopener noreferrer" href="https://docs.gitea.com">
{{svg "octicon-question"}}
{{ctx.Locale.Tr "help"}}
</a>
<div class="divider"></div>
<a class="item link-action" href data-url="{{AppSubUrl}}/user/logout">
{{svg "octicon-sign-out"}}
{{ctx.Locale.Tr "sign_out"}}
</a>
</div><!-- end content avatar menu -->
</div><!-- end dropdown avatar menu -->
{{else}}
{{if .ShowRegistrationButton}}
<a class="item{{if .PageIsSignUp}} active{{end}}" href="{{AppSubUrl}}/user/sign_up">
{{svg "octicon-person"}}
<span class="tw-ml-1">{{ctx.Locale.Tr "register"}}</span>
</a>
{{end}}
<a class="item{{if .PageIsSignIn}} active{{end}}" rel="nofollow" href="{{AppSubUrl}}/user/login{{if not .PageIsSignIn}}?redirect_to={{.CurrentURL}}{{end}}">
{{svg "octicon-sign-in"}}
<span class="tw-ml-1">{{ctx.Locale.Tr "sign_in"}}</span>
</a>
{{end}}
</div><!-- end full right menu -->
{{$activeStopwatch := and .PageGlobalData (call .PageGlobalData.GetActiveStopwatch)}}
{{if $activeStopwatch}}
<div class="active-stopwatch-popup tippy-target">
<div class="tw-flex tw-items-center tw-gap-2 tw-p-3">
<a class="stopwatch-link tw-flex tw-items-center tw-gap-2 muted" href="{{$activeStopwatch.IssueLink}}">
{{svg "octicon-issue-opened" 16}}
<span class="stopwatch-issue">{{$activeStopwatch.RepoSlug}}#{{$activeStopwatch.IssueIndex}}</span>
</a>
<div class="tw-flex tw-gap-1">
<form class="stopwatch-commit form-fetch-action" method="post" action="{{$activeStopwatch.IssueLink}}/times/stopwatch/stop">
{{.CsrfTokenHtml}}
<button
type="submit"
class="ui button mini compact basic icon tw-mr-0"
data-tooltip-content="{{ctx.Locale.Tr "repo.issues.stop_tracking"}}"
>{{svg "octicon-square-fill"}}</button>
</form>
<form class="stopwatch-cancel form-fetch-action" method="post" action="{{$activeStopwatch.IssueLink}}/times/stopwatch/cancel">
{{.CsrfTokenHtml}}
<button
type="submit"
class="ui button mini compact basic icon tw-mr-0"
data-tooltip-content="{{ctx.Locale.Tr "repo.issues.cancel_tracking"}}"
>{{svg "octicon-trash"}}</button>
</form>
</div>
</div>
</div>
{{end}}
</nav>

View File

@@ -0,0 +1,35 @@
{{- $itemExtraClass := .ItemExtraClass -}}
{{- $data := .PageGlobalData -}}
{{if and $data $data.IsSigned}}{{/* data may not exist, for example: rendering 503 page before the PageGlobalData middleware */}}
{{- $activeStopwatch := call $data.GetActiveStopwatch -}}
{{- $notificationUnreadCount := call $data.GetNotificationUnreadCount -}}
{{if $activeStopwatch}}
<a class="item active-stopwatch {{$itemExtraClass}}" href="{{$activeStopwatch.IssueLink}}" title="{{ctx.Locale.Tr "active_stopwatch"}}" data-seconds="{{$activeStopwatch.Seconds}}">
<div class="tw-relative">
{{svg "octicon-stopwatch"}}
<span class="header-stopwatch-dot"></span>
</div>
</a>
{{end}}
{{if not ctx.Consts.RepoUnitTypeIssues.UnitGlobalDisabled}}
<a class="item {{$itemExtraClass}}" href="{{AppSubUrl}}/issues" data-tooltip-content="{{ctx.Locale.Tr "issues"}}">
{{svg "octicon-issue-opened"}}
</a>
{{end}}
{{if not ctx.Consts.RepoUnitTypePullRequests.UnitGlobalDisabled}}
<a class="item {{$itemExtraClass}}" href="{{AppSubUrl}}/pulls" data-tooltip-content="{{ctx.Locale.Tr "pull_requests"}}">
{{svg "octicon-git-pull-request"}}
</a>
{{end}}
<a class="item {{$itemExtraClass}}" href="{{AppSubUrl}}/notifications" data-tooltip-content="{{ctx.Locale.Tr "notifications"}}">
<div class="tw-relative tw-h-[16px]">
{{svg "octicon-inbox"}}
<span class="notification_count{{if not $notificationUnreadCount}} tw-hidden{{end}}">{{$notificationUnreadCount}}</span>
</div>
</a>
{{if $data.IsSiteAdmin}}
<a class="item {{$itemExtraClass}}" href="{{AppSubUrl}}/-/admin" data-tooltip-content="{{ctx.Locale.Tr "admin_panel"}}">
{{svg "octicon-server"}}
</a>
{{end}}
{{end}}