hgweb: ensure both foreground and background colors are specified (
issue4872)
When users configure the default foreground or background color to
non-default (black on white) values, several hgweb styles lack
contrast for headers and table row items. This patch fixes that by
ensuring that where either foreground or background colors are
specified, both are specified.
--- a/mercurial/templates/static/style-gitweb.css Mon Oct 05 01:47:33 2015 -0700
+++ b/mercurial/templates/static/style-gitweb.css Wed Oct 07 21:08:14 2015 +0100
@@ -1,4 +1,4 @@
-body { font-family: sans-serif; font-size: 12px; border:solid #d9d8d1; border-width:1px; margin:10px; }
+body { font-family: sans-serif; font-size: 12px; border:solid #d9d8d1; border-width:1px; margin:10px; background: white; color: black; }
a { color:#0000cc; }
a:hover, a:visited, a:active { color:#880000; }
div.page_header { height:25px; padding:8px; font-size:18px; font-weight:bold; background-color:#d9d8d1; }
--- a/mercurial/templates/static/style-paper.css Mon Oct 05 01:47:33 2015 -0700
+++ b/mercurial/templates/static/style-paper.css Wed Oct 07 21:08:14 2015 +0100
@@ -2,6 +2,7 @@
margin: 0;
padding: 0;
background: white;
+ color: black;
font-family: sans-serif;
}
--- a/mercurial/templates/static/style.css Mon Oct 05 01:47:33 2015 -0700
+++ b/mercurial/templates/static/style.css Wed Oct 07 21:08:14 2015 +0100
@@ -2,8 +2,8 @@
.age { white-space:nowrap; }
.date { white-space:nowrap; }
.indexlinks { white-space:nowrap; }
-.parity0 { background-color: #ddd; }
-.parity1 { background-color: #eee; }
+.parity0 { background-color: #ddd; color: #000; }
+.parity1 { background-color: #eee; color: #000; }
.lineno { width: 60px; color: #aaa; font-size: smaller;
text-align: right; }
.plusline { color: green; }
--- a/tests/test-hgweb-commands.t Mon Oct 05 01:47:33 2015 -0700
+++ b/tests/test-hgweb-commands.t Wed Oct 07 21:08:14 2015 +0100
@@ -1944,8 +1944,8 @@
.age { white-space:nowrap; }
.date { white-space:nowrap; }
.indexlinks { white-space:nowrap; }
- .parity0 { background-color: #ddd; }
- .parity1 { background-color: #eee; }
+ .parity0 { background-color: #ddd; color: #000; }
+ .parity1 { background-color: #eee; color: #000; }
.lineno { width: 60px; color: #aaa; font-size: smaller;
text-align: right; }
.plusline { color: green; }
--- a/tests/test-hgweb.t Mon Oct 05 01:47:33 2015 -0700
+++ b/tests/test-hgweb.t Wed Oct 07 21:08:14 2015 +0100
@@ -340,10 +340,10 @@
$ get-with-headers.py --twice localhost:$HGPORT 'static/style-gitweb.css' - date etag server
200 Script output follows
- content-length: 6379
+ content-length: 6412
content-type: text/css
- body { font-family: sans-serif; font-size: 12px; border:solid #d9d8d1; border-width:1px; margin:10px; }
+ body { font-family: sans-serif; font-size: 12px; border:solid #d9d8d1; border-width:1px; margin:10px; background: white; color: black; }
a { color:#0000cc; }
a:hover, a:visited, a:active { color:#880000; }
div.page_header { height:25px; padding:8px; font-size:18px; font-weight:bold; background-color:#d9d8d1; }