Skip to content

Commit 90bcdf9

Browse files
authored
Fix line number widths (#31341)
Fixes regression #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 21ba5ca commit 90bcdf9

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
@@ -1001,6 +1001,13 @@ overflow-menu .ui.label {
10011001
padding: 0 8px;
10021002
text-align: right !important;
10031003
color: var(--color-text-light-2);
1004+
width: 1%; /* this apparently needs to be a percentage so that code column stretches in diffs */
1005+
min-width: 72px;
1006+
white-space: nowrap;
1007+
}
1008+
1009+
.code-diff .lines-num {
1010+
min-width: 50px;
10041011
}
10051012

10061013
.lines-num span.bottom-line::after {
@@ -1020,6 +1027,7 @@ overflow-menu .ui.label {
10201027

10211028
.lines-type-marker {
10221029
vertical-align: top;
1030+
white-space: nowrap;
10231031
}
10241032

10251033
.lines-num,
@@ -1052,6 +1060,7 @@ overflow-menu .ui.label {
10521060

10531061
.lines-escape {
10541062
width: 0;
1063+
white-space: nowrap;
10551064
}
10561065

10571066
.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)