Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NuxtUI component classes not picked up by tailwind #3402

Closed
roseyda opened this issue Feb 25, 2025 · 4 comments
Closed

NuxtUI component classes not picked up by tailwind #3402

roseyda opened this issue Feb 25, 2025 · 4 comments
Labels
bug Something isn't working duplicate This issue or pull request already exists v3 #1289

Comments

@roseyda
Copy link

roseyda commented Feb 25, 2025

Environment

Tested on latest macOS
"@nuxt/ui": "3.0.0-alpha.13",
"nuxt": "^3.15.4"
"packageManager": "pnpm@10.5.0"

Is this bug related to Nuxt or Vue?

Nuxt

Version

3.15.4

Reproduction

Create a new project using nuxt UI starter using :
npx nuxi init -t ui3 <my-app>

Description

Create a new project using nuxt UI starter usiing :
npx nuxi init -t ui3 <my-app>

All tailwind classes used in templates of the project vue files are properly picked up by tailwind.
However, tailwind classes use by nuxt/ui components are picked up by tailwind.

In this div of app/pages/index.vue file, 'gap-2' 'item-center' classes are properly available :
Image

But UButton compenent classes ('font-medium' 'inline-flex'...) are not availble :
Image

Which result in the folowing :
Image

Additional context

tested with pnpm

Logs

No error logged in the console
@roseyda roseyda added bug Something isn't working triage v3 #1289 labels Feb 25, 2025
@Xiradorn
Copy link

Hi to all. In the starter project in the main.css file (in alpha-13) there isn't the theme directive for generate css variables (probably in updating). The right code to fix this is:

@import "tailwindcss" theme(static);
@import "@nuxt/ui";

@theme static {
  --font-sans: 'Public Sans', sans-serif;
}

But also with this configuration, i have troubles with the component style as bug report. For example the normal UButton with color primary doesn't work properly

@alexi190
Copy link

The issue is in tailwind 4.0.8

"overrides": {
   "tailwindcss": "4.0.7",
   "@tailwindcss/node": "4.0.7",
   "@tailwindcss/postcss": "4.0.7",
   "@tailwindcss/vite": "4.0.7"
 }

fixed it

@roseyda
Copy link
Author

roseyda commented Feb 26, 2025

Tried @alexi190 solution.
It didn't worked while using pnpm (event after deleting node_module folder)
However, it worked fine using npm

@benjamincanac benjamincanac added duplicate This issue or pull request already exists and removed triage labels Feb 26, 2025
@benjamincanac
Copy link
Member

@roseyda With PNPM you can follow this: #3374 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists v3 #1289
Projects
None yet
Development

No branches or pull requests

4 participants