tailwindcss.config.ts is not loaded in a nuxt 3 project. #18753
-
Minimal Reproductionhttps://github.com/Gianthard-cyh/nuxt-tailwind-issue Environment
Current Configurationtailwind.config.ts: import type { Config } from 'tailwindcss'
console.log("tailwindcss config loaded")
export default <Config>{
content: [
'./components/**/*.{js,vue,ts}',
'./layouts/**/*.vue',
'./pages/**/*.vue',
'./plugins/**/*.{js,ts}',
'./nuxt-app.{js,ts}',
'app.vue'
],
theme: {
extend: {
boxShadow: {
soft: '0 10px 20px 0 rgba (0, 0, 0, 0.05)',
}
}
},
plugins: [],
} nuxt.config.ts: import tailwindcss from "@tailwindcss/vite";
export default defineNuxtConfig({
compatibilityDate: '2025-07-15',
devtools: { enabled: true },
css: [
'~/assets/css/tailwind.css',
],
vite: {
plugins: [
tailwindcss()
]
},
}) Steps to Reproduce
<template>
<div class="shadow-soft p-4 bg-white rounded">
Test content
</div>
</template>
Expected BehaviorThe shadow-soft class should be compiled and apply the CSS rule: .shadow-soft {
box-shadow: 0 10px 20px 0 rgba(0, 0, 0, 0.05);
} Actual Behavior
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
You are using Tailwind v4, and as such, it does not use a @import "tailwindcss";
@theme {
--shadow-soft: 0 10px 20px 0 rgba (0, 0, 0, 0.05);
} |
Beta Was this translation helpful? Give feedback.
-
Solved by adding https://tailwindcss.com/docs/upgrade-guide#using-a-javascript-config-file |
Beta Was this translation helpful? Give feedback.
You are using Tailwind v4, and as such, it does not use a
tailwind.config.ts
file that you seem to be expecting. Rather, configuration is done in CSS. As per the documentation, to add a custom shadow theme token: