dsh-card-theme:为 DSH Web GUI 提供主题工作室与卡片布局

前言

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:

  1. Preset:DeepSeek 默认 / Nord / Solarized / One Dark 芯片。
  2. Colors:强调色、背景、前景;可「跟随预设」重置。
  3. Card layout:关 / 开三栏卡片。
  4. Content width:滑块 400–2400 px,或跟随默认 / 640 / 748 / 920 / 1200。
  5. 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。

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye