Skip to content

Web version: Table of contents poorly wraps long appendix titles #2003

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Chealer opened this issue Dec 16, 2024 · 1 comment
Closed

Web version: Table of contents poorly wraps long appendix titles #2003

Chealer opened this issue Dec 16, 2024 · 1 comment

Comments

@Chealer
Copy link

Chealer commented Dec 16, 2024

The web page with the table of contents tries to dedicate a right column to an image of the book and download links. This leaves the main (central) column narrower, and causes some ToC entries to require wrapping on a second line. This generally occurs for 3 items in appendices. The way the first 2 appendix titles displays (in both Firefox 133.0 and Google Chrome) is arguably incorrect, as can be seen in the screenshot below:
image

The format of A1.4's title is not great but acceptable, however the title of A1 itself has so much vertical space between its 2 lines that the "Environments" line is closer to A1.1 than to the beginning of the title.

This space is caused by the line-height CSS property, which comes from this rule:

h2 {
  margin-top:20px;
  font-size:18px;
  font-weight:700;
  line-height:44px;
  color:#f14e32
}

Although the unwarranted leading should be fixed, this issue should not have been so exposed. There are several ways to avoid wrapping altogether:

  1. Shorten titles; the titles would be less redundant by making an Appendix section and put all appendices under it.
  2. Widen the ToC.
    1. On my screen, the viewport has a width of 2560 pixels. Using only 940 is quite a waste.
    2. The ToC itself typically gets no more than 394 pixels, mostly due to the left column and the floating right column for traditional versions. It would be trivial to save 36 pixels by removing the superfluous left margin. It would also be possible to waste less on the right column:
      1. Most easily by removing the superfluous 40 pixels right margin.
      2. Or by just merging it in the left column.
@ben
Copy link
Member

ben commented Dec 16, 2024

This sounds like a good idea, but the code that styles that page is over at https://github.com/git/git-scm.com, so you'll have to report it there.

@ben ben closed this as completed Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants