No utility classes were detected in your source files ,double-check the `content`

Viewed 1405

I am trying to setup tailwind 3 , but i got the next warning .

No utility classes were detected in your source files. If this is unexpected, double-check the `content` option in your Tailwind CSS configuration.

this is my project structure

-public : index.html , output.css ( this css file generated after i run this command line

npx tailwindcss -i ./src/input.css -o ./public/output.css --watch

-src : input.css

tailwind.config.js

/** @type {import('tailwindcss').Config} */
module.exports = {
  content: ["./src/**/*.{html,js}"],

  theme: {
    extend: {},
  },
  plugins: [],
}
2 Answers

According to your code, your html files are in the src folder (and sub-folders)

  • Put your html files in the public folder and properly link it with output.css
  • Then run npx tailwindcss -i ./src/input.css -o ./public/output.css --watch

You can also clone the Tailwind boilerplate I made using

git clone https://github.com/abrahamebij/tailwind-boilerplate

Then npm install and npm run css

This is worked for me. in tailwind.config.js, change your folder name "src" to "public" or you need to put your files to "src" folder

Related