[PATCH 2 of 3] monoblue: make the size of line links bigger to cover line numbers better

Anton Shestakov av6 at dwimlabs.net
Wed Oct 14 09:50:51 CDT 2015


# HG changeset patch
# User Anton Shestakov <av6 at dwimlabs.net>
# Date 1444832690 -28800
#      Wed Oct 14 22:24:50 2015 +0800
# Node ID a96340631f8caa63ebde31f2666da75fcea0838e
# Parent  a3a68b6dae26c43f9a5d64edd9b09748aad63255
monoblue: make the size of line links bigger to cover line numbers better

Due to how the line numbers in monoblue are formed (via css counters), the size
of the area with the numbers and the size of the actually clickable links are
not tied together well enough. Before this patch, there were noticeable "gaps"
between line links - clicking on the bottom part of a visible line number did
nothing as opposed to selecting this line.

Let's set font-size for everything in pre.sourcelines so that it also affects
the links and then add a bit of padding to them so compensate for layout
differences.

This way the sizes are still not 100% the same, but should be very close.

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
@@ -262,13 +262,16 @@ span.difflineplus { color:#008800; }
 span.difflineminus { color:#cc0000; }
 span.difflineat { color:#990099; }
 
-pre.sourcelines { position: relative; counter-reset: lineno; }
+pre.sourcelines {
+    position: relative;
+    counter-reset: lineno;
+    font-size: 1.2em;
+}
 pre.sourcelines > span {
     display: inline-block;
     box-sizing: border-box;
     width: 100%;
     padding: 0 0 0 5em;
-    font-size: 1.2em;
     counter-increment: lineno;
     vertical-align: top;
 }
@@ -295,6 +298,7 @@ pre.sourcelines > a {
     left: 0px;
     width: 4em;
     height: 1em;
+    padding: 0.15em;
 }
 pre.sourcelines.stripes > :nth-child(4n+1) { background-color: #F1F6F7; }
 pre.sourcelines.stripes > :nth-child(4n+3) { background-color: #FFFFFF; }


More information about the Mercurial-devel mailing list