Fix right-side alignment of content area on non-homepage pages#2133
Open
dscho wants to merge 1 commit intogit:gh-pagesfrom
Open
Fix right-side alignment of content area on non-homepage pages#2133dscho wants to merge 1 commit intogit:gh-pagesfrom
dscho wants to merge 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
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