]> source.dussan.org Git - gitea.git/commitdiff
More fixes for the "commit-body" (#26898) 26050/head
authorwxiaoguang <wxiaoguang@gmail.com>
Mon, 4 Sep 2023 13:38:59 +0000 (21:38 +0800)
committerGitHub <noreply@github.com>
Mon, 4 Sep 2023 13:38:59 +0000 (13:38 +0000)
The changes for "commit-body" in #26877 are not ideal.

The reason is: the "commit-body" is usually a `<pre>`, it has default
margins. In most cases, we do not need that large margin. So, this PR
introduces a general but small margin for all "commit-body" elements.
Then these `gt-m-0` could be removed.

The `:not` selector is not needed, because the `.timeline-item` selector
is already clear enough.

templates/repo/commit_page.tmpl
templates/repo/commits_list.tmpl
web_src/css/repo.css

index 06b8f1ba155ed1e35b9a21a24f7d0dc057ca2c37..612c0f94cab6067d8aa690958a6ef2811f52c5a2 100644 (file)
                                {{end}}
                        </div>
                        {{if IsMultilineCommitMessage .Commit.Message}}
-                               <pre class="commit-body gt-mt-0">{{RenderCommitBody $.Context .Commit.Message $.RepoLink $.Repository.ComposeMetas}}</pre>
+                               <pre class="commit-body">{{RenderCommitBody $.Context .Commit.Message $.RepoLink $.Repository.ComposeMetas}}</pre>
                        {{end}}
                        {{template "repo/commit_load_branches_and_tags" .}}
                </div>
index b9d0e617134eff5bff398af6796f8eea0a7b0ef5..a06c425b73dff9bd58fa967082523f039bdf9703 100644 (file)
@@ -68,7 +68,7 @@
                                                        {{end}}
                                                        {{template "repo/commit_statuses" dict "Status" .Status "Statuses" .Statuses "root" $}}
                                                        {{if IsMultilineCommitMessage .Message}}
-                                                       <pre class="commit-body gt-m-0 gt-hidden">{{RenderCommitBody $.Context .Message $commitRepoLink $.Repository.ComposeMetas}}</pre>
+                                                       <pre class="commit-body gt-hidden">{{RenderCommitBody $.Context .Message $commitRepoLink $.Repository.ComposeMetas}}</pre>
                                                        {{end}}
                                                </td>
                                                {{if .Committer}}
index 242682593e4e2a6cb5b8d809fb88c98c43ca2f2a..fb85a53ab7d42f902690d6d9802d40ffd7aa8dcd 100644 (file)
@@ -2620,13 +2620,14 @@ tbody.commit-list {
 }
 
 .commit-body {
+  margin: 0.25em 0;
   white-space: pre-wrap;
   line-height: initial;
 }
 
 /* PR-comment */
-.repository:not(.diff) .timeline-item .commit-body {
-  margin-left: 40px;
+.repository .timeline-item .commit-body {
+  margin-left: 45px;
 }
 
 .git-notes.top {