refactor(tailwind.config.js): 禁用部分Tailwind CSS类以解决微信小程序兼容性问题

为了解决微信小程序中的兼容性问题,禁用了以下Tailwind CSS类:
- `gap`:微信小程序不支持 gap 属性- `lineClamp`:微信小程序不支持 line-clamp 类
- `textIndent`:禁用 text-indent
- `writingMode`:禁用 writing-mode
- `hyphens`:禁用 hyphens
```
This commit is contained in:
2025-09-10 11:59:03 +08:00
parent 7fa1e44441
commit 24c6e3aa9f
3 changed files with 18 additions and 2 deletions

View File

@@ -2,11 +2,12 @@
module.exports = {
content: ['./src/**/*.{js,jsx,ts,tsx}'],
darkMode: 'media', // or 'media' or 'class'
// 禁用 important 语法,微信小程序不支持 .\! 这样的选择器
theme: {
extend: {},
},
variants: {
extend: {},
// 禁用所有变体,避免生成微信小程序不支持的选择器
},
plugins: [],
corePlugins: {
@@ -24,5 +25,11 @@ module.exports = {
textIndent: false, // 禁用 text-indent
writingMode: false, // 禁用 writing-mode
hyphens: false, // 禁用 hyphens
// 禁用所有可能包含问题的变体
visibility: false, // 禁用 visibility 相关类,避免生成 .\!visible
// 禁用伪类和交互变体,避免生成 .active\: 等选择器
scale: false, // 禁用 scale 相关类,避免生成问题选择器
transform: false, // 禁用 transform 相关类
transitionProperty: false, // 禁用 transition 相关类
},
};