From 0f426917166a9c2502ba158f8ba6592acfed768d Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Fri, 14 Aug 2026 09:31:01 -1000 Subject: Make the breakpoints hide and restack, not resize Nothing changes size across a breakpoint any more. On a phone the tree listing keeps name and size, the diff and stat option panels hide, the owner line leaves the stacked masthead, and the search, switcher and authors wait until they fit. --- assets/cgit.css | 93 ++++++++++++++++++++++----------------------------------- 1 file changed, 36 insertions(+), 57 deletions(-) (limited to 'assets') diff --git a/assets/cgit.css b/assets/cgit.css index 6c1ada4..5f6ad42 100644 --- a/assets/cgit.css +++ b/assets/cgit.css @@ -681,6 +681,10 @@ div#cgit td.ls-mode { width: 10em; } +div#cgit td.ls-links { + white-space: nowrap; +} + /* Source blob */ div#cgit table.blob { @@ -1358,27 +1362,30 @@ div#cgit table.ssdiff td.space div { min-height: 3em; } -@media (min-width: 1440px) { - div#cgit { - --gutter: 2rem; - font-size: 14px; +/* The breakpoints only hide chrome or restack, sizes never change. */ + +@media (max-width: 900px) { + div#cgit .tabs .search { + display: none; + } + + div#cgit #header .branch-switch { + display: none; } -} -@media (max-width: 640px) { - div#cgit { - --gutter: 0.85rem; - --control-h: 2.5em; + div#cgit table.list th.col-author, + div#cgit table.list td.col-author { + display: none; } +} +@media (max-width: 640px) { div#cgit .col-desc, div#cgit .col-owner, div#cgit .col-links { display: none; } - div#cgit table.list th.col-author, - div#cgit table.list td.col-author, div#cgit table.list th.col-count, div#cgit table.list td.col-count { display: none; @@ -1389,6 +1396,17 @@ div#cgit table.ssdiff td.space div { overflow-wrap: anywhere; } + div#cgit th.ls-mode, + div#cgit td.ls-mode, + div#cgit th.ls-links, + div#cgit td.ls-links { + display: none; + } + + div#cgit td.ls-size { + width: auto; + } + /* Fixed table layout would still reserve the hidden columns' width. */ div#cgit table.repolist { width: 100%; @@ -1407,31 +1425,21 @@ div#cgit table.ssdiff td.space div { text-align: right; } - div#cgit .tabs a { - padding: 0.55em 0.7em; - } - - div#cgit .tabs .search { - display: none; - } - div#cgit #header { grid-template-columns: auto 1fr auto; grid-template-areas: "logo heading theme" - "desc desc desc" - "owner owner owner"; - column-gap: 8px; + "desc desc desc"; row-gap: 6px; } - div#cgit #header .logo { - min-width: 56px; - min-height: 37px; + div#cgit #header .owner { + display: none; } - div#cgit #header .logo img { - max-width: 56px; + /* Outranks the base reservation, whose fourth column would sit here empty. */ + html.cgit-js div#cgit #header { + grid-template-columns: auto 1fr var(--control-h); } div#cgit #header::before { @@ -1441,47 +1449,18 @@ div#cgit table.ssdiff td.space div { div#cgit #header h1.main { white-space: normal; overflow-wrap: anywhere; - font-size: 190%; } - div#cgit #header .owner { - justify-self: start; - text-align: left; - } - - div#cgit #header .branch-switch { + div#cgit div.cgit-panel { display: none; } - div#cgit div.cgit-panel, div#cgit div.notes { float: none; margin-left: 0; } - div#cgit div.cgit-panel { - margin: 1em 0; - } - div#cgit table.commit-info { width: 100%; } } - -@media (max-width: 380px) { - div#cgit #header .logo { - min-width: 44px; - } - - div#cgit #header .logo img { - max-width: 44px; - } - - div#cgit #header h1.main { - font-size: 160%; - } - - div#cgit .tabs a { - padding: 0.55em 0.55em; - } -} -- cgit v2.8.0