Skip to content

Size a sidebar page's aside with --aside - #4006

Merged
max-sixty merged 1 commit into
mainfrom
sidebar-aside-width
Oct 25, 2026
Merged

max-sixty merged 1 commit into
mainfrom
sidebar-aside-width

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

A sidebar page's aside now takes its width from --aside, which a page sets on its main to a length or a share of the row (main { --aside: 20rem; }). In the overnight authoring runs, 9 author samples read Leaf's CSS to find how to size this panel, because the Layout read no property for it: the width came from flex shares (body 2 1 30rem, aside 1 1 18rem). The --sidebar and --sidebar-max properties size a column page's margin sidebar, not this panel.

The default, --aside: auto, keeps those shares. Probes of live-progress and triage-board at 1440, 1000, 820 and 780px wide match the base to the pixel. That includes triage-board at 1440, where the body's content minimum makes the aside give up width. When a page sets --aside, a style query on the Layout's box switches to a sizing where the aside is flex: 1 1 var(--aside) and the body's grow factor is large enough to take every free pixel. Beside the body, the aside stands exactly as wide as the page set. Stacked, each region still fills its row, and the two stack where the body's 30rem base or its content minimum no longer fits beside the aside. A single basis property could not do this. Changing only the aside's basis while keeping the 2:1 growth barely moves it: a basis of 16rem instead of 18rem narrows the aside at 1440px by 21px, from 466px to 444px. Making the basis the aside's own width, with no switch, kept every default width but stacked triage-board at 1440, because flex wrapping reads bases, not final widths.

skills/leaf/references/page-layout.md, "A sidebar page", documents the property. test_a_sidebar_pages_aside_takes_the_width_the_page_sets checks the aside at 16rem beside the body, the body taking the rest of the row, and both filling the row once stacked. It fails on the base, where the aside measures 465.6px instead of 256px. Firefox lays out the set width the same way.

This was written by Claude Code on behalf of max-sixty

A page sets --aside on its main to a length or a share of the row, and
the aside stands that wide beside the body while the body takes the
rest. The default, auto, keeps the 2:1 flex shares, so every existing
sidebar page lays out as before. Authors read the Layout's CSS to find
a rule to override; the reference now names the property.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit c03d33c into main Oct 25, 2026
4 checks passed
@max-sixty
max-sixty deleted the sidebar-aside-width branch October 25, 2026 18:46
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

Successfully merging this pull request may close these issues.

2 participants