设置
preflight: false
这样就不会发生任何冲突了. (手动狗头)
( 不要去删除
@tailwind base
, 这样会造成 tw 功能上的一些 bug)
module.exports = {
content: [
"./pages/**/*.{js,ts,jsx,tsx}",
"./src/**/*.{js,ts,jsx,tsx}",
"./components/**/*.{js,ts,jsx,tsx}",
theme: {
extend: {},
plugins: [],
corePlugins: {
preflight: false,
由于 antd 和 tailwind 都是class, 是同级. 无法达到覆盖的效果, 所以必须加上 !important
工具类就是 @tailwind utilities ,平时写的 w-1 h-full 等等 都是 utilities .
所以 important 只会给自己写的工具类加上,不会影响其他部分
@tailwind components
是一些插件组件之类的, 比如 daisyUI
@tailwind base
是一些 tw 默认变量和清除浏览器默认样式 (可通过 preflight: false 移除).
module.exports = {
important: true,
$ npm i taro-plugin-tailwind --save-dev
$ # 或使用 yarn
$ yarn add -D taro-plugin-tailwind
请确保Taro CLI已升级到Taro 3的最新版本,确保taro-plugin-tailwind版本在v1.1.0及以上。
修改项目config/index.js中的plugins配置如下:
const config = {
/// ...
plugins : [
// ...其余插件
'taro-plugin-tailwind' ,
/// ...
在交互式监视模式下启动测试运行器。 有关更多信息,请参见关于的部分。
npm run build
构建生产到应用程序build文件夹。 它在生产模式下正确捆绑了React,并优化了构建以获得最佳性能。
生成被最小化,并且文件名包括哈希值。 您的应用已准备好进行部署!
有关更多信息,请参见关于的部分。
```html
<div class="flex justify-center items-center h-screen">
<p class="text-center">这里是居中的文字</p>
这里使用了 `flex` 容器来实现垂直居中,并将容器高度设为屏幕高度。然后在包含文字的 `p` 元素上应用 `text-center` 类来实现水平居中。
Unity发布WebGL报错 : Unable to parse Build/web.framework.js.gz. This can happen if build compression was
15346
Unity发布WebGL报错 : Unable to parse Build/web.framework.js.gz. This can happen if build compression was
秃头大作战:
Unity发布WebGL报错 : Unable to parse Build/web.framework.js.gz. This can happen if build compression was
努力奔跑的小黄:
Docsify 侧边栏 : 自动生成sidebar与子目录sidebar
BIN丶虫:
android 项目改为 国内镜像
zzx_nl: