diff --git a/src/assets/icons/bars.svg b/src/assets/icons/bars.svg new file mode 100644 index 0000000000..9ad10944c1 --- /dev/null +++ b/src/assets/icons/bars.svg @@ -0,0 +1,3 @@ + diff --git a/src/assets/icons/close.svg b/src/assets/icons/close.svg new file mode 100644 index 0000000000..7e35d6fcd4 --- /dev/null +++ b/src/assets/icons/close.svg @@ -0,0 +1,3 @@ + diff --git a/src/components/Menu.astro b/src/components/Menu.astro index 5c7c58e821..0e6677760c 100644 --- a/src/components/Menu.astro +++ b/src/components/Menu.astro @@ -33,6 +33,8 @@ type Props = HTMLAttributes<'details'> & { align?: 'start' | 'end'; density?: 'default' | 'compact'; width?: string; + // Render inline rather than as a popup + inline?: boolean; }; const { @@ -41,6 +43,7 @@ const { align = 'start', density = 'default', width, + inline = false, class: className, ...rest } = Astro.props satisfies Props; @@ -73,14 +76,15 @@ const iconDetails = (name: string | undefined) => { 'menu', `menu--${align}`, density === 'compact' && 'menu--compact', + inline && 'menu--inline', className, ]} - style={width ? `--menu-width: ${width}` : undefined} - data-menu + style={width && !inline ? `--menu-width: ${width}` : undefined} + data-menu={inline ? undefined : ''} {...rest} > -