From 17d66e3d8a10d5c50b4bafc31658b0d2a418429b Mon Sep 17 00:00:00 2001 From: LeafYeeXYZ Date: Mon, 13 May 2024 11:00:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=80=E5=A4=84=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/App.tsx | 2 +- src/styles/App.css | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/components/App.tsx b/src/components/App.tsx index 6c1c13c..dfc4f55 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -59,7 +59,7 @@ export function App() { // 视情况弹出更新提示 versionInfo && dialogAction(versionInfo) // 根据用户设备暗色模式偏好设置主题 - if (window.matchMedia('(prefers-color-scheme: dark)').matches) document.body.classList.add('dark') + if (window.matchMedia('(prefers-color-scheme: dark)').matches) document.documentElement.classList.add('dark') }, [dialogAction]) return ( diff --git a/src/styles/App.css b/src/styles/App.css index 15aa058..f07d755 100644 --- a/src/styles/App.css +++ b/src/styles/App.css @@ -1,4 +1,4 @@ -:root { +html { --prompt-height: 260px; --prompt-btn-width: 100%; --prompt-btn-gap: 0; @@ -74,7 +74,6 @@ button { border: none; outline: none; } -html, -body { +html, body { background-color: var(--back); } \ No newline at end of file