diff --git a/docs/package.json b/docs/package.json index 7bfd343..4bc77a9 100644 --- a/docs/package.json +++ b/docs/package.json @@ -19,7 +19,8 @@ "@rspress/plugin-preview": "^1.44.0", "@tailwindcss/postcss": "^4.1.11", "@types/node": "^18.11.17", + "autoprefixer": "^10.4.22", "postcss": "^8.5.6", - "tailwindcss": "^4.1.10" + "tailwindcss": "^4.1.17" } } diff --git a/docs/rspress.config.ts b/docs/rspress.config.ts index 7c27c12..8622b52 100644 --- a/docs/rspress.config.ts +++ b/docs/rspress.config.ts @@ -60,7 +60,7 @@ export default defineConfig({ message: "MIT Licensed | © 2025 DevCloudFE. All Rights Reserved.", }, }, - globalStyles: path.resolve(__dirname, "./docs/tailwind.css"), + globalStyles: path.resolve(__dirname, "theme/styles/index.css"), route: { cleanUrls: true, }, diff --git a/docs/tailwind.config.js b/docs/tailwind.config.js new file mode 100644 index 0000000..e6c95e2 --- /dev/null +++ b/docs/tailwind.config.js @@ -0,0 +1,16 @@ +module.exports = { + content: [ + "./docs/**/*.{md,mdx,js,ts,jsx,tsx}", + "./theme/**/*.{js,ts,jsx,tsx}", + ], + darkMode: ["selector"], + theme: { + extend: { + colors: { + background: "hsl(var(--background))", + foreground: "hsl(var(--foreground))", + primary: "hsl(var(--primary))", + }, + }, + }, +}; diff --git a/docs/theme/styles/index.css b/docs/theme/styles/index.css new file mode 100644 index 0000000..e3bb3b1 --- /dev/null +++ b/docs/theme/styles/index.css @@ -0,0 +1,40 @@ +@import "tailwindcss"; +@custom-variant dark (&:where(.dark, .dark *)); + +@theme { + --color-background: hsl(0 0% 100%); + --color-foreground: hsl(222.2 84% 4.9%); + --color-primary: hsl(221.2 83.2% 53.3%); + + --color-background: var(--background); + --color-foreground: var(--foreground); + --color-primary: var(--primary); + + --rp-c-bg: var(--color-background); + --rp-c-text: var(--color-foreground); + --rp-c-brand: var(--color-primary); + --rp-c-brand-light: color-mix(in srgb, var(--color-primary) 80%, transparent); +} + +:root { + --background: 0 0% 100%; + --foreground: 222.2 84% 4.9%; + --primary: 221.2 83.2% 53.3%; +} + +.dark { + --background: 222.2 84% 4.9%; + --foreground: 210 40% 98%; + --primary: 217.2 91.2% 59.8%; +} + +@layer base { + body { + @apply bg-background text-foreground; + } +} +@layer components { + .rspress-doc a { + @apply text-primary hover:underline; + } +} diff --git a/docs/theme/index.tsx b/docs/theme/styles/index.tsx similarity index 92% rename from docs/theme/index.tsx rename to docs/theme/styles/index.tsx index 0393e10..ae296ea 100644 --- a/docs/theme/index.tsx +++ b/docs/theme/styles/index.tsx @@ -2,8 +2,8 @@ import { useLang } from "rspress/runtime"; import { HomeLayout as BasicHomeLayout, Layout as BasicLayout, - // getCustomMDXComponent, } from "rspress/theme"; +import "./styles/index.css"; function HomeLayout() { // const { code: Code } = getCustomMDXComponent(); @@ -21,6 +21,7 @@ const Layout = () => { : "🚧 MateChat React 文档仍在开发中"} } + // components={{ ... }} /> ); }; diff --git a/package.json b/package.json index 53dc6aa..b43965c 100644 --- a/package.json +++ b/package.json @@ -93,4 +93,4 @@ "type": "module", "types": "./dist/*.d.ts", "version": "0.1.1" -} \ No newline at end of file +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 96a91de..5528d28 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -136,12 +136,15 @@ importers: '@types/node': specifier: ^18.11.17 version: 18.19.113 + autoprefixer: + specifier: ^10.4.22 + version: 10.4.22(postcss@8.5.6) postcss: specifier: ^8.5.6 version: 8.5.6 tailwindcss: - specifier: ^4.1.10 - version: 4.1.11 + specifier: ^4.1.17 + version: 4.1.17 playground: dependencies: @@ -2512,6 +2515,13 @@ packages: resolution: {integrity: sha512-LElXdjswlqjWrPpJFg1Fx4wpkOCxj1TDHlSV4PlaRxHGWko024xICaa97ZkMfs6DRKlCguiAI+rbXv5GWwXIkg==} hasBin: true + autoprefixer@10.4.22: + resolution: {integrity: sha512-ARe0v/t9gO28Bznv6GgqARmVqcWOV3mfgUPn9becPHMiD3o9BwlRgaeccZnwTpZ7Zwqrm+c1sUSsMxIzQzc8Xg==} + engines: {node: ^10 || ^12 || >=14} + hasBin: true + peerDependencies: + postcss: ^8.1.0 + babel-plugin-jsx-dom-expressions@0.39.8: resolution: {integrity: sha512-/MVOIIjonylDXnrWmG23ZX82m9mtKATsVHB7zYlPfDR9Vdd/NBE48if+wv27bSkBtyO7EPMUlcUc4J63QwuACQ==} peerDependencies: @@ -2528,10 +2538,6 @@ packages: balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - baseline-browser-mapping@2.8.10: - resolution: {integrity: sha512-uLfgBi+7IBNay8ECBO2mVMGZAc1VgZWEChxm4lv+TobGdG82LnXMjuNGo/BSSZZL4UmkWhxEHP2f5ziLNwGWMA==} - hasBin: true - baseline-browser-mapping@2.8.25: resolution: {integrity: sha512-2NovHVesVF5TXefsGX1yzx1xgr7+m9JQenvz6FQY3qd+YXkKkYiv+vTCc7OriP9mcDZpTC5mAOYN4ocd29+erA==} hasBin: true @@ -2560,11 +2566,6 @@ packages: resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} engines: {node: '>=8'} - browserslist@4.26.3: - resolution: {integrity: sha512-lAUU+02RFBuCKQPj/P6NgjlbCnLBMp4UtgTx7vNHd3XSIJF87s9a5rA3aH2yw3GS9DqZAUbOtZdCCiZeVRqt0w==} - engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} - hasBin: true - browserslist@4.27.0: resolution: {integrity: sha512-AXVQwdhot1eqLihwasPElhX2tAZiBjWdJ9i/Zcj2S6QYIjkx62OKSfnobkriB81C3l4w0rVy3Nt4jaTBltYEpw==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} @@ -2600,12 +2601,6 @@ packages: resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==} engines: {node: '>=10'} - caniuse-lite@1.0.30001726: - resolution: {integrity: sha512-VQAUIUzBiZ/UnlM28fSp2CRF3ivUn1BWEvxMcVTNwpw91Py1pGbPIyIKtd+tzct9C3ouceCVdGAXxZOpZAsgdw==} - - caniuse-lite@1.0.30001746: - resolution: {integrity: sha512-eA7Ys/DGw+pnkWWSE/id29f2IcPHVoE8wxtvE5JdvD2V28VTDPy1yEeo11Guz0sJ4ZeGRcm3uaTcAqK1LXaphA==} - caniuse-lite@1.0.30001754: resolution: {integrity: sha512-x6OeBXueoAceOmotzx3PO4Zpt4rzpeIFsSr6AAePTZxSkXiYDUmpypEl7e2+8NCd9bD7bXjqyef8CJYPC1jfxg==} @@ -2921,9 +2916,6 @@ packages: ee-first@1.1.1: resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} - electron-to-chromium@1.5.228: - resolution: {integrity: sha512-nxkiyuqAn4MJ1QbobwqJILiDtu/jk14hEAWaMiJmNPh1Z+jqoFlBFZjdXwLWGeVSeu9hGLg6+2G9yJaW8rBIFA==} - electron-to-chromium@1.5.248: resolution: {integrity: sha512-zsur2yunphlyAO4gIubdJEXCK6KOVvtpiuDfCIqbM9FjcnMYiyn0ICa3hWfPr0nc41zcLWobgy1iL7VvoOyA2Q==} @@ -3169,6 +3161,9 @@ packages: resolution: {integrity: sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==} engines: {node: '>= 0.6'} + fraction.js@5.3.4: + resolution: {integrity: sha512-1X1NTtiJphryn/uLQz3whtY6jK3fTqoE3ohKs0tT+Ujr1W59oopxmoEh7Lu5p6vBaPbgoM0bzveAW4Qi5RyWDQ==} + fresh@2.0.0: resolution: {integrity: sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==} engines: {node: '>= 0.8'} @@ -4345,9 +4340,6 @@ packages: resolution: {integrity: sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - node-releases@2.0.21: - resolution: {integrity: sha512-5b0pgg78U3hwXkCM8Z9b2FJdPZlr9Psr9V2gQPESdGHqbntyFJKFW4r5TeWGFzafGY3hzs1JC62VEQMbl1JFkw==} - node-releases@2.0.27: resolution: {integrity: sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA==} @@ -4359,6 +4351,10 @@ packages: resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} engines: {node: '>=0.10.0'} + normalize-range@0.1.2: + resolution: {integrity: sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA==} + engines: {node: '>=0.10.0'} + npm-run-path@4.0.1: resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==} engines: {node: '>=8'} @@ -4538,6 +4534,9 @@ packages: pkg-types@2.3.0: resolution: {integrity: sha512-SIqCzDRg0s9npO5XQ3tNZioRY1uK06lA41ynBC1YmFTmnY6FjUjVt6s4LoADmwoig1qqD0oK8h1p/8mlMx8Oig==} + postcss-value-parser@4.2.0: + resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} + postcss@8.5.6: resolution: {integrity: sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==} engines: {node: ^10 || ^12 || >=14} @@ -5615,12 +5614,6 @@ packages: resolution: {integrity: sha512-1uEe95xksV1O0CYKXo8vQvN1JEbtJp7lb7C5U9HMsIp6IVwntkH/oNUzyVNQSd4S1sYk2FpSSW44FqMc8qee5w==} engines: {node: '>=4'} - update-browserslist-db@1.1.3: - resolution: {integrity: sha512-UxhIZQ+QInVdunkDAaiazvvT/+fXL5Osr0JZlJulepYu6Jd7qJtDZjlur0emRlT71EN3ScPoE7gvsuIKKNavKw==} - hasBin: true - peerDependencies: - browserslist: '>= 4.21.0' - update-browserslist-db@1.1.4: resolution: {integrity: sha512-q0SPT4xyU84saUX+tomz1WLkxUbuaJnR1xWt17M7fJtEJigJeWUNGUqrauFXsHnqev9y9JTRGwk13tFBuKby4A==} hasBin: true @@ -6004,7 +5997,7 @@ snapshots: dependencies: '@babel/compat-data': 7.28.4 '@babel/helper-validator-option': 7.27.1 - browserslist: 4.26.3 + browserslist: 4.27.0 lru-cache: 5.1.1 semver: 6.3.1 @@ -7116,7 +7109,7 @@ snapshots: '@module-federation/runtime-tools': 0.14.0 '@rspack/binding': 1.3.12 '@rspack/lite-tapable': 1.0.1 - caniuse-lite: 1.0.30001726 + caniuse-lite: 1.0.30001754 optionalDependencies: '@swc/helpers': 0.5.17 @@ -8268,6 +8261,16 @@ snapshots: astring@1.9.0: {} + autoprefixer@10.4.22(postcss@8.5.6): + dependencies: + browserslist: 4.27.0 + caniuse-lite: 1.0.30001754 + fraction.js: 5.3.4 + normalize-range: 0.1.2 + picocolors: 1.1.1 + postcss: 8.5.6 + postcss-value-parser: 4.2.0 + babel-plugin-jsx-dom-expressions@0.39.8(@babel/core@7.28.0): dependencies: '@babel/core': 7.28.0 @@ -8287,8 +8290,6 @@ snapshots: balanced-match@1.0.2: {} - baseline-browser-mapping@2.8.10: {} - baseline-browser-mapping@2.8.25: {} big.js@5.2.2: {} @@ -8321,14 +8322,6 @@ snapshots: dependencies: fill-range: 7.1.1 - browserslist@4.26.3: - dependencies: - baseline-browser-mapping: 2.8.10 - caniuse-lite: 1.0.30001746 - electron-to-chromium: 1.5.228 - node-releases: 2.0.21 - update-browserslist-db: 1.1.3(browserslist@4.26.3) - browserslist@4.27.0: dependencies: baseline-browser-mapping: 2.8.25 @@ -8359,10 +8352,6 @@ snapshots: camelcase@6.3.0: {} - caniuse-lite@1.0.30001726: {} - - caniuse-lite@1.0.30001746: {} - caniuse-lite@1.0.30001754: {} ccount@2.0.1: {} @@ -8660,8 +8649,6 @@ snapshots: ee-first@1.1.1: {} - electron-to-chromium@1.5.228: {} - electron-to-chromium@1.5.248: {} emoji-regex@10.6.0: {} @@ -8946,6 +8933,8 @@ snapshots: forwarded@0.2.0: {} + fraction.js@5.3.4: {} + fresh@2.0.0: {} fs-extra@11.3.0: @@ -10604,8 +10593,6 @@ snapshots: fetch-blob: 3.2.0 formdata-polyfill: 4.0.10 - node-releases@2.0.21: {} - node-releases@2.0.27: {} normalize-package-data@3.0.3: @@ -10617,6 +10604,8 @@ snapshots: normalize-path@3.0.0: {} + normalize-range@0.1.2: {} + npm-run-path@4.0.1: dependencies: path-key: 3.1.1 @@ -10791,6 +10780,8 @@ snapshots: exsolve: 1.0.7 pathe: 2.0.3 + postcss-value-parser@4.2.0: {} + postcss@8.5.6: dependencies: nanoid: 3.3.11 @@ -12013,12 +12004,6 @@ snapshots: upath@2.0.1: {} - update-browserslist-db@1.1.3(browserslist@4.26.3): - dependencies: - browserslist: 4.26.3 - escalade: 3.2.0 - picocolors: 1.1.1 - update-browserslist-db@1.1.4(browserslist@4.27.0): dependencies: browserslist: 4.27.0