Repository navigation
fix(BottomSheet): give the sheet one uniform edge against the scrim - #5305
Merged
Merged
Conversation
…dark mode The sheet separated itself from the scrim with its surface fill and a `--shadow-high` drop shadow. In light mode that reads: white on a darkened page. In dark mode it does not. `--color-background-surface` is #1F1F22 and the scrim resolves to about #111112, and the shadow is black on near-black, so it adds no edge at all. Measured across the sheet's left edge in Chromium at 1000px wide: 1.16:1 boundary contrast in dark against 2.89:1 in light. Past 640px the sheet is centred at its max width, so those left and right edges are the whole outline, and they simply were not there. Draw a `--border-width` / `--color-border` hairline on the three edges that face the scrim. MobileNav, the other scrim-backed surface drawer, already does exactly this on its scrim-facing edge; BottomSheet just never picked it up. The block-end edge is left bare: it sits below the viewport under the overscroll padding, so a border there would never paint. Light mode is unchanged to the eye (the hairline is a 10%-alpha ink on white, invisible against the scrim step); dark mode now shows the top corners and both sides.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
github-actions
Bot
requested review from
cvkxx,
ernestt,
kentonquatman and
rubyycheung
August 21, 2026 21:56
Contributor
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR Modified ComponentsBottomSheet (@astryxdesign/core) · View in Storybook
Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
… ring The hairline in the previous commit gave the sheet an edge against the scrim, but it did not make that edge uniform. Every bundled theme packs an inset ring into `--shadow-high` for dark mode -- neutral's is `inset 0 0 0 1px oklch(1 0 0 / 15%)`, deliberately dark-only. An inset shadow paints above the element's own background but below its children, so an opaque content wrapper flush to the inner edge paints over it. `Section`, the wrapper the BottomSheet showcase and most real sheets use, has an opaque `--color-background-surface` background and does exactly that. The result: the ring is hidden for as far as the content runs, then appears in the empty area below it. On the docs site, sampling the left edge in dark mode gives `2,2,2 | 60,60,60 | 38,38,38` above the content end and `2,2,2 | 60,60,60 | 71,71,71` below it -- a second light line that switches on partway down the sheet and reads as the border changing width. Have the scrolling body paint the surface across the sheet's whole inner box. It covers the ring evenly, and the border -- which paints outside the padding box, where no child can reach -- is left as the sheet's one edge, in themed and unthemed dark mode alike. Verified on the docs site: the left and right edges now sample identically above and below the content end in both modes. The body is the only in-flow child and fills the inner box, and the floating handle bar is positioned, so it still paints above.
imdreamrunner
enabled auto-merge (squash)
August 21, 2026 23:08
4 tasks done
imdreamrunner
added a commit
that referenced
this pull request
Oct 6, 2026
The scrolling content area becomes a container publisher, mirroring the BottomSheet container design (#6883): a padding prop on Dialog's spacing-step scale, theme padding on 'drawer' expanded to --astryx-drawer-padding* container tokens, and the released full-bleed default preserved — edge chains terminate at 0px and Layout inset chains have no terminal value, so an unthemed drawer is pixel-identical to before. The block-end edge adds the home-indicator safe area on top of the container inset in every mode, and the content area now paints the surface so a dark-mode inset ring in --shadow-high no longer changes the panel edge partway down (the #5305 treatment). A lone Section child escapes the inset, bleed children such as an isFullBleed Divider compensate against it, and a Layout inside picks it up for its header, content, and footer regions — verified in Chromium against the built Storybook, light and dark, including inset parity with the same Layout composition inside a Dialog. Core gains the drawer chains in container.stylex.ts, a drawer entry in derivedVarRegistry (doc source of truth lives in packages/lab), and Layout re-exports of the explicit-padding lowering maps that lab needs. Drawer.spec.md records the candidate contract (FR16/DEC-2, pending owner approval) and the open questions: the default inset, loose DrawerHeader compensation, and explicit-padding safe-area semantics.
imdreamrunner
added a commit
that referenced
this pull request
Oct 8, 2026
The scrolling content area becomes a container publisher with Dialog's
contract: a padding prop on Dialog's spacing-step scale, theme padding on
'drawer' expanded to --astryx-drawer-padding* container tokens, and a
--spacing-4 default shared by the edge and Layout inset chains, exactly as
in Dialog. Headers compose as in Dialog: DrawerHeader sits in a Layout
header slot, and the Layout redistributes the inset to its regions, so the
header lines up with the body and is not inset twice. The docsite blocks,
stories, and doc snippets move to that composition; padding={0} keeps a
full-bleed content area, which the two sandbox audit drawers use because
their details carry their own padding.
The block-end edge adds the home-indicator safe area on top of the
container inset in every mode, and the content area now paints the surface
so a dark-mode inset ring in --shadow-high no longer changes the panel edge
partway down (the #5305 treatment).
Core gains the drawer chains in container.stylex.ts, a drawer entry in
derivedVarRegistry (doc source of truth lives in packages/lab), and Layout
re-exports of the explicit-padding lowering maps that lab needs.
Drawer.spec.md records the contract as DEC-2 (owner decision) and FR16.
imdreamrunner
added a commit
that referenced
this pull request
Oct 8, 2026
The scrolling content area becomes a container publisher with Dialog's
contract: a padding prop on Dialog's spacing-step scale, theme padding on
'drawer' expanded to --astryx-drawer-padding* container tokens, and a
--spacing-4 default shared by the edge and Layout inset chains, exactly as
in Dialog. Headers compose as in Dialog: DrawerHeader sits in a Layout
header slot, and the Layout redistributes the inset to its regions, so the
header lines up with the body and is not inset twice. The docsite blocks,
stories, and doc snippets move to that composition; padding={0} keeps a
full-bleed content area, which the two sandbox audit drawers use because
their details carry their own padding.
The block-end edge adds the home-indicator safe area on top of the
container inset in every mode, and the content area now paints the surface
so a dark-mode inset ring in --shadow-high no longer changes the panel edge
partway down (the #5305 treatment).
Core gains the drawer chains in container.stylex.ts, a drawer entry in
derivedVarRegistry (doc source of truth lives in packages/lab), and Layout
re-exports of the explicit-padding lowering maps that lab needs.
Drawer.spec.md records the contract as DEC-2 (owner decision) and FR16.
imdreamrunner
added a commit
that referenced
this pull request
Oct 8, 2026
The scrolling content area becomes a container publisher with Dialog's
contract: a padding prop on Dialog's spacing-step scale, theme padding on
'drawer' expanded to --astryx-drawer-padding* container tokens, and a
--spacing-4 default shared by the edge and Layout inset chains, exactly as
in Dialog. Headers compose as in Dialog: DrawerHeader sits in a Layout
header slot, and the Layout redistributes the inset to its regions, so the
header lines up with the body and is not inset twice. The docsite blocks,
stories, and doc snippets move to that composition, and padding={0} keeps a
full-bleed content area.
The two sandbox audit drawers still passed hasCloseButton, which #6877
removed, so their non-modal panels had no visible close button. They now
compose DrawerHeader with onOpenChange in a Layout header slot, keep the
title as the focus target on open and on row switch, and reset the
LayoutContent scroller when the selected row changes.
The block-end edge adds the home-indicator safe area on top of the
container inset in every mode, and the content area now paints the surface
so a dark-mode inset ring in --shadow-high no longer changes the panel edge
partway down (the #5305 treatment).
Core gains the drawer chains in container.stylex.ts, a drawer entry in
derivedVarRegistry (doc source of truth lives in packages/lab), and Layout
re-exports of the explicit-padding lowering maps that lab needs.
Drawer.spec.md records the contract as DEC-2 (owner decision) and FR16.
imdreamrunner
added a commit
that referenced
this pull request
Oct 8, 2026
The scrolling content area becomes a container publisher with Dialog's
contract: a padding prop on Dialog's spacing-step scale, theme padding on
'drawer' expanded to --astryx-drawer-padding* container tokens, and a
--spacing-4 default shared by the edge and Layout inset chains, exactly as
in Dialog. Headers compose as in Dialog: DrawerHeader sits in a Layout
header slot, and the Layout redistributes the inset to its regions, so the
header lines up with the body and is not inset twice. The docsite blocks,
stories, and doc snippets move to that composition, and padding={0} keeps a
full-bleed content area.
The two sandbox audit drawers still passed hasCloseButton, which #6877
removed, so their non-modal panels had no visible close button. They now
compose DrawerHeader with onOpenChange in a Layout header slot, keep the
title as the focus target on open and on row switch, and reset the
LayoutContent scroller when the selected row changes.
The block-end edge adds the home-indicator safe area on top of the
container inset in every mode, and the content area now paints the surface
so a dark-mode inset ring in --shadow-high no longer changes the panel edge
partway down (the #5305 treatment).
Core gains the drawer chains in container.stylex.ts and a drawer entry in
derivedVarRegistry (doc source of truth lives in packages/lab). Lab reads the
explicit-padding lowering maps from the existing
@astryxdesign/core/Layout/padding.stylex subpath, so the core root exports
are unchanged.
Drawer.spec.md records the contract as DEC-2 (owner decision) and FR16.
imdreamrunner
added a commit
that referenced
this pull request
Oct 9, 2026
The scrolling content area becomes a container publisher with Dialog's
contract: a padding prop on Dialog's spacing-step scale, theme padding on
'drawer' expanded to --astryx-drawer-padding* container tokens, and a
--spacing-4 default shared by the edge and Layout inset chains, exactly as
in Dialog. Headers compose as in Dialog: DrawerHeader sits in a Layout
header slot, and the Layout redistributes the inset to its regions, so the
header lines up with the body and is not inset twice. The docsite blocks,
stories, and doc snippets move to that composition, and padding={0} keeps a
full-bleed content area.
The two sandbox audit drawers still passed hasCloseButton, which #6877
removed, so their non-modal panels had no visible close button. They now
compose DrawerHeader with onOpenChange in a Layout header slot, keep the
title as the focus target on open and on row switch, and reset the
LayoutContent scroller when the selected row changes.
The block-end edge adds the home-indicator safe area on top of the
container inset in every mode, and the content area now paints the surface
so a dark-mode inset ring in --shadow-high no longer changes the panel edge
partway down (the #5305 treatment).
Core gains the drawer chains in container.stylex.ts and a drawer entry in
derivedVarRegistry (doc source of truth lives in packages/lab). Lab reads the
explicit-padding lowering maps from the existing
@astryxdesign/core/Layout/padding.stylex subpath, so the core root exports
are unchanged.
Drawer.spec.md records the contract as DEC-2 (owner decision) and FR16.
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bottom sheet's edge against the scrim was wrong in dark mode in two ways.
1. Unthemed: no edge at all
The sheet separates itself from the scrim with its surface fill plus a
--shadow-highdrop shadow. In light mode that reads: white on a darkened page. In dark mode it does not —--color-background-surfaceis#1F1F22, the scrim resolves to about#111112, and the shadow is black on near-black.Measured across the left edge in Chromium, sheet open:
144,153,164255,255,25516,16,1831,31,34Past 640px the sheet is centred at its max width, so the left and right edges are the whole outline.
2. Themed: an edge that changed width partway down
Every bundled theme packs an inset ring into
--shadow-highfor dark mode — neutral's isinset 0 0 0 1px oklch(1 0 0 / 15%), deliberately dark-only. An inset shadow paints above the element's own background but below its children, so an opaque content wrapper flush to the inner edge paints over it.Section— the wrapper the BottomSheet showcase and most real sheets use — has an opaque--color-background-surfacebackground and does exactly that.So the ring is hidden for as far as the content runs, then switches on in the empty area below it. Sampling the left edge on the docs site in dark mode:
2,2,260,60,6038,38,382,2,260,60,6071,71,71A second light line appearing partway down, which reads as the border changing width.
Fix
--border-width/--color-borderhairline on the three scrim-facing edges.MobileNav, the other scrim-backed surface drawer, already does this on its scrim-facing edge; BottomSheet never picked it up. A border paints outside the padding box, where no child can reach. The block-end edge is left bare — it sits below the viewport under the overscroll padding.Result
Left and right edges sample identically above and below the content end, in dark and light, themed and unthemed. Light mode is unchanged to the eye — the hairline is a 10%-alpha ink on white.
Test plan
BottomSheetPanel.test.tsxcases: the hairline on the three scrim-facing edges (and its absence on the block-end edge), and the body's surface fill. Negative control: deleting one of the three border declarations fails the first.pnpm lint:strict(0 errors),vitest run packages/core packages/lab(7504),vitest run packages/cli apps(2801),pnpm build, the fullbuild-storybooktypecheck stack, andpnpm lab:readiness:checkall pass.Follow-up: the body-background half of this fix is a workaround, not a proper fix — the root cause is that themes pack the dark-mode inner ring into the shadow tokens, where any opaque child erases it. A component can't fix that locally. Filed as #5308 for discussion; the durable answer is likely a
--surface-ringtoken applied as a border.