Repository navigation
Centre a sidebar page's prose in the window, clear of its sidebar - #6004
Merged
Merged
Conversation
A sidebar page's `layout-column` body set its prose at its own start edge (#4724) and gave all the rest of its width to the room at the end. Beside a 240px outline column that put the prose at 288px. Once #5772 narrowed a contents-only sidebar to its 56px spine, the prose followed it to 104px: at a 1728px window, 880px stood empty past the prose and the panel stood centred 400px right of it. The body now pads its start by `--lf-room-before`, the part of its room that centres the prose in the Layout, so the prose stands where a column page's would and moves toward the end only as far as the sidebar before it needs. The rest of the room stays at the end, and `--lf-free-start` and `--lf-free-end` split the room around the prose for breakouts. In Firefox at 1728px the prose moves from 104 to 504px beside the spine and from 288 to 504px beside an outline column; at 1440px it stands at 360px; below about 930px it stands where it did. Pointing at the spine now shows its titles in the empty margin on a wide window instead of over the words. Tests that asserted the old placement change with it: the spine test asserts the prose is centred and the titles lie past the spine's track; the covering test runs at 960px, where the titles still reach over the body; the contents journey asserts the narrowed aside and the centred prose; and a flow written the other way from its page now grows its wide block into the room before the prose, within the page's room.
The room before the prose counted the aside as standing before the body, so an aside after it left the prose short of the centre by the aside and the gap: at 1728px beside a 240px aside after the body, the prose stood at 240px rather than 504px. A sidebar whose aside follows its body now centres the prose in the whole Layout, short of the aside. The outline test asserts the prose is centred with the aside on either side of the body.
leaf-agent
approved these changes
Nov 15, 2026
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.
A sidebar page's prose now stands where a column page's would: centred in the window, moving right only as far as the sidebar needs. Since #4724 the body started its prose at its own start edge beside the sidebar. Once #5772 narrowed a contents-only sidebar to its 56px spine, that put the prose at x=104 on a 1728px window, with 880px empty past it and the panel centred 400px off it. In Firefox the prose now stands at 504px beside the spine or an outline column at 1728, 360px at 1440 and 280px at 1280, and below about 930px where it did. Pointing at the spine on a wide window shows its titles in the empty margin rather than over the words.
The body pads its start by a new
--lf-room-beforeand splits its room into--lf-free-startand--lf-free-end, soavailableblocks still reach the whole room andwidegrows from the prose. An aside after the body centres the prose short of the aside. Two limits carry over from the room math, which predicts flex geometry from--asideand the gap: a percentage--asidezeroes the room, as before this change, and nested flows written in alternating directions don't grow their box toward a wide block's start side, as on column pages.Max picked this layout from three drawn candidates. Tests: the spine, outline and other-direction-flow tests assert the centred prose; the sidebar browser tests and the contents journey pass.