From eef1dbfe8dc7b9c97936fb1498b8cd0d0caf4745 Mon Sep 17 00:00:00 2001 From: zzlgreat Date: Sun, 23 Nov 2025 06:36:39 +0800 Subject: [PATCH] update pay function --- package.json | 5 +++-- postcss.config.js | 5 +++-- src/styles/heroui.css | 13 +++++++++---- tailwind.config.js | 19 +++++++++++++++++++ 4 files changed, 34 insertions(+), 8 deletions(-) create mode 100644 tailwind.config.js diff --git a/package.json b/package.json index 6a33b14d..90701077 100755 --- a/package.json +++ b/package.json @@ -112,13 +112,13 @@ }, "devDependencies": { "@craco/craco": "^7.1.0", - "@tailwindcss/postcss": "next", "@types/node": "^20.19.25", "@types/react": "^19.0.0", "@types/react-dom": "^19.0.0", "@typescript-eslint/eslint-plugin": "^8.46.4", "@typescript-eslint/parser": "^8.46.4", "ajv": "^8.17.1", + "autoprefixer": "^10.4.20", "concurrently": "^8.2.2", "env-cmd": "^11.0.0", "eslint-config-prettier": "8.3.0", @@ -130,10 +130,11 @@ "imagemin-pngquant": "^10.0.0", "kill-port": "^2.0.1", "msw": "^2.11.5", + "postcss": "^8.4.49", "prettier": "2.2.1", "react-error-overlay": "6.0.9", "sharp": "^0.34.4", - "tailwindcss": "next", + "tailwindcss": "^3.4.17", "ts-node": "^10.9.2", "webpack-bundle-analyzer": "^4.10.2", "yn": "^5.1.0" diff --git a/postcss.config.js b/postcss.config.js index fa7d5e7d..2cb13cb6 100644 --- a/postcss.config.js +++ b/postcss.config.js @@ -1,6 +1,7 @@ -// PostCSS 配置 - Tailwind CSS v4 +// PostCSS 配置 - Tailwind CSS v3 module.exports = { plugins: { - '@tailwindcss/postcss': {}, + tailwindcss: {}, + autoprefixer: {}, }, } diff --git a/src/styles/heroui.css b/src/styles/heroui.css index 7fc60ad7..feb2448c 100644 --- a/src/styles/heroui.css +++ b/src/styles/heroui.css @@ -1,10 +1,15 @@ /** - * HeroUI v3 + Tailwind CSS v4 配置 + * HeroUI v3 + Tailwind CSS v3 配置 * 参考文档: https://v3.heroui.com/docs/quick-start * - * 重要提示:导入顺序很重要!必须先导入 tailwindcss,再导入 @heroui/styles - * Import order matters. Always import `tailwindcss` first. + * 注意:HeroUI v3 同时支持 Tailwind v3 和 v4 + * 由于 CRACO 兼容性问题,我们使用 Tailwind v3 */ -@import "tailwindcss"; +/* Tailwind CSS v3 基础样式 */ +@tailwind base; +@tailwind components; +@tailwind utilities; + +/* HeroUI v3 样式 */ @import "@heroui/styles"; diff --git a/tailwind.config.js b/tailwind.config.js new file mode 100644 index 00000000..2d126876 --- /dev/null +++ b/tailwind.config.js @@ -0,0 +1,19 @@ +/** @type {import('tailwindcss').Config} */ + +module.exports = { + // 扫描所有使用 HeroUI 和 Tailwind 的文件 + content: [ + "./src/views/AgentChat/**/*.{js,jsx,ts,tsx}", + "./src/providers/AppProviders.js", + "./node_modules/@heroui/react/dist/**/*.{js,jsx,ts,tsx}", + "./node_modules/@heroui/styles/dist/**/*.{js,jsx,ts,tsx}", + ], + + darkMode: "class", + + theme: { + extend: {}, + }, + + plugins: [], +}