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

Gitweb CSS cleanup: container divs

From
Jakub Narebski <jnareb@gmail.com>
Date
Apr 27, 2007, 14:48 UTC
Message-ID
<200704271648.24963.jnareb@gmail.com>

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
Message 1 of 1 in “Gitweb CSS cleanup: container divs”
  1. Jakub NarebskiApr 27, 2007

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.