Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sticky header in diff view #23554

Merged
merged 10 commits into from
Mar 18, 2023
12 changes: 10 additions & 2 deletions web_src/css/repository.css
Original file line number Diff line number Diff line change
Expand Up @@ -1611,12 +1611,14 @@
padding: 7px 0;
background: var(--color-body);
line-height: 30px;
height: 47px; /* match .ui.attached.header.diff-file-header.sticky-2nd-row */
}

@media (max-width: 991px) {
.repository .diff-detail-box {
flex-direction: column;
align-items: flex-start;
height: 77px; /* match .ui.attached.header.diff-file-header.sticky-2nd-row */
}
}

Expand All @@ -1630,7 +1632,7 @@
position: sticky;
top: 0;
z-index: 8;
border-bottom: 1px solid var(--color-secondary);
border-bottom: none;
padding-left: 2px;
padding-right: 2px;
margin-left: -1px;
Expand Down Expand Up @@ -3318,10 +3320,16 @@ td.blob-excerpt {

.ui.attached.header.diff-file-header.sticky-2nd-row {
position: sticky;
top: 77px;
top: 47px; /* match .repository .diff-detail-box */
z-index: 7;
}

@media (max-width: 991px) {
.ui.attached.header.diff-file-header.sticky-2nd-row {
top: 77px; /* match .repository .diff-detail-box */
}
}

@media (max-width: 480px) {
.ui.attached.header.diff-file-header.sticky-2nd-row {
position: static;
Expand Down