Radix Navigation Menu & Modal classes showing up as unused CSS in Tailwind v3 with Next.js 14 #18865
Unanswered
Viswaksena-J
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I’m using Radix Navigation Menu with TailwindCSS v3 in a Next.js 14 project. I’ve noticed that the menu content and menu item classes (as well as classes applied inside modals) are being marked as unused CSS in Chrome DevTools Coverage.
When I open the modal or header (which triggers the Radix Navigation Menu), the unused bytes decrease. This seems to be happening because the DOM re-renders and those classes are only injected at runtime.
However, I’ve observed that other websites using Radix menus and modals don’t have this issue — their coverage doesn’t show these classes as unused. Even with plain modals, the classes are still being counted as unused CSS on my project.
Question:
Is there a way to ensure these Radix Navigation Menu and modal classes are always included in the used CSS set? Or is there a recommended approach to prevent them from being flagged as unused in TailwindCSS v3 with Next.js?
Beta Was this translation helpful? Give feedback.
All reactions