I'm new to Tailwind CSS and I'm looking to include it in my Django/FastAPI project.
I'm using Tailwind v4.0.17.
The problem I'm having is that Tailwind doesn't recognize the HTML tags I have in my template files.
I run the following command:
npx tailwindcss -i ./static/css/input.css -o ./static/css/output.css
This generates a CSS file for me, but it doesn't have all the classes in it... On the other hand, when I test with this command :
npx tailwindcss --content ./templates/test_endpoint.html --dry-run > output.css
This time, all the CSS classes of the HTML template are present in the output file, but not the others (those of the other HTML templates).
Here is the code for the tailwind.config.js file:
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
"./templates/**/*.html",
"./templates/*.html",
"templates/main/index.html",
"templates/base.html",
"./**/templates/**/*.html",
"./static/**/*.css",
"./fastapi_app/**/*.html",
"./main/**/*.html"
],
theme: {
extend: {},
},
plugins: [],
}
I've tried reinstalling Tailwind several times, changing the paths, trying other commands, and the result is always the same.
If you have any ideas on how to solve this problem, that would be great!