Fix right-side alignment of content area on non-homepage pages#2133
Merged
dscho merged 1 commit intogit:gh-pagesfrom Feb 20, 2026
Merged
Fix right-side alignment of content area on non-homepage pages#2133dscho merged 1 commit intogit:gh-pagesfrom
dscho merged 1 commit intogit:gh-pagesfrom
Conversation
In 9f2a5ae ("Continue to display sidebar when page scrolls"), the layout of `#content-wrapper` was converted from floats to flexbox in order to support `position: sticky` on the sidebar. That commit removed `float: left` from `aside` and `float: right` from `#content`, and added `display: flex` to `#content-wrapper`. However, the old float layout relied on the fact that `#content` was floated to the right: the sidebar (218px) and the content area (702px) together only add up to 920px inside a 940px container, with the remaining 20px forming a gap between them. With `float: right`, the content area was pushed flush against the right edge of the container, so its right edge aligned perfectly with the header above. After the switch to flexbox, both children are packed to the left by default (the initial value of `justify-content` is `flex-start`), leaving the 20px gap on the right side instead of between the two elements. This caused the right edge of the content area to be visibly misaligned with the right edge of the header's search bar and dark-mode toggle. The fix is to add `justify-content: space-between` to `#content-wrapper`, which restores the original float-era behavior: the sidebar sits at the left edge and the content area sits at the right edge, with the 20px gap between them. A Playwright test is included that verifies the right edge of `#content` is flush with the right edge of `#content-wrapper`. This test was used to bisect and confirm that the regression was introduced in 9f2a5ae. Assisted-by: Claude Opus 4.6 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Collaborator
|
The fix makes sense to me, thanks for catching this! I double checked what the site looked like before 9f2a5ae, and there was indeed a gap between the sidebar and the content, it looked like this:
|
Member
Author
dscho
added a commit
that referenced
this pull request
Feb 20, 2026
## Changes - Adds a Node.JS script to generate screenshots, mainly to support opening PRs. ## Context In PRs like #2133, it is good to accompany the code changes and the explanation (including rationale!) with a before/after comparison. This is oddly involved at the moment! Historically, I used to whip out my trusty interactive <kbd>🪟</kbd><kbd>Shift</kbd><kbd>S</kbd> screenshot shortcut, and kind of aimed to catch the same areas before and after making my change. Then, I pasted them into the PR description and surrounded them by Markdown table markup. Quite tedious, if I'm honest! So here's a script that automates a lot of that. It can even be used to re-build the site locally from two given revisions, and then take snapshots of those pages, using Playwright. It also allows to clip the areas to capture via specifying pixel values, which is admittedly not _that_ convenient, but I couldn't find a better way. The output is a copy/paste'able bit of Markdown/HTML with the images' absolute paths inserted: There is no API to upload images to GitHub PRs, and therefore they have to be uploaded manually. At least this way, the user can copy the entire Markdown, paste it into the PR description editor, then cut the first path to the clipboard, click the "Paste, drop, or click to add files" button below the editor, paste the path, then repeat with the second path. This is precisely what I did over in #2133, with the tell-tale `<!-- Generated by 'node compare-screenshots.js --clip=256x256+900+0 https://git-scm.com/about https://dscho.github.io/git-scm.com/about' -->` comment in the PR body (can be seen here: https://api.github.com/repos/git/git-scm.com/pulls/2133).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Changes
Fix right-hand side alignment:
Context
In 9f2a5ae ("Continue to display sidebar when page scrolls"), the layout of
#content-wrapperwas converted from floats to flexbox in order to supportposition: stickyon the sidebar. That commit removedfloat: leftfromasideandfloat: rightfrom#content, and addeddisplay: flexto#content-wrapper.However, the old float layout relied on the fact that
#contentwas floated to the right: the sidebar (218px) and the content area (702px) together only add up to 920px inside a 940px container, with the remaining 20px forming a gap between them. Withfloat: right, the content area was pushed flush against the right edge of the container, so its right edge aligned perfectly with the header above. After the switch to flexbox, both children are packed to the left by default (the initial value ofjustify-contentisflex-start), leaving the 20px gap on the right side instead of between the two elements. This caused the right edge of the content area to be visibly misaligned with the right edge of the header's search bar and dark-mode toggle.The fix is to add
justify-content: space-betweento#content-wrapper, which restores the original float-era behavior: the sidebar sits at the left edge and the content area sits at the right edge, with the 20px gap between them.A Playwright test is included that verifies the right edge of
#contentis flush with the right edge of#content-wrapper. This test was used to bisect and confirm that the regression was introduced in 9f2a5ae.Assisted-by: Claude Opus 4.6