dsh-theme-plugin:DSH Web GUI 主题预设与深浅色自定义

前言

在 DSH 的 Web GUI 里,主题调整通常不只是改一个 accent 颜色:背景、前景、字体、侧边栏和对比度都会影响长时间阅读的可用性。dsh-theme-plugin 面向这类需求,提供 5 套预设和按 light/dark 模式自定义的入口,并在当前 Web 会话中即时应用。

这是什么

dsh-theme-plugin 是 DeepSeek Harness(DSH)Web GUI 的主题插件。它提供 5 套内置预设,并支持按 light/dark 模式自定义 accent、background、foreground、UI 字体、代码字体、半透明侧边栏和对比度。

仓库 owner 为 BeiZi6package.json 中 author 为 Xu Yuanshan,许可证为 MIT。

核心功能

下面介绍已核实资料中的能力。

  • 内置预设:stockcodex-warmnordsolarizedgraphite
  • 按模式自定义:light.*dark.* 可设置 accent、background、foreground、UI 字体、代码字体、半透明侧边栏和对比度。
  • 即时应用:通过官方 ctx.theme.overrideTokens API 应用更改,无需刷新页面。
  • 本地保留:选择保存在浏览器 localStorage 中,刷新后保留。
  • 令牌推导:从背景、前景、强调色和对比度推导 70+ 个语义令牌。
  • 注入方式:通过官方 webServer.tapIndex 接缝向 index.html 注入主题样式,不修改 vendor 文件。
  • 设置界面:提供 Settings → Theme Studio GUI,支持预设、颜色、字体、半透明侧边栏和对比度控制。

另外,stock 预设不派生调色板,颜色控制禁用,仅可覆盖字体;custom 模式从 codex-warm 调色板开始,并使用 light.* / dark.* 中的值。

安装与启用

前提是使用启用 web profile 的 DSH,并且安装后需要重启 dsh web

安装命令:

dsh plugin --profile web add github:BeiZi6/dsh-theme-plugin

然后重启或启动 dsh web

dsh web

如需移除插件,可以执行:

dsh plugin --profile web remove dsh-theme-plugin

环境要求:

  • Node.js >= 22.19
  • 许可证为 MIT

典型用法

使用设置界面

重启后打开 Settings → Theme Studio。可以选择 Preset,并调整 Colors、Fonts、Translucent sidebar 和 Contrast。GUI 选择优先于 host config。

每次更改即时应用,并保存在本地。

在 web profile patch 中配置

也可以在 web profile patch 中添加 theme-plugin 配置。路径为:

$DSH_HOME/profiles/web/cordis.patch.yml

示例配置如下。这里以 codex-warm 为预设,并同时设置 light/dark 的关键字段:

- id: theme-plugin
  config:
    preset: codex-warm
    light:
      accent: '#FF6B35'
      background: '#FFFAF0'
      foreground: '#1A1A1A'
      uiFont: '"Inter", "PingFang SC", sans-serif'
      codeFont: '"JetBrains Mono", Consolas, monospace'
      translucentSidebar: off
      contrast: 70
    dark:
      accent: '#FFB07A'
      background: '#1A1A1A'
      foreground: '#F5F5F5'
      uiFont: '"Inter", "PingFang SC", sans-serif'
      codeFont: '"JetBrains Mono", Consolas, monospace'
      translucentSidebar: on
      contrast: 70

只设置需要改动的字段。空字符串表示保留预设值;未设置字段不会被覆盖。

适用场景与注意

适合在 DSH Web GUI 中按个人习惯调整深浅色主题、字体、侧边栏和对比度的场景。使用插件前,建议先检查源码、许可证和行为范围;插件会随当前 dsh 进程权限运行。

需要注意:

  • 安装后需要重启 dsh web
  • GUI 选择优先于 host config。
  • stock 预设下颜色控制不可用,只能覆盖字体。
  • custom 模式基于 codex-warm 调色板开始,并使用 light.* / dark.* 字段。

链接

dsh-theme-plugin 的价值在于把 DSH Web GUI 的主题调整集中到预设与模式化配置中:先选预设,再按 light/dark 调颜色、字体、侧边栏和对比度,最后即时生效并保留。

GitHub 仓库:

https://github.com/BeiZi6/dsh-theme-plugin

目录页 URL 未在已核实资料中出现,本文不给出链接。

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

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

小夜