Skip to content

Commit aef3768

Browse files
jnarebgitster
authored andcommitted
gitweb: Use light/dark for class names also in 'blame' view
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> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent a36817b commit aef3768

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

gitweb/gitweb.css

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -226,22 +226,25 @@ th {
226226
text-align: left;
227227
}
228228

229-
tr.light:hover {
230-
background-color: #edece6;
231-
}
232-
233-
tr.dark {
234-
background-color: #f6f6f0;
229+
/* do not change row style on hover for 'blame' view */
230+
tr.light,
231+
table.blame .light:hover {
232+
background-color: #ffffff;
235233
}
236234

237-
tr.dark2 {
235+
tr.dark,
236+
table.blame .dark:hover {
238237
background-color: #f6f6f0;
239238
}
240239

240+
/* currently both use the same, but it can change */
241+
tr.light:hover,
241242
tr.dark:hover {
242243
background-color: #edece6;
243244
}
244245

246+
/* boundary commits in 'blame' view */
247+
/* and commits without "previous" */
245248
tr.boundary td.sha1,
246249
tr.no-previous td.linenr {
247250
font-weight: bold;

gitweb/gitweb.perl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4801,7 +4801,7 @@ sub git_blame {
48014801
git_print_page_path($file_name, $ftype, $hash_base);
48024802

48034803
# page body
4804-
my @rev_color = qw(light2 dark2);
4804+
my @rev_color = qw(light dark);
48054805
my $num_colors = scalar(@rev_color);
48064806
my $current_color = 0;
48074807
my %metainfo = ();

0 commit comments

Comments
 (0)