Skip to content

Commit b2abac5

Browse files
authored
Improve diff stats bar (#30669)
Minor tweaks: - Remove unnecessary `item` class which was causing unwanted padding to be added. - Add some padding and prevent wrapping so it looks better on mobile. - Increase width by 4px. <img width="116" alt="Screenshot 2024-04-24 at 00 15 07" src="https://github.com/go-gitea/gitea/assets/115237/1f1cf54c-8053-4297-b309-71d9c2ceb9ee"> <img width="441" alt="Screenshot 2024-04-24 at 00 14 57" src="https://github.com/go-gitea/gitea/assets/115237/2f3a33dc-edad-4b97-b64c-6812aae513cb">
1 parent 4ae6b1a commit b2abac5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

templates/repo/pulls/tab_menu.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<span class="ui small label">{{if .NumFiles}}{{.NumFiles}}{{else}}-{{end}}</span>
1717
</a>
1818
{{if or .Diff.TotalAddition .Diff.TotalDeletion}}
19-
<span class="item tw-ml-auto tw-pr-0 tw-font-bold tw-flex tw-items-center tw-gap-2">
19+
<span class="tw-ml-auto tw-pl-3 tw-whitespace-nowrap tw-pr-0 tw-font-bold tw-flex tw-items-center tw-gap-2">
2020
<span><span class="text green">{{if .Diff.TotalAddition}}+{{.Diff.TotalAddition}}{{end}}</span> <span class="text red">{{if .Diff.TotalDeletion}}-{{.Diff.TotalDeletion}}{{end}}</span></span>
2121
<span class="diff-stats-bar">
2222
<div class="diff-stats-add-bar" style="width: {{Eval 100 "*" .Diff.TotalAddition "/" "(" .Diff.TotalAddition "+" .Diff.TotalDeletion "+" 0.0 ")"}}%"></div>

web_src/css/repo.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2520,7 +2520,7 @@ tbody.commit-list {
25202520
display: inline-block;
25212521
background-color: var(--color-red);
25222522
height: 12px;
2523-
width: 40px;
2523+
width: 44px;
25242524
}
25252525

25262526
.diff-stats-bar .diff-stats-add-bar {

0 commit comments

Comments
 (0)