NavgiationMenu gets wrapped in a primitive div at runtime that I cannot styled (forces centered content) #5803
Closed
imprisonedmind
started this conversation in
General
Replies: 1 comment 1 reply
-
@imprisonedmind To achieve this layout, I'd keep the Using this structure, the width of the <header
className={` ${
scrolled &&
'border-b-neutral-10 border-b border-neutral-200 shadow-lg shadow-neutral-500/5'
} sticky top-0 z-50 mx-auto flex bg-neutral-50 p-4 px-2 duration-150 ease-in-out md:px-4`}
>
<Logo />
<div className="flex-1 bg-green-100 flex justify-center">
<NavigationMenu className="bg-red-100 w-auto">
<NavigationMenuList>
<NavbarLinkList />
</NavigationMenuList>
</NavigationMenu>
</div>
<CtaButton callback={() => console.log('pressed')} title={'Contact us'} />
</header> I added OpiUfCVk.mp4 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Following is my setup in attempt to w-full and justify-between my NavigationMenu
What I am trying to do is make the menu the full width of the DOM and have 3 content items evenly spread across.
Some modifications to NavigationMenu & List (nothing major, just styling)
The following is what I end up with at runtime:
My NavigationList gets wrapped in a primitive div that forces content to be w-fit.
If I pull the ul (NavigationMenuList) out of the primitive div I get what I expect
Why am I getting this unexpected div and how to style it?
If anyone has any ideas as to where this div is coming from (I assume radix) and how I can style it to w-full, please let me know.
Reproduced Link:
https://stackblitz.com/edit/stackblitz-starters-6pz3ey?file=components%2Fnavbar%2Fnavbar.tsx
My current workaround:
Currently, in order to work around this, I am using globals to select the injected div and force it to w-full.
I would really prefer to understand what is happening in the context above and not have to use this workaround.
Beta Was this translation helpful? Give feedback.
All reactions