[PATCH] hgweb: remove negative top from .info line in graph

Anton Shestakov av6 at dwimlabs.net
Fri Dec 1 13:56:04 UTC 2017


# HG changeset patch
# User Anton Shestakov <av6 at dwimlabs.net>
# Date 1512131582 -28800
#      Fri Dec 01 20:33:02 2017 +0800
# Node ID 6c030d3e81ba8ee1af78b727f34bf5b25dafe94b
# Parent  3180ff7f60253ee1d6ae1f4608acb96c60adeef3
# EXP-Topic hgweb-cleanup
hgweb: remove negative top from .info line in graph

"top: -Xpx" shifts a block up by X pixels, which can be used to visually
compress two lines of text to have less space between them, in this case it's
used for the changesets on /graph page. But not only it's not needed there
(both lines fit fine into their allowed vertical space), but it would also look
better (not as crammed, more vertically centered) without these negative
values.

"position: relative" is needed solely for the "top" property to have effect on
the element, no children of the .info element rely on it, so let's remove it as
well.

diff --git a/mercurial/templates/static/style-gitweb.css b/mercurial/templates/static/style-gitweb.css
--- a/mercurial/templates/static/style-gitweb.css
+++ b/mercurial/templates/static/style-gitweb.css
@@ -324,8 +324,6 @@ ul#graphnodes {
 ul#graphnodes li .info {
 	display: block;
 	font-size: 100%;
-	position: relative;
-	top: -3px;
 	font-style: italic;
 }
 
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
@@ -503,7 +503,6 @@ ul#graphnodes li, ul#nodebgs li {
 
 ul#graphnodes li .info {
 	display: block;
-	position: relative;
 }
 /** end of canvas **/
 
diff --git a/mercurial/templates/static/style-paper.css b/mercurial/templates/static/style-paper.css
--- a/mercurial/templates/static/style-paper.css
+++ b/mercurial/templates/static/style-paper.css
@@ -481,8 +481,6 @@ ul#graphnodes li, ul#nodebgs li {
 ul#graphnodes li .info {
 	display: block;
 	font-size: 70%;
-	position: relative;
-	top: -3px;
 }
 
 /* Comparison */
diff --git a/mercurial/templates/static/style.css b/mercurial/templates/static/style.css
--- a/mercurial/templates/static/style.css
+++ b/mercurial/templates/static/style.css
@@ -117,6 +117,4 @@ ul#graphnodes {
 ul#graphnodes li .info {
 	display: block;
 	font-size: 70%;
-	position: relative;
-	top: -1px;
 }
diff --git a/tests/test-hgweb-commands.t b/tests/test-hgweb-commands.t
--- a/tests/test-hgweb-commands.t
+++ b/tests/test-hgweb-commands.t
@@ -2093,8 +2093,6 @@ Static files
   ul#graphnodes li .info {
   	display: block;
   	font-size: 70%;
-  	position: relative;
-  	top: -1px;
   }
 
 Stop and restart the server at the directory different from the repository
diff --git a/tests/test-hgweb.t b/tests/test-hgweb.t
--- a/tests/test-hgweb.t
+++ b/tests/test-hgweb.t
@@ -340,7 +340,7 @@ static file
 
   $ get-with-headers.py --twice localhost:$HGPORT 'static/style-gitweb.css' - date etag server
   200 Script output follows
-  content-length: 9185
+  content-length: 9152
   content-type: text/css
   
   body { font-family: sans-serif; font-size: 12px; border:solid #d9d8d1; border-width:1px; margin:10px; background: white; color: black; }
@@ -669,8 +669,6 @@ static file
   ul#graphnodes li .info {
   	display: block;
   	font-size: 100%;
-  	position: relative;
-  	top: -3px;
   	font-style: italic;
   }
   


More information about the Mercurial-devel mailing list