I am working with Tailwind CSS in a Nextjs project. I have tried a simple heading but styles are not being applied.
Here is my full code on GitHub: https://github.com/mennaElbadry70/TailwindCss_practice
- I have checked the
tailwind.config.ts
file but the paths should be correct. - I have fixed previous errors regarding
@tailwind base
,@tailwind components
and@tailwind utilities
. - I have installed the PostCSS extension in case that affects the Tailwind implementation.
2
Answers
You have a
tailwind.config.js
file which Tailwind will prioritize and use. This means yourtailwind.config.ts
is ignored. Consider either:tailwind.config.js
file so that Tailwind uses thetailwind.config.ts
filetailwind.config.ts
to thetailwind.config.js
file and then deleting thetailwind.config.ts
file.I was in the same situation and I think it’s the configuration in the tailwing.config.js file. you would have to change it so that it targets all the files in your workspace.
you have to change it from this
to this