[PATCH 3/5] gitweb: fix mobile page overflow across log/commit/blob/diff views
- From
Rito Rhymes via GitGitGadget <gitgitgadget@gmail.com>
- Date
- Feb 9, 2026, 23:17 UTC
- Message-ID
- <7b785b6064966aefe6883ce3c45e80bb74fe79f4.1770679038.git.gitgitgadget@gmail.com>
- In-Reply-To
- <pull.2043.git.1770679038.gitgitgadget@gmail.com>
From: Rito Rhymes <rito@ritovision.com>
On mobile-sized viewports, gitweb pages in log/commit/blob/diff views can overflow horizontally due to desktop-oriented paddings and fixed-width preformatted content.
Add a shared mobile media query to rebalance those layouts: reduce or clear paddings in log/commit sections, keep header/search content within the viewport, and allow horizontal scrolling for preformatted blob/diff content instead of forcing page-wide overflow.
Signed-off-by: Rito Rhymes <rito@ritovision.com> --- gitweb/static/gitweb.css | 71 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 64 insertions(+), 7 deletions(-)
diff --git a/gitweb/static/gitweb.css b/gitweb/static/gitweb.css index 1fe120cd95..135590b64c 100644 --- a/gitweb/static/gitweb.css +++ b/gitweb/static/gitweb.css @@ -123,6 +123,7 @@ div.title_text { div.log_body { padding: 8px 8px 8px 150px; + overflow-wrap: anywhere; } span.age { @@ -537,13 +538,6 @@ div.search { div.projsearch { text-align: center; margin: 20px 0px; - padding: 0 8px; - box-sizing: border-box; -} - -div.projsearch input[type="text"] { - max-width: 100%; - box-sizing: border-box; } div.projsearch form { @@ -691,3 +685,66 @@ div.remote { .kwb { color:#830000; } .kwc { color:#000000; font-weight:bold; } .kwd { color:#010181; } + +@media (max-width: 768px) { + div.page_body { + overflow-x: auto; + -webkit-overflow-scrolling: touch; + } + + div.page_body div.pre { + min-width: max-content; + } + + div.projsearch { + padding: 0 8px; + box-sizing: border-box; + } + + div.projsearch input[type="text"] { + max-width: 100%; + box-sizing: border-box; + } + + div.title_text { + overflow-x: auto; + -webkit-overflow-scrolling: touch; + padding-left: 4px; + padding-right: 4px; + box-sizing: border-box; + } + + div.title_text table.object_header { + width: max-content; + } + + div.log_body { + padding: 8px; + clear: left; + } + + div.patchset div.patch { + width: max-content; + min-width: 100%; + } + + div.diff.header { + padding: 4px 8px 2px 8px; + white-space: nowrap; + overflow-wrap: normal; + } + + div.diff.extended_header { + padding: 2px 8px; + white-space: nowrap; + overflow-wrap: normal; + } + + div.diff.ctx, + div.diff.add, + div.diff.rem, + div.diff.chunk_header { + padding: 0 8px; + white-space: pre; + } +}
-- gitgitgadget