diff --git a/biome.json b/biome.json index 100b1418..a548aab8 100644 --- a/biome.json +++ b/biome.json @@ -1,5 +1,10 @@ { "$schema": "./node_modules/@biomejs/biome/configuration_schema.json", + "css": { + "parser": { + "tailwindDirectives": true + } + }, "files": { "ignoreUnknown": true, "includes": [ diff --git a/config/config.ts b/config/config.ts index 619dbf50..3d2450d9 100644 --- a/config/config.ts +++ b/config/config.ts @@ -201,8 +201,4 @@ export default defineConfig({ 'process.env.COMMIT_HASH': process.env.COMMIT_HASH || '', 'process.env.CF_PAGES_COMMIT_SHA': process.env.CF_PAGES_COMMIT_SHA || '', }, - tailwindcss: { - // 这里可以配置 tailwindcss 的选项,具体配置项可以参考 tailwindcss 官方文档 - // https://tailwindcss.com/docs/configuration - }, }); diff --git a/package.json b/package.json index cd73a9e3..e2bf1630 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,8 @@ "jest-environment-jsdom": "^30.0.5", "lint-staged": "^16.1.2", "mockjs": "^1.1.0", - "tailwindcss": "^3.3.2", + "@tailwindcss/postcss": "^4.0.0", + "tailwindcss": "^4.0.0", "ts-node": "^10.9.2", "typescript": "^6.0.2", "umi-serve": "^1.9.11" diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 00000000..e5640725 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + '@tailwindcss/postcss': {}, + }, +}; diff --git a/src/global.tsx b/src/global.tsx index 07b2aa90..9c7ac379 100644 --- a/src/global.tsx +++ b/src/global.tsx @@ -1,3 +1,4 @@ +import './tailwind.css'; import { useIntl } from '@umijs/max'; import { Button, message, notification } from 'antd'; import defaultSettings from '../config/defaultSettings'; diff --git a/src/tailwind.css b/src/tailwind.css new file mode 100644 index 00000000..79550f5d --- /dev/null +++ b/src/tailwind.css @@ -0,0 +1,3 @@ +@import "tailwindcss"; + +@source "./src"; diff --git a/tailwind.css b/tailwind.css deleted file mode 100644 index 8776ebe5..00000000 --- a/tailwind.css +++ /dev/null @@ -1,14 +0,0 @@ -@tailwind base; -@tailwind components; -@tailwind utilities; - -@layer utilities { - @keyframes shine { - 100% { - left: 125%; - } - } - .animate-shine { - animation: shine 0.75s; - } -}