UI v3: Styling is off (no rounded corners)
Hi guys,
I just upgraded to Nuxt UI v3 following the migration guide. This worked so far, but I have one issue:
All components are missing the normal rounded corners. Do you have any idea why that is?
9 Replies
Hi @StormiCParK. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
In Nuxt UI v3, the border radius system has changed significantly. The issue you're experiencing with missing rounded corners is likely related to how border radius is now implemented.
Nuxt UI v3 uses a global CSS variable called
--ui-radius
for consistent border rounding across components. Components now use variations of this base value with calculations like rounded-[calc(var(--ui-radius)*2)]
to create different levels of roundness.
To fix your issue, you need to make sure this CSS variable is properly defined in your application. Here's how to set it up:
1. Make sure you have a main.css
file in your project (typically in app/assets/css/main.css
) that imports Tailwind CSS and Nuxt UI:
If you're using Nuxt UI Pro, use this instead:
2. Make sure this CSS file is imported in your nuxt.config.ts
:
The default value uses Tailwind's radius tokens, but you can customize it to your preference.
This change is part of the updated theming system in Nuxt UI v3, which now uses the Tailwind Variants API for styling components.
Border Radius Documentation provides more details on this new approach.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@146295316335820800> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
@StormiCParK Can you give more information, your main.css, nuxt.config or package.json for example ? 😁
main.css
Which version of NuxtUI are you using?
3.0.1
Here is my nuxt config
It looks like the "rounded" utility class is not working at all. A normal div with tha t class is also not rounded
You don't have to install the tailwind plugin, NuxtUI already does it for you automatically.
And could you also send me your tailwind config? By the way, why not do as recommended in tailwind v4 and put everything in your main.css?
Thanks for the tip with the plugin. I found the issue. It is something in the tailwind.config.ts. When I comment out the import of it, it works. I will migrate the config to the main.css part by part and probably find out the core issue.
Thank you very much for your time!!
Glad you found your bug and no problems 🙌