]> source.dussan.org Git - gitea.git/commitdiff
Improve diff stats bar (#30669)
authorsilverwind <me@silverwind.io>
Sat, 27 Apr 2024 11:22:55 +0000 (13:22 +0200)
committerGitHub <noreply@github.com>
Sat, 27 Apr 2024 11:22:55 +0000 (11:22 +0000)
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">

templates/repo/pulls/tab_menu.tmpl
web_src/css/repo.css

index a6d058f1607c3bbab7df7d7dcb4c3e04da654489..d5a8d6ed21a6b7f961dd861a0d831518e38f5dfc 100644 (file)
@@ -16,7 +16,7 @@
                        <span class="ui small label">{{if .NumFiles}}{{.NumFiles}}{{else}}-{{end}}</span>
                </a>
                {{if or .Diff.TotalAddition .Diff.TotalDeletion}}
-               <span class="item tw-ml-auto tw-pr-0 tw-font-bold tw-flex tw-items-center tw-gap-2">
+               <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">
                        <span><span class="text green">{{if .Diff.TotalAddition}}+{{.Diff.TotalAddition}}{{end}}</span> <span class="text red">{{if .Diff.TotalDeletion}}-{{.Diff.TotalDeletion}}{{end}}</span></span>
                        <span class="diff-stats-bar">
                                <div class="diff-stats-add-bar" style="width: {{Eval 100 "*" .Diff.TotalAddition "/" "(" .Diff.TotalAddition "+" .Diff.TotalDeletion "+" 0.0 ")"}}%"></div>
index 4de994112f1457b1cb8dd05e1269dbbdd3365a4e..dacb98ddb828861109968c63cda2531b04b3d21e 100644 (file)
@@ -2520,7 +2520,7 @@ tbody.commit-list {
   display: inline-block;
   background-color: var(--color-red);
   height: 12px;
-  width: 40px;
+  width: 44px;
 }
 
 .diff-stats-bar .diff-stats-add-bar {