NuxtN
Nuxt2mo ago
4 replies
m_andrasch

Use tailwind.config.js instead of CSS config in Nuxt UI v4?

I have an existing project with latest Nuxt v3.20.2, which is using nuxt/tailwind already.

The config is done in tailwind.config.js

So far, @apply works in imported .css files as well.

We now want to integrate Nuxt UI v4.

Therefore we removed nuxt/tailwind.

For <style scoped> tags, I could fix some build errors with using <style lang="postcss" scoped>

When running
npm run build
, we now face these build errors for @apply and stuff in .css files:

[nuxi 4:19:02 PM]  ERROR  Nuxt Build Error: [@tailwindcss/vite:generate:build] Could not resolve value for theme function: theme(colors.link-color).


I would assume, this is because the tailwind.config.js is not picked up anymore, because we define stuff like `colors.link-color´.

Do we have to convert our tailwind config to the new CSS configuration style from Tailwind v4? Or is there a way to use the legacy config style?
Was this page helpful?