Subject: Re: gitweb.css

From: Jakub Narebski <[email-masked]>
Date: Thu, 8 Jul 2010 20:49:22 +0200

On Thu, 8 Jul 2010, Eli Barzilay wrote:
> On Jul 8 Jakub Narebski wrote:
>> Eli Barzilay <[email-masked]> writes:
>> 
>>> I've been customizing a gitweb server to fit with the rest of our
>>> project pages (the result is http://git.racket-lang.org/). This was
>>> relatively easy to do except for a few places where gitweb.css
>>> specifies formatting for generic tags like `body' `table' and `td' 
>>> which messed up our header.
>>> 
>>> Maybe it makes sense to localize these styles to to gitweb specific
>>> classes? (I know that I can just use my own css but the file is big
>>> enough that I prefer avoiding manually merging in updates.)
>> 
>> Can't you just override gitweb's CSS by your own CSS? Later CSS
>> wins. You can have more than one stylesheet in gitweb
>> (@stylesheets).
> 
> I know -- and I'm using that. The problem is if there's a property
> that we're not defining then it won't get overridden -- and doing so
> requires knowing what the default value is and keeping our css
> updated for future extensions (eg if tomorrow you make add
> `font-family' to the `table' entry we'll need to add one too etc).
> And still this means overriding your settings which were probably
> done for a reason...

Ah, all right.  I think I understand your problem, then.
 
The problem is that in included GITWEB_SITE_HEADER, GITWEB_HOMETEXT
and GITWEB_SITE_FOOTER gitweb style applies to links and tables, and
you want to have own style based on default HTML style values, isn't
it?
 
>> [...]
>> I'd rather not add 'gitweb' class (or similar) to every element just
>> to have common style for all links tables table header cells 
>> table cells.
> 
> Why not add just a <div class=".gitweb"> container for all gitweb
> content then have css for ".gitweb foo" for anything you want?

First, I dislike this solution.

Second, similar solution would be beter, namely consistent division of
page into gitweb_header, gitweb_body and gitweb_footer, moving style
of 'body' to gitweb_*, and 'table' etc. to '.gitweb_body table'.  The
problem is with the way CSS is structured currently: I had problems
with some elements losing their margin, and some elements having double
margin.

-- 
Jakub Narebski
Poland