ui
ui copied to clipboard
Classname 'origin-top-center' is not a Tailwind CSS class
In the navigation-menu component, the 'origin-top-center' class is used in `NavigationMenuPrimitive.Viewport'. I have installed everything required in the installation instructions but my editor is still claiming it's not a valid class. I am not sure if this could have to do with the navbar dropdown not being centered or not, but it seems to be an error regardless. (if this is not responsible, how do I make the dropdown go underneath the button instead of stuck to the left?)
const NavigationMenuViewport = React.forwardRef<
React.ElementRef<typeof NavigationMenuPrimitive.Viewport>,
React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Viewport>
>(({ className, ...props }, ref) => (
<div className={cn("absolute left-0 top-full flex justify-center")}>
<NavigationMenuPrimitive.Viewport
className={cn(
"origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border border-slate-200 bg-white shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=open]:zoom-in-90 data-[state=closed]:zoom-out-95 dark:border-slate-700 dark:bg-slate-800 md:w-[var(--radix-navigation-menu-viewport-width)]",
className
)}
ref={ref}
{...props}
/>
</div>
));

The Classname 'origin-top-center' is not a Tailwind CSS class
linter error was resolved by adding
"tailwindcss/no-custom-classname": "off"
to my eslint config.
However, I still cant seem to center my dropdown.