Skip to content

Commit f845cb0

Browse files
Add viewport-aware max-height constraints and Material 3 scrollbar styling to Menu
- 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
1 parent cac9767 commit f845cb0

1 file changed

Lines changed: 24 additions & 2 deletions

File tree

labs/gb/components/menu/menu.scss

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,40 @@
3333

3434
&:popover-open,
3535
:host(:popover-open):has(&.menu-host) {
36-
position-area: end span-end;
3736
border: none;
37+
max-height: calc(100vh - 100px);
38+
position-area: end span-end;
3839
}
3940

4041
:host(:popover-open):has(&.menu-host) {
41-
overflow: visible;
4242
background: none;
43+
max-height: calc(100vh - 100px);
44+
overflow: visible;
4345
padding: 0;
4446
}
4547

4648
&.menu-host {
49+
max-height: inherit;
4750
overflow: auto;
51+
scrollbar-color: var(--md-sys-color-outline-variant) transparent;
52+
scrollbar-width: thin;
53+
54+
&::-webkit-scrollbar {
55+
width: 6px;
56+
}
57+
58+
&::-webkit-scrollbar-track {
59+
background: transparent;
60+
}
61+
62+
&::-webkit-scrollbar-thumb {
63+
background-color: var(--md-sys-color-outline-variant);
64+
border-radius: 9999px;
65+
}
66+
67+
&::-webkit-scrollbar-thumb:hover {
68+
background-color: var(--md-sys-color-outline);
69+
}
4870
}
4971

5072
.divider,

0 commit comments

Comments
 (0)