每当我试图安装TailwindCSS我得到了一个错误说
warn - No utility classes were detected in your source files. If this is unexpected, double-check the `content` option in your Tailwind CSS configuration.
warn - https://tailwindcss.com/docs/content-configuration
我已经更新了我的节点到20.3.1,我也安装了扩展的tailwindcss在vscode。
我读了顺风的文档,并按照相同的步骤,但没有实用程序类被发现
我的终端
PS C:\Users\anura\Desktop\Tailwind CSS> npm install -D tailwindcss
added 83 packages in 9s
14 packages are looking for funding
run `npm fund` for details
PS C:\Users\anura\Desktop\Tailwind CSS> npm fund
Tailwind CSS
├── https://github.com/sponsors/sindresorhus
│ └── @alloc/quick-lru@5.2.0
├─┬ https://paulmillr.com/funding/
│ │ └── chokidar@3.5.3
│ └── https://github.com/sponsors/jonschlinkert
│ └── picomatch@2.3.1
├─┬ https://opencollective.com/postcss/
│ │ └── postcss@8.4.24, postcss-js@4.0.1, postcss-load-config@4.0.1, postcss-nested@6.0.1
│ └── https://github.com/sponsors/ai
│ └── nanoid@3.3.6
├── https://github.com/sponsors/ljharb
│ └── resolve@1.22.2, is-core-module@2.12.1, supports-preserve-symlinks-flag@1.0.0
├── https://github.com/sponsors/feross
│ └── run-parallel@1.2.0, queue-microtask@1.2.3
└── https://github.com/sponsors/isaacs
└── glob@7.1.6
PS C:\Users\anura\Desktop\Tailwind CSS> npx tailwindcss init
Created Tailwind CSS config file: tailwind.config.js
PS C:\Users\anura\Desktop\Tailwind CSS> npx tailwindcss -i ./src/style.css -o ./dist/style.css --watch
Rebuilding...
warn - No utility classes were detected in your source files. If this is unexpected, double-check the `content` option in your Tailwind CSS configuration.
warn - https://tailwindcss.com/docs/content-configuration
Done in 207ms.
和tailwind.config.js文件
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ["./dist/index.html"],
theme: {
extend: {},
},
plugins: [],
}
[![This is my All Files](https://i.stack.imgur.com/lKuTb.png)](https://i.stack.imgur.com/lKuTb.png)
1条答案
按热度按时间brqmpdu11#
您的配置看起来不错,但要使用Tailwind实用程序类,请仔细检查是否在style.css文件的顶部正确添加了这些指令。
来源:https://tailwindcss.com/docs/installation