active menus and gap

This commit is contained in:
tresabhi committed 2026-12-03 23:26:03 -06:00
1 parent 37df4675c0
commit d7743ac32a
2 files changed
+21 -9

No files matched your search

@@ -15,12 +15,20 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
margin: var(--space-4);
box-shadow: var(--shadow-subtle); box-shadow: var(--shadow-subtle);
border-radius: var(--space-4); border-radius: var(--space-4);
outline: var(--outline-interactive) !important; outline: var(--outline-interactive) !important;
/* Keeps top-level menus off the trigger and viewport edges */
&.Content {
margin: var(--space-4);
}
/* A narrower gap beside the parent on either side, keeping the top aligned with the trigger */
&.SubContent {
margin-inline: calc(2 * var(--space-0));
}
.viewport { .viewport {
flex: 1 1 auto; flex: 1 1 auto;
min-height: 0; min-height: 0;
@@ -74,7 +82,9 @@
font-size: var(--font-size-minor); font-size: var(--font-size-minor);
&:focus { /* Open submenus keep their trigger lit while focus moves into them */
&:focus,
&[data-state="open"] {
outline: none; outline: none;
background-color: var(--gray-5); background-color: var(--gray-5);
@@ -94,13 +94,15 @@ export function TankSearchSort() {
<CaretRightIcon /> <CaretRightIcon />
</DropdownMenu.SubTrigger> </DropdownMenu.SubTrigger>
<DropdownMenu.SubContent> <DropdownMenu.Portal>
{items.map((item) => { <DropdownMenu.SubContent>
if (!("name" in item)) return null; {items.map((item) => {
if (!("name" in item)) return null;
return <Item key={item.name} by={item.name} />; return <Item key={item.name} by={item.name} />;
})} })}
</DropdownMenu.SubContent> </DropdownMenu.SubContent>
</DropdownMenu.Portal>
</DropdownMenu.Sub> </DropdownMenu.Sub>
); );
})} })}