mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-12-04 23:32:54 +01:00
active menus and gap
This commit is contained in:
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>
|
||||
);
|
||||
})}
|
||||
|
||||
Reference in new issue
Block a user