diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2023-09-04 21:38:59 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-04 13:38:59 +0000 |
commit | 682552378f974f2ca2373951fbc86512bfb32ead (patch) | |
tree | b79f93ab2e2dcb5f7fbd73d3bdf564083b6574bd | |
parent | c17fd68be7334368d54d3c16c3720e1f92376479 (diff) | |
download | gitea-682552378f974f2ca2373951fbc86512bfb32ead.tar.gz gitea-682552378f974f2ca2373951fbc86512bfb32ead.zip |
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.
-rw-r--r-- | templates/repo/commit_page.tmpl | 2 | ||||
-rw-r--r-- | templates/repo/commits_list.tmpl | 2 | ||||
-rw-r--r-- | web_src/css/repo.css | 5 |
3 files changed, 5 insertions, 4 deletions
diff --git a/templates/repo/commit_page.tmpl b/templates/repo/commit_page.tmpl index 06b8f1ba15..612c0f94ca 100644 --- a/templates/repo/commit_page.tmpl +++ b/templates/repo/commit_page.tmpl @@ -135,7 +135,7 @@ {{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> diff --git a/templates/repo/commits_list.tmpl b/templates/repo/commits_list.tmpl index b9d0e61713..a06c425b73 100644 --- a/templates/repo/commits_list.tmpl +++ b/templates/repo/commits_list.tmpl @@ -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}} diff --git a/web_src/css/repo.css b/web_src/css/repo.css index 242682593e..fb85a53ab7 100644 --- a/web_src/css/repo.css +++ b/web_src/css/repo.css @@ -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 { |