git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 4/3] gitweb: Use light/dark class also in 'blame' view

From
Jakub Narebski <jnareb@gmail.com>
Date
Jul 12, 2009, 22:08 UTC
Message-ID
<200907130008.46168.jnareb@gmail.com>
In-Reply-To
<200907102354.43232.jnareb@gmail.com>

Instead of using "light2" and "dark2" for class names in 'blame' view (in place of "light" and "dark" classes in other places) to avoid changing style on hover in 'blame' view while doing it for other views (like 'shortlog'), use more advanced CSS, relying on the fact that more specific selector wins.

While at it add a few comments to gitweb CSS file, and consolidate some repeated info.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
This is an RFC because 
1. I am not sure if I did it correctly.  I had to fiddle a bit with CSS
(using "table.blame .light:hover" in place of "table.blame tr.light:hover")
to get the same behaviour (well, the same as far as I have checked it).
2. Commit message could use improvements (single sentence, blergh).
 gitweb/gitweb.css  |   16 +++++++++-------
 gitweb/gitweb.perl |    2 +-
 2 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/gitweb/gitweb.css b/gitweb/gitweb.css
index 5e2f629..4e4f8aa 100644
--- a/gitweb/gitweb.css
+++ b/gitweb/gitweb.css
@@ -226,22 +226,24 @@ th {
 	text-align: left;
 }
 
-tr.light:hover {
-	background-color: #edece6;
-}
-
-tr.dark {
-	background-color: #f6f6f0;
+/* do not change row style on hover for 'blame' view */
+tr.light,
+table.blame .light:hover {
+	background-color: #ffffff;
 }
 
-tr.dark2 {
+tr.dark,
+table.blame .dark:hover {
 	background-color: #f6f6f0;
 }
 
+/* currently both use the same, but it can change */
+tr.light:hover,
 tr.dark:hover {
 	background-color: #edece6;
 }
 
+/* boundary commits in 'blame' view */
 tr.boundary td.sha1 {
 	font-weight: bold;
 }
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 5336c92..bb7a5a9 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -4811,7 +4811,7 @@ sub git_blame {
 	git_print_page_path($file_name, $ftype, $hash_base);
 
 	# page body
-	my @rev_color = qw(light2 dark2);
+	my @rev_color = qw(light dark);
 	my $num_colors = scalar(@rev_color);
 	my $current_color = 0;
 	my %metainfo = ();
-- 
1.6.3.3
Previous: Jakub Narebski
Message 11 of 11 in “gitweb: 'blame' view improvements”
  1. 0/3 gitweb: 'blame' view improvementsJakub Narebski, Jul 10, 2009
  2. 1/3 gitweb: Mark boundary commits in 'blame' viewJakub Narebski, Jul 10, 2009
  3. 2/3 gitweb: Use "previous" header of git-blame -p in 'blame' viewJakub Narebski, Jul 10, 2009
  4. Junio C HamanoJul 10, 2009
  5. Jakub NarebskiJul 11, 2009
  6. Luben TuikovJul 12, 2009
  7. Jakub NarebskiJul 14, 2009
  8. 3/3 gitweb: Add author initials in 'blame' view, a la "git gui blame"Jakub Narebski, Jul 10, 2009
  9. Jakub NarebskiJul 11, 2009
  10. 5/3 gitweb: Incremental blame (proof of concept)Jakub Narebski, Jul 13, 2009
  11. 4/3 gitweb: Use light/dark class also in 'blame' viewJakub Narebski, Jul 12, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.