Skip to content

DeepSeek Harness Tauri 桌面版 | Only 8mb installer, zero environment setup, preset plugins, Windows / macOS / Linux.

refactor(styles): refactoring CSS file structure to unify style resource management

hairyfec781cb8774c
diff --git a/src/App.tsx b/src/App.tsx
index 746d9c94..20e59db3 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -5,7 +5,6 @@ import SetupScreen, { InstallProgress, SetupStatus } from "./components/SetupScr
import SidebarPanel from "./components/SidebarPanel";
import { useI18n } from "./i18n/context";
import { generateTimestampedUrl } from "./hooks/useAutoSync";
-import "./App.css";
const MAX_RETRIES = 8;
diff --git a/src/main.tsx b/src/main.tsx
index e6f74553..a28f4c57 100644
--- a/src/main.tsx
+++ b/src/main.tsx
@@ -2,7 +2,7 @@ import React from "react";
import ReactDOM from "react-dom/client";
import App from "./App";
import { I18nProvider } from "./i18n/context";
-import "./App.css";
+import "./style/main.css";
ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
<React.StrictMode>
diff --git a/src/style/components/scrollbar.css b/src/style/components/scrollbar.css
new file mode 100644
index 00000000..99e6ec52
--- /dev/null
+++ b/src/style/components/scrollbar.css
@@ -0,0 +1,91 @@
+/* 全局滚动条样式优化 */
+/* 默认隐藏滚动条,适用于所有可滚动元素 */
+* {
+ scrollbar-width: thin;
+ scrollbar-color: transparent transparent;
+}
+
+/* Webkit 浏览器滚动条样式(Chrome, Safari, Edge) */
+*::-webkit-scrollbar {
+ width: 8px;
+ height: 8px;
+}
+
+*::-webkit-scrollbar-track {
+ background: transparent;
+}
+
+*::-webkit-scrollbar-thumb {
+ background-color: transparent;
+ border-radius: 4px;
+ border: 2px solid transparent;
+ background-clip: padding-box;
+ transition: background-color 0.2s ease;
+}
+
+/* 鼠标悬停到可滚动元素时显示滚动条 */
+*:hover::-webkit-scrollbar-thumb {
+ background-color: rgba(156, 163, 175, 0.3);
+}
+
+*:hover {
+ scrollbar-color: rgba(156, 163, 175, 0.3) transparent;
+}
+
+/* 鼠标悬停到滚动条本身时加深颜色 */
+*:hover::-webkit-scrollbar-thumb:hover {
+ background-color: rgba(156, 163, 175, 0.5);
+}
+
+/* 滚动时也显示滚动条(通过 active 状态) */
+*:active::-webkit-scrollbar-thumb {
+ background-color: rgba(156, 163, 175, 0.3);
+}
+
+*:active {
+ scrollbar-color: rgba(156, 163, 175, 0.3) transparent;
+}
+
+/* 焦点时显示滚动条(用于键盘导航) */
+*:focus-within::-webkit-scrollbar-thumb {
+ background-color: rgba(156, 163, 175, 0.3);
+}
+
+*:focus-within {
+ scrollbar-color: rgba(156, 163, 175, 0.3) transparent;
+}
+
+/* 确保 body 和 html 也应用滚动条样式 */
+html,
+body {
+ scrollbar-width: thin;
+ scrollbar-color: transparent transparent;
+}
+
+html:hover,
+body:hover {
+ scrollbar-color: rgba(156, 163, 175, 0.3) transparent;
+}
+
+html::-webkit-scrollbar,
+body::-webkit-scrollbar {
+ width: 8px;
+ height: 8px;
+}
+
+html::-webkit-scrollbar-track,
+body::-webkit-scrollbar-track {
+ background: transparent;
+}
+
+html::-webkit-scrollbar-thumb,
+body::-webkit-scrollbar-thumb {
+ background-color: transparent;
+ border-radius: 4px;
+ transition: background-color 0.2s ease;
+}
+
+html:hover::-webkit-scrollbar-thumb,
+body:hover::-webkit-scrollbar-thumb {
+ background-color: rgba(156, 163, 175, 0.3);
+}
diff --git a/src/App.css b/src/style/global.css
similarity index 100%
rename from src/App.css
rename to src/style/global.css
diff --git a/src/style/main.css b/src/style/main.css
new file mode 100644
index 00000000..588c1f11
--- /dev/null
+++ b/src/style/main.css
@@ -0,0 +1,2 @@
+@import './components/scrollbar.css';
+@import './global.css';