Repository navigation
feat(topnav): unified card appearance for mega menu without backdrop overlay - #379
Merged
Merged
Conversation
…overlay Removes the backdrop div from XDSTopNavMegaMenu that covered the entire positioned ancestor. Instead, the unified card look is achieved by coordinating styles between the wrapper and the panel: - Wrapper (user code) adjusts border-radius when menu opens via onOpenChange - Panel flows seamlessly below with matching background, bottom corners, a subtle top divider, and its own shadow - Nav items remain fully visible and interactive — no overlay covering them - Removed z-index stacking context hacks from TopNav sections (no longer needed without the backdrop) Co-authored-by: Navi <[email protected]>
rubyycheung
enabled auto-merge
February 27, 2026 04:25
rubyycheung
added this pull request to the merge queue
Feb 27, 2026
Contributor
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR Modified ComponentsTopNav · View in Storybook
Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Component PreviewsIncludes interactive hover previews as animated GIFs. XDSTopNavDefaultScreenshot: Interaction Preview: (view video) View in Storybook · Centered With Start ContentScreenshot: View in Storybook · Center Content Without EndScreenshot: View in Storybook · Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
This was referenced Mar 3, 2026
cixzhang
pushed a commit
that referenced
this pull request
Apr 26, 2026
…overlay (#379) Removes the backdrop div from XDSTopNavMegaMenu that covered the entire positioned ancestor. Instead, the unified card look is achieved by coordinating styles between the wrapper and the panel: - Wrapper (user code) adjusts border-radius when menu opens via onOpenChange - Panel flows seamlessly below with matching background, bottom corners, a subtle top divider, and its own shadow - Nav items remain fully visible and interactive — no overlay covering them - Removed z-index stacking context hacks from TopNav sections (no longer needed without the backdrop) Co-authored-by: Navi <[email protected]>
cixzhang
pushed a commit
that referenced
this pull request
Jun 21, 2026
…overlay (#379) Removes the backdrop div from XDSTopNavMegaMenu that covered the entire positioned ancestor. Instead, the unified card look is achieved by coordinating styles between the wrapper and the panel: - Wrapper (user code) adjusts border-radius when menu opens via onOpenChange - Panel flows seamlessly below with matching background, bottom corners, a subtle top divider, and its own shadow - Nav items remain fully visible and interactive — no overlay covering them - Removed z-index stacking context hacks from TopNav sections (no longer needed without the backdrop) Co-authored-by: Navi <[email protected]>
cixzhang
pushed a commit
that referenced
this pull request
Jun 21, 2026
…overlay (#379) Removes the backdrop div from XDSTopNavMegaMenu that covered the entire positioned ancestor. Instead, the unified card look is achieved by coordinating styles between the wrapper and the panel: - Wrapper (user code) adjusts border-radius when menu opens via onOpenChange - Panel flows seamlessly below with matching background, bottom corners, a subtle top divider, and its own shadow - Nav items remain fully visible and interactive — no overlay covering them - Removed z-index stacking context hacks from TopNav sections (no longer needed without the backdrop)
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.
Summary
Removes the backdrop div from
XDSTopNavMegaMenuand replaces it with a coordinated styling approach that creates the same unified card appearance without covering nav items.Problem
The backdrop div (introduced for the unified card look) covered the entire positioned ancestor at
z-index: 99, which required all nav sections to havez-index: 100stacking contexts to remain interactive. This was fragile and created layering complexity.Solution
Instead of an overlay, the unified card look is achieved by coordinating styles between the wrapper container and the dropdown panel:
onOpenChange): adjustsborder-radiusandbox-shadowwhen the menu opens — drops bottom radius so the nav bar flows seamlessly into the panelposition: relative+z-index: 100stacking context hacks (no longer needed)Changes
XDSTopNavMegaMenu.tsxelevationVarsimport.XDSTopNav.tsxposition: relativeandz-index: 100from section wrappers — no longer needed without backdrop.XDSTopNav.test.tsxmega-menu/page.tsxborder-radiuswhen menu opens, uses directional shadow to maintain top/side card chrome while panel provides bottom shadow.Test Plan