QChris has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/70049


Change subject: Pretend to color change table rows by data row index
......................................................................

Pretend to color change table rows by data row index

Using the odd color for odd rows and the even color for even rows in
change tables, results in the 1st, 3rd, ... data row having the even
color, and 2nd, 4th, ... data row having the odd color, as our header
row is a plain row in the table's tbody and is therefore counted as a
plain table row by CSS. This coloring scheme is unintuitive to users.
We now use the odd color for even rows and the even color for odd
rows, and thereby have the 1st, 3rd, ... data row in odd color and
2nd, 4th, ... data row in even color.

Change-Id: Ie5bd54938fb15e6b439961665d82303b34f9bfcd
---
M gerrit-gwtui/src/main/java/com/google/gerrit/client/gerrit.css
1 file changed, 11 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/gerrit refs/changes/49/70049/1

diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/gerrit.css 
b/gerrit-gwtui/src/main/java/com/google/gerrit/client/gerrit.css
index 5f16af6..0282f4b 100644
--- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/gerrit.css
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/gerrit.css
@@ -455,11 +455,20 @@
 }
 
 .changeTable tr:nth-child\(even\) {
-  background: tableEvenRowColor;
+  /* Users expect to see the tableOddRowColor to be used on the 1st,
+   * 3rd, ... data row. As change tables typically have the title row
+   * as first row in tbody, this shifts row numbers for data rows by
+   * one, and we have the 1st data row being the 2nd row in the table. So
+   * we use tableOddRowColor on even rows and vice versa.
+   */
+  background: tableOddRowColor;
 }
 
 .changeTable tr:nth-child\(odd\) {
-  background: tableOddRowColor;
+  /* See above's nth-child\(even\) for an explanation why we use
+   * tableEvenRowColor for odd rows.
+   */
+  background: tableEvenRowColor;
 }
 
 .changeTable .outdated {

-- 
To view, visit https://gerrit.wikimedia.org/r/70049
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie5bd54938fb15e6b439961665d82303b34f9bfcd
Gerrit-PatchSet: 1
Gerrit-Project: gerrit
Gerrit-Branch: master
Gerrit-Owner: QChris <christ...@quelltextlich.at>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to