css: highlight even table rows and skip empty rows

This is stolen from kernel.org css [0].

[0] https://git.kernel.org/cgit-korg-0.10.1.css
This commit is contained in:
Christian Hesse 2016-07-06 22:42:36 +02:00 committed by Jason A. Donenfeld
parent 44f8c11c8d
commit 81509a228c
3 changed files with 24 additions and 3 deletions

View File

@ -134,14 +134,34 @@ div#cgit table.list tr.logheader {
background: #eee; background: #eee;
} }
div#cgit table.list tr:nth-child(even) {
background: #f7f7f7;
}
div#cgit table.list tr:nth-child(odd) {
background: white;
}
div#cgit table.list tr:hover { div#cgit table.list tr:hover {
background: #eee; background: #eee;
} }
div#cgit table.list tr.nohover {
background: white;
}
div#cgit table.list tr.nohover:hover { div#cgit table.list tr.nohover:hover {
background: white; background: white;
} }
div#cgit table.list tr.nohover-highlight:hover:nth-child(even) {
background: #f7f7f7;
}
div#cgit table.list tr.nohover-highlight:hover:nth-child(odd) {
background: white;
}
div#cgit table.list th { div#cgit table.list th {
font-weight: bold; font-weight: bold;
/* color: #888; /* color: #888;

View File

@ -263,8 +263,9 @@ static void print_commit(struct commit *commit, struct rev_info *revs)
html("</td></tr>\n"); html("</td></tr>\n");
if (revs->graph || ctx.qry.showmsg) { /* Print a second table row */ if ((revs->graph && !graph_is_commit_finished(revs->graph))
html("<tr class='nohover'>"); || ctx.qry.showmsg) { /* Print a second table row */
html("<tr class='nohover-highlight'>");
if (ctx.qry.showmsg) { if (ctx.qry.showmsg) {
/* Concatenate commit message + notes in msgbuf */ /* Concatenate commit message + notes in msgbuf */

View File

@ -321,7 +321,7 @@ void cgit_print_repolist(void)
(last_section != NULL && section == NULL) || (last_section != NULL && section == NULL) ||
(last_section != NULL && section != NULL && (last_section != NULL && section != NULL &&
strcmp(section, last_section)))) { strcmp(section, last_section)))) {
htmlf("<tr class='nohover'><td colspan='%d' class='reposection'>", htmlf("<tr class='nohover-highlight'><td colspan='%d' class='reposection'>",
columns); columns);
html_txt(section); html_txt(section);
html("</td></tr>"); html("</td></tr>");