Skip to content

Commit 6825523

Browse files
authored
More fixes for the "commit-body" (#26898)
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.
1 parent c17fd68 commit 6825523

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

templates/repo/commit_page.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
{{end}}
136136
</div>
137137
{{if IsMultilineCommitMessage .Commit.Message}}
138-
<pre class="commit-body gt-mt-0">{{RenderCommitBody $.Context .Commit.Message $.RepoLink $.Repository.ComposeMetas}}</pre>
138+
<pre class="commit-body">{{RenderCommitBody $.Context .Commit.Message $.RepoLink $.Repository.ComposeMetas}}</pre>
139139
{{end}}
140140
{{template "repo/commit_load_branches_and_tags" .}}
141141
</div>

templates/repo/commits_list.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
{{end}}
6969
{{template "repo/commit_statuses" dict "Status" .Status "Statuses" .Statuses "root" $}}
7070
{{if IsMultilineCommitMessage .Message}}
71-
<pre class="commit-body gt-m-0 gt-hidden">{{RenderCommitBody $.Context .Message $commitRepoLink $.Repository.ComposeMetas}}</pre>
71+
<pre class="commit-body gt-hidden">{{RenderCommitBody $.Context .Message $commitRepoLink $.Repository.ComposeMetas}}</pre>
7272
{{end}}
7373
</td>
7474
{{if .Committer}}

web_src/css/repo.css

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2620,13 +2620,14 @@ tbody.commit-list {
26202620
}
26212621

26222622
.commit-body {
2623+
margin: 0.25em 0;
26232624
white-space: pre-wrap;
26242625
line-height: initial;
26252626
}
26262627

26272628
/* PR-comment */
2628-
.repository:not(.diff) .timeline-item .commit-body {
2629-
margin-left: 40px;
2629+
.repository .timeline-item .commit-body {
2630+
margin-left: 45px;
26302631
}
26312632

26322633
.git-notes.top {

0 commit comments

Comments
 (0)