Skip to content

Commit 2a95d85

Browse files
committed
fix commit sign badge style
1 parent e2838df commit 2a95d85

3 files changed

Lines changed: 30 additions & 30 deletions

File tree

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,35 @@
11
import { css, otherThemeVars, themeVars } from "src/types/vars";
22

33
export const commitSignBadge = css`
4-
.github-theme-sha {
5-
border-radius: ${otherThemeVars.border.radius};
6-
font-family:
7-
-apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji",
8-
"Segoe UI Emoji";
9-
font-weight: 500;
10-
padding: 0px 8px;
4+
a.ui.label.commit-id-short.github-theme-commit-sha {
5+
gap: 8px;
6+
padding: unset;
7+
margin: unset;
118
height: 26px;
12-
min-width: 85px; // 非等宽字体导致不对齐, 目前看到最大长度为 83px
13-
display: flex;
14-
align-items: center;
15-
justify-content: center;
16-
&:hover {
17-
background-color: ${themeVars.color.hover.self};
9+
margin: 0 4px;
10+
&.commit-is-signed {
11+
&:hover {
12+
background-color: unset !important;
13+
}
14+
span.ui.label.commit-sign-badge.commit-is-signed {
15+
margin: unset;
16+
}
17+
}
18+
.github-theme-sha {
19+
border-radius: ${otherThemeVars.border.radius};
20+
font-family:
21+
-apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji",
22+
"Segoe UI Emoji";
23+
font-weight: 500;
24+
padding: 0px 8px;
25+
height: 26px;
26+
min-width: 85px; // 非等宽字体导致不对齐, 目前看到最大长度为 83px
27+
display: flex;
28+
align-items: center;
29+
justify-content: center;
30+
&:hover {
31+
background-color: ${themeVars.color.hover.self};
32+
}
1833
}
1934
}
2035
`;

styles/templates/repo/commits_list.ts

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { css, themeVars, otherThemeVars } from "src/types/vars";
1+
import { css, otherThemeVars, themeVars } from "src/types/vars";
22

33
const primary = "primary" as const;
44
const secondary = "secondary" as const;
@@ -81,21 +81,6 @@ export const commitsList = css`
8181
border-radius: 9999px;
8282
height: 25px;
8383
}
84-
.commit-id-short {
85-
gap: 8px;
86-
padding: unset;
87-
margin: unset;
88-
height: 28px;
89-
margin: 0 4px;
90-
&.commit-is-signed {
91-
&:hover {
92-
background-color: unset !important;
93-
}
94-
span.ui.label.commit-sign-badge.commit-is-signed {
95-
margin: unset;
96-
}
97-
}
98-
}
9984
}
10085
.actions {
10186
grid-area: ${actions};

templates/repo/commit_sign_badge.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ so this template should be kept as small as possible, DO NOT put large component
5656
{{- end -}}
5757

5858
{{- if $commit -}}
59-
<a {{if $commitBaseLink}}href="{{$commitBaseLink}}/{{$commit.ID}}"{{end}} class="ui label commit-id-short {{$extraClass}}" rel="nofollow">
59+
<a {{if $commitBaseLink}}href="{{$commitBaseLink}}/{{$commit.ID}}"{{end}} class="ui label commit-id-short {{$extraClass}} github-theme-commit-sha" rel="nofollow">
6060
{{- end -}}
6161
{{- if or (not $commit) $extraClass}}{{/* only show the lock icon if there is no commit info (icon only) or the commit is really signed */}}
6262
<span class="ui label commit-sign-badge {{$extraClass}}">

0 commit comments

Comments
 (0)