Table of contents
Layout
layout.css owns where a page's regions go and how they collapse.
A page composes from its parts; its own sheet styles what the
content looks like, never where it goes or when it stacks. That
is the whole rule, and TestFrameworkPageSheetsMeasureTheirOwnSpace
holds it for every page on the framework.
Three rules
- Measure the space you have, not the window. A framework page
wraps its content in
.l-page, and the console measures itself. Both are size containers. Use the parts below, or a container query (@container page (…)or@container console (…)), when something must change with width. Never a window-width@mediain a page sheet: the sidebar opens, collapses and hides, so the window says nothing about the page's room. - Collapse into something usable. Fitting is not enough. When a page runs out of room it shows fewer things, never a longer stack of everything: one level of a console at a time, the pane's search and filters at its top, an obvious way back.
- Nothing fixed inside a page. A size container is the
containing block for fixed children. Overlays inside
.l-pageuse the console drawer or the top layer (the modal, the sheets).
The frame
- The top bar, the sidebar and the bottom bar are the shell (base.html). They are glass.
- The sub-nav (
.subnav) docks under the top bar: the section's tabs (see "Section tabs"). Glass. - The page body is solid (
--surface-page): dense text and tables sit on an opaque ground. Glass is for the frame and for things that float (menus, sheets, drawers). - In-page sticky bars park on
--l-top(under the top bar and the sub-nav), never on a literal height.
Tokens
- Spacing:
--space-1to--space-6and--gutter, each fluid between a floor and a ceiling. Use them for gaps and padding instead of fixed rem values that jump at breakpoints. - Surfaces:
--surface-page(the body),--surface-pane(a console),--surface-float(drawers, bars, anything over content),--surface-inset(a box inside a pane),--hairline. - Selection:
--sel-bg,--sel-edgeand--sel-row, all from the theme's accent, so every scheme and the light theme highlight in their own colour. Never a fixed colour for "selected". --tap: the smallest touch target (2.75rem).
Arrangement patterns
Each arranges its children from the space it has, with custom properties as knobs and no media queries:
.l-stack: a column with one gap (--l-gap)..l-cluster: a wrapping row of controls or chips;.l-pushsends one to the far end..l-switcher: side by side while each child gets--l-min, all stacked once one would not. Never a ragged split..l-sidebar: a side of--l-sidebeside a main that wraps under when it would drop below--l-main-min..l-sidebar--endputs the side on the right.
Page parts
.l-page: the page's container. Everything below measures it..l-head: the page head under the title..l-head-pickholds the page's character or scope picker,.l-head-sumis the one-line summary,.l-head-actholds the scope control and the primary action at the far end..l-tiles: a row of stat tiles that steps 4, 2, 1 (or 3, 1, or 6, 3, 1). It counts its own tiles, so conditional tiles need nothing extra, and a row never splits 3 and 1..l-grid: the 12-track grid (Home's widget grid, generalized). Cells take.s3to.s9(full width otherwise); under 52rem it is 6 tracks with every cell at least half, under 34rem one column..l-panel: the standard solid block on the page..l-root: page content that belongs to the top level (summary cards, overview tables, banners). On a narrow page it steps aside once the reader goes below the console's top level (the directory, or the list when the console has no directory), so the deeper screen starts under the page head.
The console
The master-detail page: a directory, a main pane and an inspector. Assets and the Character overview are the worked examples.
<div class="l-console" data-depth="1" data-land-top>
<div class="l-panes">
<nav class="l-pane l-pane--dir">
<div class="l-pane-bar"><h2 class="l-pane-title">…</h2> …filter…</div>
… entries, each <a … data-l-step="in"> …
</nav>
<section class="l-pane l-pane--main">
<div class="l-pane-bar"><a class="l-back" data-l-step="out" href="…">Directory</a> …search…</div>
…
</section>
<aside class="l-pane l-pane--insp">…</aside>
<a class="l-scrim" href="…close…" aria-label="Close" tabindex="-1"></a>
</div>
</div>
- Depth comes from the URL. The page renders
data-depth: 0 with nothing picked (the directory is the reader's place), 1 with a directory entry open, 2 with a row open in the inspector. The server already knows this from the query; no script decides it. - The console shows as many panes as fit, always the deepest. 70rem and up: all three side by side (the inspector's column opens with it). 46 to 70rem: directory and main, and an open inspector is a drawer over the main pane with a scrim that closes it. Under 46rem: one pane, the reader's own level.
- Every pane has a bar.
.l-pane-baris its top: sticky, and the home of the pane's search and filters, so they stay at the top in every form..l-backin the bar returns one level; it shows only while the pane it returns to is off screen, so it is the native back control on a phone and invisible on a desktop..l-closecloses a drawer. - Level links carry
data-l-step(inorout). With one pane showing they land at the console's top like a new screen; side by side they keep the reader's place (swap.js). - An ambient inspector (
data-insp="ambient"on the console) is one that shows a default detail before anything is picked. It takes the third column in the wide form and stays out of the way in the others until a pick opens it. - Column widths are the page's: set
--l-dirand--l-inspon its.l-panes. - Without JS every level is a plain link and the server renders the right one.
Checking a page
A page is done when it is right at every width, not at three. Sweep it from 320 to 1600px in 20px steps, with the sidebar open, collapsed and hidden: zero page-level sideways overflow, zero panels or tables painting outside their box. Then walk it on a phone width as a reader would: the first screen answers the page's question, every pick opens a screen that starts at its top, back returns, and search is where the thumb expects it.