Subnav

Beside a sidebar that stays collapsed

A settings page with many sections: the main sidebar collapses to icons (data-collapsed="true") and the subnav lists the sections. The element after .subnav is the content and gets padding. Below 48rem the subnav sits above the content.

Attributes

Attribute / element Values Description
.subnav nav Section menu, 13rem wide. Add an aria-label.
h2 child Section title, medium weight
ul > li > a child Link: .icon + label in a span (bare a without a ul also works)
aria-current page On a: the open section
.subnav + * next element Content: fills the remaining space, with padding. From 48rem the parent lays out in a row with a divider on the right. Below that they stack with a divider underneath.
.sidebar[data-collapsed="true"] beside Main sidebar collapsed to icons. See the Sidebar page.