Main content
The main content takes the remaining width and moves below the menu when the layout stacks.
Layout
The .sidebar layout arranges exactly two children in columns: a target-width sidebar and flexible main content. If the main content shrinks to its minimum width, the children stack vertically. Use this layout for page navigation and content, media objects, and form rows.
.sidebar to the parent.--sidebar-target-width: Sets the preferred sidebar width. The default is 15rem.--sidebar-content-min-width: Sets the minimum main-content width. Increase the value to stack earlier or decrease it to stack later. The default is 50%.--gap: Sets the space between the children. The default is --space-s-m.Place an <aside> containing a <nav> and a <main> as the layout's two children. For a full-page shell, add .container to the sidebar parent.
The main content takes the remaining width and moves below the menu when the layout stacks.
The .media modifier sizes the first child to its content, which supports an avatar, icon, or thumbnail beside text. It also vertically centers the two children. .media sidebars have a smaller --gap value by default.
Kim Trønnes
Pushed 3 commits to main · 2h ago
Use .no-stretch to prevent the children from stretching to the same height.
Use .reversed to place the sidebar on the right for a table of contents or supplementary metadata.
The main reading column takes the available space. The table of contents appears on the right and moves above the article when the layout stacks.