Hide a standard side sheet's scrim from 840px again
Plan step 36 review of 9dd527f3. The old view hid a standard sheet's
scrim with `expanded:hidden`; the stylesheet lost that rule (and the
render test lost its assertion), so an open standard sheet at 840px and
up laid a full-window scrim over the page it sits beside, one click from
closing. The rule is back, pinned by a test.
The same review: the scrim now fades out as well as in (with no closed
opacity, allow-discrete only held it at 32% for 200ms and then dropped
it); the modal sheet slides without the fade the old enter and leave
classes never had; it slides from its own edge in a right-to-left
document, which translate-x-full never did; the state rules match the
root's own sheet and scrim, so a sheet nested in an open one keeps its
state; the script's breakpoint is 840px, not 52.5rem, which disagreed
with the stylesheet's px query once the reader's text size grew; and
`width` and the standard sheet's cap are M3's 400px.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qwx5USif3wFFmxtHg5U1g9
This commit is contained in:
co-authored by
Claude Opus 5
parent
d86392fd47
commit
b6259d45f3
@@ -8,11 +8,11 @@
|
||||
|
||||
As a sheet it is modal: the page inert and still (`x-trap.inert.noscroll`), and it enters on
|
||||
emphasized decelerate rather than a spring — a sheet anchored to the edge that overshot would
|
||||
open a gap. M3's modal side sheet (NavigationDrawerTokens.kt-adjacent side-sheet sources;
|
||||
docs/reference/m3/components-actions-communication-containment.md § Side sheets): surface-
|
||||
container-low, a large corner on its inner edge, elevation 1; `side` `end` (the default) or
|
||||
`start`; `width` from `medium` (a caller's `class` would race the sheet's own — a compact
|
||||
window gets the full-bleed sheet).
|
||||
open a gap. M3's modal side sheet (docs/reference/m3/components-actions-communication-
|
||||
containment.md § Side sheets; Compose has no side-sheet token file): surface-container-low, a
|
||||
large corner on its inner edge, elevation 1; `side` `end` (the default) or `start`, mirrored
|
||||
in a right-to-left document; `width` from `medium`, 400px (M3's 400dp cap) unless it says
|
||||
otherwise — a compact window gets the full-bleed sheet.
|
||||
|
||||
As a **standard** side sheet (`standard`, from `expanded`) it is M3's other variant: co-planar
|
||||
with the content rather than over it — no scrim, no focus trap, nothing inert, 0dp elevation
|
||||
@@ -54,7 +54,7 @@
|
||||
'withCloseButton' => true,
|
||||
'closeOnEscape' => true,
|
||||
'withoutBackdropClose' => false,
|
||||
'width' => '25rem',
|
||||
'width' => '400px',
|
||||
'standard' => false,
|
||||
])
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
|
||||
// The side-sheet specs table caps the sheet at 400dp, which is where `width` already starts;
|
||||
// a wider one is the modal sheet's to take, not the co-planar standard sheet's.
|
||||
$sheetWidth = $standard ? "min({$width}, 25rem)" : $width;
|
||||
$sheetWidth = $standard ? "min({$width}, 400px)" : $width;
|
||||
|
||||
// M3 requires a close affordance; the prop can only ever add one, never take away the last
|
||||
// way out of the sheet. A standard sheet keeps no scrim and no trap from `expanded`, and
|
||||
@@ -81,7 +81,7 @@
|
||||
close() { this.open = typeof this.open === 'boolean' ? false : null; },
|
||||
@if ($standard)
|
||||
init() {
|
||||
const query = window.matchMedia('(width >= 52.5rem)');
|
||||
const query = window.matchMedia('(width >= 840px)');
|
||||
this.wide = query.matches;
|
||||
query.addEventListener('change', (event) => this.wide = event.matches);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user