threads / discuss / 7872

Gitweb CSS cleanup: container divs

Subject: Gitweb CSS cleanup: container divs

## tl;dr

One message between Apr 27, 2007 and Apr 27, 2007.

replies: 0people: 1as markdown or json

Jakub Narebski· Apr 27, 2007, 14:48 UTC · lore

Current gitweb style is that bottom-level elements (elements which contain some contents) have 8px padding, and each of element has "padding: 8px" in CSS separately.

There exists few container divs, i.e. divs which have only other divs as contents, and no unwrapped text element. Examples incude "page_body", "patchset", "patch" divs.

Because container divs (usually) should not have any padding, it is not possible to simplify CSS by using 8px for all divs, with some exceptions.

This situation causes that sometimes padding is not added, like for projects README on project summary page ("summary" view), and sometimes unnecessary padding is added causing excessive spacing or wrong style, like for "commitdiff" view. It would be nice to have CSS streamlined (cleaned up / refactored) to avoid such errors in gitweb styling, minor they are.

There are few possible solutions:
1. Get rid of all container divs, or all except toplevel container divs,
   and make "padding: 4px" default style for all divs. This migh make
   styling harder, and make us to add unnecessary classes for styling,
   where the fact that some element is in some (container) div would be
   enough otherwise for selecting element for styling (class-itis).
2. Current solution, i.e. add "padding: 4px" for each 'contents' div,
   and set "padding: 0px" for each 'container' div if needed.  Error
   prone.
3. Set either "contents" class for each 'contents' div (similar to
   current solution, error prone when adding new contents), or
   "container" class for each 'container' div (bit less error prone,
   as adding containers should be more rare than adding contents divs)
4. Enumerate 'container' div in CSS, set default padding as for
   'contents' div.
I opt for solution 4., together with perhaps restucturing gitweb.css
-- 
Jakub Narebski
Poland

← back to recent threads