From 441f3f0f205234e8cb8d7bac90ed115ebd2e9d43 Mon Sep 17 00:00:00 2001 From: vnkmpf Date: Thu, 11 Feb 2021 19:28:51 +0100 Subject: Make fileheader sticky in diffs (#14616) * Make fileheader sticky #12552 * Remove sticky filenames when width is 480px or less On mobile phone sticky filename is hidden due to the combination of many possible widths and lengths. * Fix text color for .markdown-info * Fix visual of sticky diff box on 480px or less - Hide arrow for select buttons. - Fix changes, additions and deletions. With flexbox they look very broken. This commit hides some words to, so the result is: "123 changed files 987 additions 456 deletions" - center text in buttons Co-authored-by: zeripath --- web_src/less/_repository.less | 50 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) (limited to 'web_src/less/_repository.less') diff --git a/web_src/less/_repository.less b/web_src/less/_repository.less index 57f101abb9..88a1a38bb6 100644 --- a/web_src/less/_repository.less +++ b/web_src/less/_repository.less @@ -1453,6 +1453,10 @@ align-items: flex-start; } + @media (max-width: 480px) { + flex-wrap: wrap; + } + &.sticky { position: sticky; top: 0; @@ -1473,6 +1477,17 @@ margin-right: .25rem; } + .diff-detail-stats { + @media (max-width: 480px) { + font-size: 0; + line-height: 1.6rem; + + strong { + font-size: 1rem; + } + } + } + .diff-detail-actions > * { margin-right: 0; } @@ -1481,6 +1496,21 @@ margin-left: .25rem; } + .diff-detail-actions { + @media (max-width: 480px) { + padding-top: .25rem; + + .ui.button { + padding-left: .5rem; + padding-right: .5rem; + display: flex; + flex-wrap: wrap; + justify-content: center; + text-align: center; + } + } + } + span.status { display: inline-block; width: 12px; @@ -2996,6 +3026,26 @@ td.blob-excerpt { margin-left: .5rem !important; } +.ui.attached.header.diff-file-header { + &.sticky-2nd-row { + position: sticky; + top: 46px; + z-index: 7; + + @media @mediaMd { + top: 77px; + } + + @media @mediaSm { + top: 77px; + } + + @media (max-width: 480px) { + position: static; + } + } +} + .diff-stats-bar { display: inline-block; background-color: var(--color-red); -- cgit v1.2.3