前言¶
DeepSeek Harness(DSH)的 Web 界面外觀主要由平臺自帶的 Appearance 與語義化 CSS token 決定。若希望在不改廠商源碼的前提下切換 Nord、Solarized、One Dark 等經典配色,或爲左右側欄與中間對話區套上「卡片式」分欄,並在亮/暗模式下分別微調強調色、背景、壁紙與對話列寬,就需要藉助官方插件接縫(webserver/index-inject、ctx.theme.overrideTokens)注入樣式與配置。dsh-card-theme 由維護者 DaSea 發佈,在 SkillHub 目錄中歸類爲「趣味換裝」,當前 GitHub 星標爲 0;它面向在 dsh web 或桌面版中長期使用同一套 DSH 進程的開發者,把調色、佈局與持久化選色收斂到 Theme Studio 或主機配置裏。
這是什麼¶
dsh-card-theme 是 DSH Web GUI 的主題工作室插件:內置 nord、solarized、onedark 三套色板,並保留平臺默認 stock;custom 模式在 Nord 基底上接受完全自定義。除顏色外,還支持按亮/暗模式分別設置半透明側欄、對比度、背景圖,以及可選的三欄卡片佈局與對話內容列寬度。改動通過官方 API 即時生效,無需整頁刷新;用戶選擇在瀏覽器 localStorage 中持久化。插件版本 0.6.0,許可證 MIT,源碼倉庫爲 DaSea/dsh-card-theme,目錄頁爲 SkillHub 插件條目。
核心功能¶
預設色板與自定義¶
- 一鍵預設:
stock(DeepSeek 默認,不推導新色板,Theme Studio 中顏色控件會禁用)、nord、solarized、onedark(暗色爲 One Dark、亮色爲 One Light)、custom(默認基於 Nord)。 - 亮/暗獨立字段:
light.*/dark.*下的accent、background、foreground、translucentSidebar(preset·on·off)、contrast(0–100,-1表示沿用預設)。 - 三色加對比度會展開爲 100+ 派生 token,覆蓋邊框、層級、滾動條、氣泡、側欄狀態、設置卡片等語義樣式。
背景圖與半透明側欄¶
可爲各模式選擇本地文件(自動壓縮)或圖片 URL,並調節蒙版(0–100%)、模糊(0–60 px)、cover / contain / auto 與對齊方式;清空即恢復純色表面。半透明側欄通過 --dsw-specific-sidebar-fill 實現磨砂效果,壁紙可透出應用 chrome。
卡片佈局與對話列寬¶
cardLayout: true 時,左欄、中欄、右欄變爲圓角卡片,卡片之間留出畫布間隙;字體仍由平臺 Appearance 控制,插件不配置字體。centerContentWidth 設定對話內容列目標寬度(400–2400 px,-1 跟隨平臺默認約 680–920 px 響應式),通過平臺變量 --dsh-chat-user-width 實現,原生拖拽改寬仍可在局部生效。Theme Studio 提供 640 / 748 / 920 / 1200 等快捷檔位。
實現方式與優先級¶
主機側經 webserver/index-inject 注入首屏樣式與 globalThis.__DSH_THEME_PLUGIN_CONFIG__(舊 shell 回退爲 index.html 內 JSON 塊);客戶端經 ctx.theme.overrideTokens 熱更新。Theme Studio 的 localStorage 選擇優先於主機配置;主機配置 deliberately 不寫 localStorage,以便改 patch 後重載仍能生效,直至用戶再次在工作室中操作。
安裝與啓用¶
依賴 DeepSeek Harness 0.2.2-rc.1(README 寫明已安裝測試),並支持 0.2.1-rc.2 及更新的 0.2.x;package.json 中 engines.dsh 爲 >=0.2.1-rc.2 <0.3.0-0,Node >=22.19.0。須使用會提供 GUI 的 profile:web 對應 dsh web,desktop 對應桌面應用。
瀏覽器構建下,在官方 registry 安裝(--profile 指名實際提供頁面的 profile):
# browser build (dsh web):
dsh plugin --profile web add github:DaSea/dsh-card-theme
桌面版 desktop profile 不能通過 dsh plugin CLI 安裝,應在應用內 Settings → Plugins → Install,粘貼 GitHub 地址或本地 checkout 的絕對路徑。本地路徑安裝前須在插件目錄執行 pnpm install(link: 安裝不會自動裝上插件依賴 @deepseek-ai/schemastery)。
安裝後重啓對應 profile 或桌面應用方可生效。卸載:
dsh plugin --profile web remove dsh-card-theme
典型用法¶
Theme Studio(推薦)¶
重啓後打開 Settings → Theme Studio:
- Preset:DeepSeek 默認 / Nord / Solarized / One Dark 芯片。
- Colors:強調色、背景、前景;可「跟隨預設」重置。
- Card layout:關 / 開三欄卡片。
- Content width:滑塊 400–2400 px,或跟隨默認 / 640 / 748 / 920 / 1200。
- Translucent sidebar、Background image、Contrast:按界面說明調節;各項修改即時應用並本地保存。
主機配置(cordis.patch)¶
將字段合併進服務 profile 的 patch,例如 $DSH_HOME/profiles/<profile>/cordis.patch.yml:
- id: card-theme-plugin
config:
preset: nord
cardLayout: true
centerContentWidth: 960
light:
accent: '#FF6B35'
background: '#FFFAF0'
foreground: '#1A1A1A'
translucentSidebar: off
contrast: 70
backgroundImage: 'https://example.com/light.jpg'
backgroundImageMask: 72
backgroundImageBlur: 2
backgroundImageSize: cover
backgroundImagePosition: center
dark:
accent: '#FFB07A'
background: '#1A1A1A'
foreground: '#F5F5F5'
translucentSidebar: on
contrast: 70
backgroundImage: 'https://example.com/dark.jpg'
backgroundImageMask: 80
backgroundImageSize: cover
backgroundImagePosition: center bottom
僅填寫需要覆蓋的項;空字符串表示保留預設,未設置字段則不覆蓋。常見頂層字段:preset、cardLayout、centerContentWidth,以及對稱的 light.* / dark.* 背景圖相關鍵(見 README 配置表)。
適用場景與注意¶
適合希望在同一 DSH 實例上統一團隊視覺、或爲個人環境固定 Nord/Solarized/One Dark 與壁紙的 Web 或桌面用戶。不適合期待插件改寫字體或動銷廠商內置主題文件的場景——插件聲明僅使用官方接縫,不 patch 廠商文件。
安裝前請自行審閱 GitHub 源碼 與 MIT 許可證;插件隨當前 DSH 進程權限運行,背景圖 URL 與本地文件會參與客戶端渲染,應對來源保持與生產環境一致的安全策略。DSH 社區目錄(SkillHub)爲獨立生態站點,與 DeepSeek / 幻方無官方從屬關係;「一切皆插件」是 DSH 的設計取向,本文介紹不代表官方背書。
結尾¶
dsh-card-theme 把多套經典色板、亮暗分 mode 微調、可選三欄卡片佈局與對話列寬收進 Theme Studio 與 patch 配置,並依賴官方 token 覆蓋實現無刷新換膚。進一步瞭解可訪問目錄頁 https://www.skillhub.cn/plugins/DaSea/dsh-card-theme 與倉庫 https://github.com/DaSea/dsh-card-theme。