Plan step 36 (navigation group, second stream): <x-toolbar>'s class
lists move into resources/css/components/toolbar.css, keyed on
data-md-toolbar (data-md-variant/-vertical/-vibrant/-rounded/
-toolbar-place) and data-md-toolbar-group/-toolbar-fab. The docked
form with a FAB (N-02's --material-bottom-bar clearance), the vertical
24dp margin (N-12), the standard toolbar's primary icon buttons
(N-13), and the rounded large-screen form with dividers from 840px
were all already correct; only their hooks, units and layer needed to
change. The file no longer sits outside every layer: button.css and
fab.css now draw their own ink through data-md-* attributes rather
than a Tailwind utility, so a toolbar's more specific selector always
beats their single base color/background-color/box-shadow declaration
without needing to escape the cascade layers.
Sizes stay px (64px row, 40px divider); spacing goes through the
measurement tokens where one matches the value (4px leading/trailing
gap, 16/32px docked spread, 8px floating ends, 16/24px placed
margins).
Hooks renamed: every unprefixed data-toolbar* attribute to data-md-*,
updated in tests/Feature/Components/{AppBarTest,ToolbarTest}.php and
tests/Browser/BarsTest.php. toolbar.js needed no change: it reads the
bar through $root and role="toolbar", not by hook name.
Carry-over from the app-bar step: layout/pane.css now imports
app-bar.css and button.css for the pane's own top app bar and back
button, now that both are rewritten. That import crosses into
material.components for the first time from a layout file, so
tests/Feature/StylesheetsTest.php's two layout-shape checks now skip
non-`layout/` files reached through it — each already covered by its
own group's stylesheet test.
Added the owed browser tests (docs/plans/material-3-browser-tests.md):
a docked toolbar clear of the navigation bar below medium, and the
rounded form with its divider height from 840px, clear of the
window's edges.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qwx5USif3wFFmxtHg5U1g9
76 lines
3.0 KiB
CSS
76 lines
3.0 KiB
CSS
/*
|
||
* <x-pane>: 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 <x-surface> 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);
|
||
}
|
||
}
|