no utility detected classes in your files in tailwindcss
Hello, I am learning Tailwind CSS, and I think I've finished installing everything. The problem is that an unexpected error is occurring - my source files aren't being detected.
I'm not sure if the way I organized my HTML and CSS has any effect on this. I just wanted them to be separated for better organization. But when I try to run npm run build, it's not able to detect them.
I did check the tailwind.config.js file, but I don't really understand how to adjust the content.
Could you please help me and explain what mistakes I might have made or leave a comment in my live code? Thank you.
I have shared my live code so you can have a closer look and identify the issues. Thank you.
https://prod.liveshare.vsengsaas.visualstudio.com/join?B512DA27795BB5259B28FFC307FB88FE1922
Visual Studio Code for the Web
Build with Visual Studio Code, anywhere, anytime, entirely in your browser.
8 Replies
The content section of your tailwind.config.js specifies that all content is in the src folder, but your only item in that folder is input.css.
don't you need to feed it the html? It's trying to treeshake tailwind to only include classes you used, but you're not telling it where to see what you used
Thank youu sir @chooking and @Jochem It's okay now, sir. Thank you.
and also add question In the content part, is there an explanation why there are these (* * )? "./src/**/.{html,js}"
The ** matches any subdirectory of src.
**
is shorthand for "any or no directory", then *.{html,js}
is shorthand for any HTML or JS fileoh, okay sir thank you very much!β€οΈ