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;
flex-direction: column;
margin: var(--space-4);
box-shadow: var(--shadow-subtle);
border-radius: var(--space-4);
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 {
flex: 1 1 auto;
min-height: 0;
@@ -74,7 +82,9 @@
font-size: var(--font-size-minor);
&:focus {
/* Open submenus keep their trigger lit while focus moves into them */
&:focus,
&[data-state="open"] {
outline: none;
background-color: var(--gray-5);
@@ -94,13 +94,15 @@ export function TankSearchSort() {
<CaretRightIcon />
</DropdownMenu.SubTrigger>
<DropdownMenu.SubContent>
{items.map((item) => {
if (!("name" in item)) return null;
<DropdownMenu.Portal>
<DropdownMenu.SubContent>
{items.map((item) => {
if (!("name" in item)) return null;
return <Item key={item.name} by={item.name} />;
})}
</DropdownMenu.SubContent>
return <Item key={item.name} by={item.name} />;
})}
</DropdownMenu.SubContent>
</DropdownMenu.Portal>
</DropdownMenu.Sub>
);
})}