Skip to content

Commit 5331af1

Browse files
authored
Backport various styling fixes (#11619)
* Fix inconsistent font size for markdown preview on new PR view (#11565) We use same method for new issue form and issue view, but was missing from new PR view making it one place where markdown preview is inconsistent in font size. (cherry picked from commit 04afd9d) * Fix margin on PR form (#11566) (cherry picked from commit f2a0be1) * Fix margin for attached top header on code review (#11571) Introduced naively by #11463 The margin was being applied too widely. (cherry picked from commit e682a92) * Fix styling for PR merge section when no checks (#11609) Makes styling consistent between two cases. Also removed unnecessary double border. * Normalize avatar radius
1 parent eb5ea5f commit 5331af1

File tree

5 files changed

+33
-5
lines changed

5 files changed

+33
-5
lines changed

integrations/pull_merge_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ func TestCantMergeWorkInProgress(t *testing.T) {
194194
req := NewRequest(t, "GET", resp.Header().Get("Location"))
195195
resp = session.MakeRequest(t, req, http.StatusOK)
196196
htmlDoc := NewHTMLParser(t, resp.Body)
197-
text := strings.TrimSpace(htmlDoc.doc.Find(".attached.header > .text.grey").Last().Text())
197+
text := strings.TrimSpace(htmlDoc.doc.Find(".attached.merge-section.no-header > .text.grey").Last().Text())
198198
assert.NotEmpty(t, text, "Can't find WIP text")
199199

200200
// remove <strong /> from lang

templates/repo/issue/view_content/pull.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
{{- else}}red{{end}}">{{svg "octicon-git-merge" 32}}</a>
7676
<div class="content">
7777
{{template "repo/pulls/status" .}}
78-
<div class="ui {{if not $.LatestCommitStatus}}top attached header{{else}}attached merge-section segment{{end}}">
78+
<div class="ui attached merge-section segment {{if not $.LatestCommitStatus}}no-header{{end}}">
7979
{{if .Issue.PullRequest.HasMerged}}
8080
<div class="item text purple">
8181
{{if .Issue.PullRequest.MergedCommitID}}

web_src/less/_base.less

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,12 @@ code,
576576
font-weight: normal;
577577
}
578578

579-
.avatar.image {
579+
.avatar.image,
580+
.avatar.image img,
581+
.avatar.image svg,
582+
.avatar.images .image,
583+
.avatar.images img,
584+
.avatar.images svg {
580585
border-radius: 3px;
581586
}
582587

web_src/less/_repository.less

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -898,8 +898,20 @@
898898
}
899899

900900
> .merge-section {
901-
border-top: 1px solid #d4d4d5;
902901
background-color: #f7f7f7;
902+
903+
.item + .item {
904+
padding-top: .5rem;
905+
}
906+
907+
.divider {
908+
margin-left: -1rem;
909+
margin-right: -1rem;
910+
}
911+
912+
&.no-header {
913+
#avatar-arrow;
914+
}
903915
}
904916

905917
.markdown {
@@ -1234,6 +1246,14 @@
12341246
}
12351247
}
12361248
}
1249+
1250+
.pullrequest-form {
1251+
margin-bottom: 1.5rem;
1252+
}
1253+
1254+
.markdown {
1255+
font-size: 14px;
1256+
}
12371257
}
12381258

12391259
.filter.dropdown .menu {

web_src/less/_review.less

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,11 @@
1919

2020
.add-comment-left.add-comment-right .ui.attached.header {
2121
border: 1px solid #d4d4d5;
22-
margin-bottom: .5em;
2322
margin-top: .5em;
23+
24+
&:not(.top) {
25+
margin-bottom: .5em;
26+
}
2427
}
2528

2629
.focus-lines-new .ui.button.add-code-comment.add-code-comment-right,

0 commit comments

Comments
 (0)