我在我的应用程序中使用Flowbite (包括JS和CSS)。JS被插入并工作(在JS入口点使用Webpack和import 'flowbite' )。
对于CSS,我在tailwind.config.js文件中使用它,正如文档告诉您的那样。
module.exports = {
content: ['./src/**/*.{html,js}'],
theme: {
extend: {}
},
plugins: [
require('flowbite/plugin')
]
}但是,在编译所有内容(npx tailwind build)时,CSS似乎并不包括在最终的CSS文件中。
我可以看出来,因为FlowBite模式应该有一个黑暗的背景(使所有的东西都变得更暗),但是在创建编译的CSS时,这个背景不会出现。
但是,当我手动包含flowbite.css时,它确实会正确地呈现。因此,我目前的工作解决方案是(在我的HTML中):
<!-- TODO: Adding the plugin in tailwind.config.js does not work -->
<link rel="stylesheet" href="https://unpkg.com/flowbite@latest/dist/flowbite.min.css" />但是我想让它从Tailwind build命令中自动编译。
发布于 2022-02-21 18:28:07
在这个不和谐的社会里,有人直接回答我。我必须包括这一点:
module.exports = {
content: ['./src/**/*.html', './node_modules/flowbite/**/*.js'],
plugins: [
require('flowbite/plugin')
]
}'./node_modules/flowbite/**/*.js' in content失踪了。
发布于 2022-03-07 07:19:05
尝试过很多方法都行不通。所以我有了快速修正,添加这个css:
.h-modal{
background-color: rgba(0,0,0,0.3);
}https://stackoverflow.com/questions/71210273
复制相似问题