Flank

A two-column composition layout with a fixed-width secondary region beside a flexible main region. It stacks to one column when the main region would drop below its minimum width. The .is-reversed class puts the secondary region on the other side. The typical use is navigation or a summary beside long-form content.

The flank is what Every Layout calls the sidebar, but I didn't want it to be confused with sidebars used in an application. Thus, the name changed, but the idea is still there. It creates an in-page two-column split where a fixed-width secondary column flanks a flexible main column. It wraps to a stacked single column when there is no room for both side by side.

Examples

Main content area that grows to fill the remaining space.
<div class="flank" style="--flank-width: 12rem">
        <aside class="docs-box">Secondary</aside>
        <div class="docs-box">Main content area that grows to fill the remaining space.</div>
    </div>

Reversed

When reversed, the secondary column is on the right.

Main content
<div class="flank is-reversed" style="--flank-width: 12rem">
        <div class="docs-box">Main content</div>
        <aside class="docs-box">Secondary</aside>
    </div>

Reference

Source: src/css/composition.css

Applies to

.flank

Classes

ClassKindDescription
.is-reversedvariantReverses the secondary and main columns, expecting the smaller column on the right

Slots

SlotDescription
.flank > :first-childThe secondary (smaller) column
.flank > :last-childThe main (larger) column

Tokens

TokenDefaultDescription
--flank-gapvar(--space-lg)Gap between the secondary and main columns
--flank-width20remFlex basis for the secondary column
--flank-content-min50%Minimum width before wrapping to single column