Skip to content

Commit 86e488a

Browse files
committed
fix issue/pr element styles
1 parent b3cc3ab commit 86e488a

6 files changed

Lines changed: 79 additions & 17 deletions

File tree

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
tar -zcf dist/theme-github-extra-pink.tar.gz --remove-files \
3030
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
3131
32-
tar -zcf dist/theme-github-templates.tar.gz templates
32+
tar -zcf dist/theme-github-templates.tar.gz templates options
3333
TAG="v$(npm run -s version)"
3434
gh release create "$TAG" dist/* --notes-file CHANGELOG.md --draft -t $TAG
3535
env:

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
- Optimize the selection style of items in the menu.
66
- Optimize code block styles.
7+
- Optimize some element styles on Issue/PR page
78

89
##### Template File
910

@@ -15,3 +16,5 @@
1516

1617
- Fixed extra lines under heatmap.
1718
- Supplement the PR operation panel status style in PR.
19+
- Fixed avatar size for approving users in PR
20+
- Fixed bot label styles in Issue/PR

options/locale/locale_zh-CN.ini

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[github-theme]
2+
verifed=已验证
3+
partially_verifed=部分验证
4+
unverifed=未验证

styles/components/issue.ts

Lines changed: 51 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,11 @@ export const prBranch = css`
275275
}
276276
`;
277277

278+
const botLabelStyle = {
279+
height: "20px",
280+
padding: "0 6px!important",
281+
marginLeft: "4px",
282+
};
278283
// 评论
279284
export const comment = css`
280285
.comment .comment-container {
@@ -299,6 +304,26 @@ export const comment = css`
299304
.comment-header {
300305
padding: 4px 4px 4px 16px;
301306
min-height: 38px;
307+
.comment-header-left {
308+
// bot 标签
309+
.ui.basic.label {
310+
${botLabelStyle}
311+
}
312+
a:has(relative-time){
313+
text-decoration: underline;
314+
}
315+
// 已编辑按钮
316+
.content-history-menu {
317+
color: ${themeVars.color.text.light.num1} !important;
318+
.menu .item {
319+
font-size: 12px;
320+
.ui.avatar {
321+
height: 20px;
322+
width: 20px;
323+
}
324+
}
325+
}
326+
}
302327
}
303328
.comment-header-right {
304329
> .item,
@@ -311,12 +336,6 @@ export const comment = css`
311336
height: 20px;
312337
padding: 0 6px;
313338
}
314-
// 隐藏顶部菜单的表情按钮
315-
// 无法使用此样式, 评论无表情时底部的表情按钮元素不会渲染, 这是一个先有鸡还是先有蛋的问题
316-
// 很蛋疼, 希望 Gitea 早日使用 Github 的样式, 因为 Github 的更合理, 无论是操作的方便程度还是按钮的冗余度
317-
// .ui.dropdown.action.select-reaction {
318-
// display: none;
319-
// }
320339
.context-dropdown {
321340
height: 28px;
322341
padding: 0 6px;
@@ -526,11 +545,9 @@ export const prMerge = css`
526545
padding: 16px;
527546
display: grid;
528547
gap: 8px;
529-
&.no-header {
530-
&::before,
531-
&::after {
532-
display: none;
533-
}
548+
&::before,
549+
&::after {
550+
display: none;
534551
}
535552
}
536553
}
@@ -555,10 +572,20 @@ export const timeline = css`
555572
&.event {
556573
// 修复覆盖后的位置问题
557574
padding-left: 15px;
558-
.avatar {
575+
// 避免锚中批准的头像
576+
.avatar-with-link .avatar {
559577
width: 20px;
560578
height: 20px;
561579
}
580+
// 批准时间的头像
581+
// 头部居中偏移量(头像高度 - 标准行信息高度) / 2: (40px - 32px) / 2 = 4px
582+
.timeline-avatar {
583+
top: -4px;
584+
}
585+
// bot 标签
586+
.comment-text-line .ui.basic.label {
587+
${botLabelStyle}
588+
}
562589
.badge {
563590
border: 2px solid ${themeVars.color.body};
564591
}
@@ -659,6 +686,18 @@ export const issueSidebar = css`
659686
margin-top: 0 !important;
660687
margin-bottom: 0 !important;
661688
}
689+
// 评审人
690+
.ui.relaxed.list {
691+
.item {
692+
// 操作图标按钮
693+
a.muted.icon {
694+
color: ${themeVars.color.text.light.num1};
695+
&:hover {
696+
color: ${themeVars.color.primary.self};
697+
}
698+
}
699+
}
700+
}
662701
// 标签菜单项
663702
.ui.dropdown > .menu > .scrolling.menu > .item:has(.item-secondary-info) {
664703
// 修复标签菜单中描述文本过长没有换行挤掉标签的问题

styles/public/label.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ export const shaLabel = css`
129129
// 验证提交附带的图标
130130
span.ui.label.commit-is-signed {
131131
height: 25px;
132-
min-width: 50px;
132+
min-width: 35px;
133133
justify-content: center;
134134
// 验证信任
135135
&.sign-trusted {

templates/repo/commit_sign_badge.tmpl

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,21 +55,37 @@ so this template should be kept as small as possible, DO NOT put large component
5555
{{- end -}}
5656
{{- end -}}
5757

58+
{{- $github_verifed := "github-theme.verifed" -}}
59+
{{- $ctx_github_verifed := ctx.Locale.Tr $github_verifed -}}
60+
{{- $github_partially_verifed := "github-theme.partially_verifed" -}}
61+
{{- $ctx_github_partially_verifed := ctx.Locale.Tr $github_partially_verifed -}}
62+
{{- $github_unverifed := "github-theme.unverifed" -}}
63+
{{- $ctx_github_unverifed := ctx.Locale.Tr $github_unverifed -}}
64+
5865
{{- if $commit -}}
5966
<a {{if $commitBaseLink}}href="{{$commitBaseLink}}/{{$commit.ID}}"{{end}} class="ui label commit-id-short {{$extraClass}} github-theme-commit-sha" rel="nofollow">
6067
{{- end -}}
6168
{{- if or (not $commit) $extraClass}}{{/* only show the lock icon if there is no commit info (icon only) or the commit is really signed */}}
6269
<span class="ui label commit-sign-badge github-theme-commit-sign-badge {{$extraClass}}">
6370
{{- if $verified -}}
6471
{{- if and $signingUser $signingUser.ID -}}
65-
<span data-tooltip-content="{{$msgReason}}">Verified</span>
72+
<span data-tooltip-content="{{$msgReason}}">
73+
{{if eq $ctx_github_verifed $github_verifed }}Verified
74+
{{else}}{{$ctx_github_verifed}}{{end}}
75+
</span>
6676
<span data-tooltip-content="{{$msgSigningKey}}">{{ctx.AvatarUtils.Avatar $signingUser 16}}</span>
6777
{{- else -}}
68-
<span data-tooltip-content="{{$msgReason}}">Partially verified</span>
78+
<span data-tooltip-content="{{$msgReason}}">
79+
{{if eq $ctx_github_partially_verifed $github_partially_verifed }}Partially verified
80+
{{else}}{{$ctx_github_partially_verifed}}{{end}}
81+
</span>
6982
<span data-tooltip-content="{{$msgSigningKey}}">{{ctx.AvatarUtils.AvatarByEmail $signingEmail "" 16}}</span>
7083
{{- end -}}
7184
{{- else -}}
72-
<span data-tooltip-content="{{$msgReason}}">Unverified</span>
85+
<span data-tooltip-content="{{$msgReason}}">
86+
{{if eq $ctx_github_unverifed $github_unverifed }}Unverified
87+
{{else}}{{$ctx_github_unverifed}}{{end}}
88+
</span>
7389
{{- end -}}
7490
</span>
7591
{{- end -}}

0 commit comments

Comments
 (0)