From 94aab8c9047496f1756161e5717694503e6823de Mon Sep 17 00:00:00 2001 From: Material Web Team Date: Mon, 24 Aug 2026 14:30:10 -0700 Subject: [PATCH] feat(menu): add viewport-aware max-height constraints and scrollbar styling - Update core Menu stylesheet (menu.scss) to set max-height: calc(100vh - 100px) on popover host and max-height: inherit on .menu.menu-host - Add Material 3 floating pill scrollbar styles (6px rounded thumb, transparent track) to core Menu container PiperOrigin-RevId: 970083346 --- labs/gb/components/menu/menu.scss | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/labs/gb/components/menu/menu.scss b/labs/gb/components/menu/menu.scss index 69e5c73578..c6ac18c2bb 100644 --- a/labs/gb/components/menu/menu.scss +++ b/labs/gb/components/menu/menu.scss @@ -33,18 +33,40 @@ &:popover-open, :host(:popover-open):has(&.menu-host) { - position-area: end span-end; border: none; + max-height: calc(100vh - 100px); + position-area: end span-end; } :host(:popover-open):has(&.menu-host) { - overflow: visible; background: none; + max-height: calc(100vh - 100px); + overflow: visible; padding: 0; } &.menu-host { + max-height: inherit; overflow: auto; + scrollbar-color: var(--md-sys-color-outline-variant) transparent; + scrollbar-width: thin; + + &::-webkit-scrollbar { + width: 6px; + } + + &::-webkit-scrollbar-track { + background: transparent; + } + + &::-webkit-scrollbar-thumb { + background-color: var(--md-sys-color-outline-variant); + border-radius: 9999px; + } + + &::-webkit-scrollbar-thumb:hover { + background-color: var(--md-sys-color-outline); + } } .divider,