使用 Tailwindcss 构建 CSS 不起作用 [英] Building CSS with Tailwindcss not working
本文介绍了使用 Tailwindcss 构建 CSS 不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我对 Tailwind 和 CSS 整体还是很陌生,正在尝试构建这个 CSS 文件:
I am pretty new to Tailwind and CSS as a whole and am trying to build this CSS file:
@tailwind base;
@tailwind components;
@tailwind utilities;
.btn{
@apply rounded-full py-2 px-3 uppercase text-xs font-bold cursor-pointer tracking-wider
}
使用这个命令
npm run build-css
但我收到了这个回复
> course@1.0.0 build-css C:\Users\user\Tailwind\project
> tailwindcss build src/styles.css -o public/styles.css
[deprecation] Running tailwindcss without -i, please provide an input file.
Done in 3220ms.
然后什么也没有发生.如何指定输入文件?
And nothing happens. How do I specify the input file?
推荐答案
正如错误所说,您需要提供带有 -i
标志的输入文件.将 package.json
中的脚本更改为此
As error says, you need to provide input file with -i
flag. Change your script inside package.json
to this
tailwindcss -i src/styles.css -o public/styles.css
有关 Tailwind CLI 的更多信息位于此处
More information about Tailwind CLI is here
这篇关于使用 Tailwindcss 构建 CSS 不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文