/* * : a content region, with M3's margins and, optionally, a top app bar of its own. * * M3 puts all content in panes (docs/reference/m3/foundations.md § Layout → Scaffold, "all content * must live in a pane") and lets each carry its own app bar. The margin is the space between the * window's edge and what is inside: 16px below medium and 24px from it (600px), from the * per-breakpoint table in docs/reference/m3/foundations-supplement.md § Breakpoints, as * `--md-sys-measurement-space200` and `space300`. * * The margin sits on the pane's body and its section navigation, not on the pane: the app bar is a * direct child of the pane, so it spans the pane from edge to edge and its `position: sticky` holds * for the pane's whole height (a sticky element never leaves its parent). A margin is drawn once: * a region that already keeps its content off the window's edge — a pane's body, the canonical * layouts, the scaffold's content region — sets `--md-layout-margin` to 0px for what is inside it, * and a pane there draws none of its own, until an gives it a new edge to keep off. * * `data-md-width` caps the pane and centres it: `narrow` 40rem, M3's 40–60 characters a line * (§ Layout → Breakpoints, "keep text to 40–60 characters per line"), in rem because it is a measure * of text; `medium` 60rem and `wide` 80rem are the package's steps above it; `full` (the default) * fills the room it has, M3's flexible pane. The back button of `data-md-pane-back` points the * way it goes, so it mirrors in a right-to-left document (§ Layout → Bidirectionality / RTL). * * In `material.layout`; `hide-below`/`hide-from` come from visibility.css. Imports app-bar.css and * button.css for the pane's own top app bar and its back button (plan step 36 carry-over). */ @layer material.reset, material.tokens, material.base, material.layout, material.components, material.text, material.visibility; @import './visibility.css'; @import '../components/app-bar.css'; @import '../components/button.css'; @layer material.layout { [data-md-pane] { display: flex; flex-direction: column; inline-size: 100%; min-inline-size: 0; margin-inline: auto; } [data-md-pane][data-md-width='narrow'] { max-inline-size: 40rem; } [data-md-pane][data-md-width='medium'] { max-inline-size: 60rem; } [data-md-pane][data-md-width='wide'] { max-inline-size: 80rem; } [data-md-pane-navigation], [data-md-pane-body] { padding-inline: var(--md-layout-margin, var(--md-sys-measurement-space200)); @media (width >= 600px) { padding-inline: var(--md-layout-margin, var(--md-sys-measurement-space300)); } } [data-md-pane-body] { flex: 1 1 auto; min-inline-size: 0; } [data-md-pane-body] > * { --md-layout-margin: 0px; } [data-md-pane-back] [data-md-icon]:dir(rtl) { transform: scaleX(-1); } }