[PATCH] hgweb: remove artificial width constraint from header in monoblue

Anton Shestakov engored at ya.ru
Wed May 20 16:30:24 UTC 2015


# HG changeset patch
# User Anton Shestakov <engored at ya.ru>
# Date 1432139232 -28800
#      Thu May 21 00:27:12 2015 +0800
# Node ID 683919b79389a3060c108297e74ff8eaf7b41e4f
# Parent  8b69b5fcfa4b7aff70b46a3859e2b1dc0b82a5ab
hgweb: remove artificial width constraint from header in monoblue

This width property comes from the beginning of the monoblue theme itself, and
was used to stop the action header ("summary", "shortlog", "changelog", etc)
from clashing with the search form. But it still was happening (on smaller
screens, and with more actions added to hgweb over time).

Effectively, the hardcoded width was preventing the header from fitting into
the available screen space, since it always tried to be 900px wide, even if
that meant horizontal scroll on smaller screens and having the actions on two
lines where one should've been enough. For example,
http://selenic.com/hg/log?style=monoblue has the last two actions ("gz" and
"help") in the header on the second line, even when there seems to be enough
space on the first.

This patch makes the form float, which prevents it from overlaying/clashing
with the action header, and allows the latter to resize itself in the best
possible way.

diff --git a/mercurial/templates/static/style-monoblue.css b/mercurial/templates/static/style-monoblue.css
--- a/mercurial/templates/static/style-monoblue.css
+++ b/mercurial/templates/static/style-monoblue.css
@@ -53,10 +53,8 @@ div.page-header {
   }
 
   div.page-header form {
-    position: absolute;
-    margin-bottom: 2px;
-    bottom: 0;
-    right: 20px;
+    float: right;
+    margin-top: -2px;
   }
   div.page-header form label {
     color: #DDD;
@@ -83,7 +81,6 @@ div.page-header {
     margin: 10px 0 0 0;
     list-style-type: none;
     overflow: hidden;
-    width: 900px;
   }
     ul.page-nav li {
       margin: 0 2px 0 0;


More information about the Mercurial-devel mailing list