Skip to content

Commit 39f8ab5

Browse files
silverwinddelvh
andauthored
Clean up diff header css and reduce global textarea min-height (#29232)
1. Tweak diff header and remove a numbe of unneeded CSS for it: Before: <img width="433" alt="Screenshot 2024-02-18 at 01 08 09" src="https://github.com/go-gitea/gitea/assets/115237/d8b377c0-57bc-44d5-bb57-a582c7d4b3b4"> After: <img width="463" alt="Screenshot 2024-02-18 at 01 07 56" src="https://github.com/go-gitea/gitea/assets/115237/d08c17e7-5b86-4d07-81da-6371f4754325"> 3. Reduce height of review textarea and also reduce fomantic's CSS from 12em to 8em. Now fits better on my screen: <img width="1352" alt="image" src="https://github.com/go-gitea/gitea/assets/115237/5c658d13-295e-4929-94da-13ade888020d"> --------- Co-authored-by: delvh <[email protected]>
1 parent 68e1d17 commit 39f8ab5

File tree

5 files changed

+11
-22
lines changed

5 files changed

+11
-22
lines changed

templates/repo/commit_page.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@
184184
</div>
185185
</div>
186186
{{if .Commit.Signature}}
187-
<div class="ui bottom attached message gt-text-left gt-df gt-ac gt-sb commit-header-row gt-fw {{$class}}">
187+
<div class="ui bottom attached message gt-text-left gt-df gt-ac gt-sb commit-header-row gt-fw gt-mb-0 {{$class}}">
188188
<div class="gt-df gt-ac">
189189
{{if .Verification.Verified}}
190190
{{if ne .Verification.SigningUser.ID 0}}

templates/repo/diff/box.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{{$showFileTree := (and (not .DiffNotAvailable) (gt .Diff.NumFiles 1))}}
22
<div>
33
<div class="diff-detail-box diff-box">
4-
<div class="gt-df gt-ac gt-fw">
4+
<div class="gt-df gt-ac gt-fw gt-gap-3 gt-ml-1">
55
{{if $showFileTree}}
66
<button class="diff-toggle-file-tree-button not-mobile btn interact-fg" data-show-text="{{ctx.Locale.Tr "repo.diff.show_file_tree"}}" data-hide-text="{{ctx.Locale.Tr "repo.diff.hide_file_tree"}}">
77
{{/* the icon meaning is reversed here, "octicon-sidebar-collapse" means show the file tree */}}

web_src/css/base.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
--border-radius-circle: 50%;
2222
--opacity-disabled: 0.55;
2323
--height-loading: 16rem;
24+
--min-height-textarea: 132px; /* padding + 6 lines + border = calc(1.57142em + 6lh + 2px), but lh is not fully supported */
2425
--tab-size: 4;
2526
}
2627

@@ -492,6 +493,11 @@ ol.ui.list li,
492493
background: var(--color-active) !important;
493494
}
494495

496+
.ui.form textarea:not([rows]) {
497+
height: var(--min-height-textarea); /* override fomantic default 12em */
498+
min-height: var(--min-height-textarea); /* override fomantic default 8em */
499+
}
500+
495501
/* styles from removed fomantic transition module */
496502
.hidden.transition {
497503
visibility: hidden;

web_src/css/editor/combomarkdowneditor.css

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,12 @@
3737
.combo-markdown-editor textarea.markdown-text-editor {
3838
display: block;
3939
width: 100%;
40-
min-height: 200px;
41-
max-height: calc(100vh - 200px);
40+
max-height: calc(100vh - var(--min-height-textarea));
4241
resize: vertical;
4342
}
4443

4544
.combo-markdown-editor .CodeMirror-scroll {
46-
max-height: calc(100vh - 200px);
45+
max-height: calc(100vh - var(--min-height-textarea));
4746
}
4847

4948
/* use the same styles as markup/content.css */

web_src/css/repo.css

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1498,12 +1498,6 @@
14981498
background: var(--color-body);
14991499
}
15001500

1501-
@media (max-width: 991.98px) {
1502-
.repository .diff-detail-box {
1503-
flex-direction: row;
1504-
}
1505-
}
1506-
15071501
@media (max-width: 480px) {
15081502
.repository .diff-detail-box {
15091503
flex-wrap: wrap;
@@ -1528,7 +1522,7 @@
15281522
color: var(--color-red);
15291523
}
15301524

1531-
@media (max-width: 991.98px) {
1525+
@media (max-width: 800px) {
15321526
.repository .diff-detail-box .diff-detail-stats {
15331527
display: none !important;
15341528
}
@@ -1538,7 +1532,6 @@
15381532
display: flex;
15391533
align-items: center;
15401534
gap: 0.25em;
1541-
flex-wrap: wrap;
15421535
justify-content: end;
15431536
}
15441537

@@ -1548,15 +1541,6 @@
15481541
margin-right: 0 !important;
15491542
}
15501543

1551-
@media (max-width: 480px) {
1552-
.repository .diff-detail-box .diff-detail-actions {
1553-
padding-top: 0.25rem;
1554-
}
1555-
.repository .diff-detail-box .diff-detail-actions .ui.button:not(.btn-submit) {
1556-
padding: 0 0.5rem;
1557-
}
1558-
}
1559-
15601544
.repository .diff-detail-box span.status {
15611545
display: inline-block;
15621546
width: 12px;

0 commit comments

Comments
 (0)