diff --git a/package.json b/package.json index 31fadfb4..5b577e65 100755 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "@fullcalendar/react": "^6.1.19", "@heroui/react": "^3.0.0-beta.2", "@heroui/styles": "^3.0.0-beta.2", - "@heroui/theme": "^2.4.23", + "@heroui/theme": "^3.0.0-beta.2", "@reduxjs/toolkit": "^2.9.2", "@splidejs/react-splide": "^0.7.12", "@tanstack/react-virtual": "^3.13.12", diff --git a/src/styles/heroui.css b/src/styles/heroui.css index 7ec36160..db59e8b4 100644 --- a/src/styles/heroui.css +++ b/src/styles/heroui.css @@ -1,21 +1,29 @@ /** - * HeroUI + Tailwind CSS v4 配置 - * 参考文档: https://www.heroui.com/docs/guide/tailwind-v4 + * HeroUI v3 + Tailwind CSS v4 配置 + * 参考文档: https://v3.heroui.com/llms-full.txt + * + * 重要:导入顺序很重要!必须先导入 tailwindcss,再导入 @heroui/styles */ /* 1. 导入 Tailwind CSS v4 */ @import "tailwindcss"; -/* 2. 导入 HeroUI 插件(使用 npm 包路径) */ -@import "@heroui/theme"; +/** + * 2. 配置内容扫描路径 + * @source 指令告诉 Tailwind v4 扫描 HeroUI 组件库中的类名 + * 路径相对于此 CSS 文件(src/styles/heroui.css) + */ +@source "../../node_modules/@heroui/theme/dist"; -/* 3. 配置内容扫描路径 */ -@source "../**/*.{js,jsx,ts,tsx}"; -@source "../../node_modules/@heroui/theme/dist/**/*.{js,ts,jsx,tsx}"; - -/* 4. 自定义深色模式变体 */ +/** + * 3. 配置深色模式变体 + * 支持 HeroUI 的 .dark 类名深色模式 + */ @custom-variant dark (&:is(.dark *)); +/* 4. 导入 HeroUI v3 样式 */ +@import "@heroui/styles"; + /** * 自定义样式 */