Skip to content

Commit 222b830

Browse files
silverwindGiteaBot
authored andcommitted
Fix line number widths (go-gitea#31341)
Fixes regression go-gitea#31307 (comment) Table CSS is weird. A `auto` value does not work and causes the regression while any pixel value causes another regression in diff where the code lines do not stretch. Partially revert that PR and clean up some related too-deep CSS selectors. <img width="109" alt="Screenshot 2024-06-12 at 15 07 22" src="https://github.com/go-gitea/gitea/assets/115237/756c5dea-44b8-49f9-8a08-acef68075f62"> <img width="119" alt="Screenshot 2024-06-12 at 15 07 43" src="https://github.com/go-gitea/gitea/assets/115237/28ae1adc-118e-4016-8d09-033b9f1c9a6f"> <img width="151" alt="Screenshot 2024-06-12 at 15 07 07" src="https://github.com/go-gitea/gitea/assets/115237/08db7ed9-de4e-405e-874d-c7ebe3082557"> <img width="141" alt="Screenshot 2024-06-12 at 15 07 14" src="https://github.com/go-gitea/gitea/assets/115237/c4a5492b-1bf1-4773-bc8d-64eb36d823f9">
1 parent b1ad8cc commit 222b830

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

web_src/css/base.css

+9
Original file line numberDiff line numberDiff line change
@@ -1005,6 +1005,13 @@ overflow-menu .ui.label {
10051005
padding: 0 8px;
10061006
text-align: right !important;
10071007
color: var(--color-text-light-2);
1008+
width: 1%; /* this apparently needs to be a percentage so that code column stretches in diffs */
1009+
min-width: 72px;
1010+
white-space: nowrap;
1011+
}
1012+
1013+
.code-diff .lines-num {
1014+
min-width: 50px;
10081015
}
10091016

10101017
.lines-num span.bottom-line::after {
@@ -1024,6 +1031,7 @@ overflow-menu .ui.label {
10241031

10251032
.lines-type-marker {
10261033
vertical-align: top;
1034+
white-space: nowrap;
10271035
}
10281036

10291037
.lines-num,
@@ -1056,6 +1064,7 @@ overflow-menu .ui.label {
10561064

10571065
.lines-escape {
10581066
width: 0;
1067+
white-space: nowrap;
10591068
}
10601069

10611070
.lines-code {

web_src/css/repo.css

-8
Original file line numberDiff line numberDiff line change
@@ -1555,8 +1555,6 @@ td .commit-summary {
15551555

15561556
.repository .diff-file-box .file-body.file-code .lines-num {
15571557
text-align: right;
1558-
width: 1%;
1559-
min-width: 50px;
15601558
}
15611559

15621560
.repository .diff-file-box .file-body.file-code .lines-num span.fold {
@@ -1582,12 +1580,6 @@ td .commit-summary {
15821580
table-layout: fixed;
15831581
}
15841582

1585-
.repository .diff-file-box .code-diff tbody tr td.lines-num,
1586-
.repository .diff-file-box .code-diff tbody tr td.lines-escape,
1587-
.repository .diff-file-box .code-diff tbody tr td.lines-type-marker {
1588-
white-space: nowrap;
1589-
}
1590-
15911583
.repository .diff-file-box .code-diff tbody tr td.center {
15921584
text-align: center;
15931585
}

0 commit comments

Comments
 (0)