跳到正文

tzy168/dsh-web-theme-packs

30最近提交 2026年8月14日

dsh-web-theme-packs DSH 插件

dsh-web-theme-packs 是一个 DSH 插件,它监视目录中的主题包文件夹。每个包提供语义令牌、可选 CSS、字体和预览图。插件通过路由提供服务,用户可在设置→通用→主题包中切换。

如何安装 dsh-web-theme-packs DSH 插件

dsh plugin --profile web add ./dsh-web-theme-packs

复制不会执行命令。安装 dsh-web-theme-packs DSH 插件前请核对仓库和版本。

dsh-web-theme-packs DSH 插件数据来源

dsh-web-theme-packs DSH 插件快照日期:2026年8月16日

discovered

dsh-web-theme-packs DSH 插件能做什么

  • 监视可配置的目录集合(默认:内置 themes/ 和 $DSH_HOME/theme-packs),发现新的主题包文件夹。
  • 将每个包的令牌(CSS 自定义属性)注册到 DSH ThemeRuntime,使布局展示器应用 --dsw-* 令牌。
  • 通过可配置的路由前缀(默认 /dsh-theme-packs)提供每个包的 CSS、字体和预览图片。
  • 支持多个包共存;用户通过设置→通用→主题包选择激活的包。
  • 重写包 CSS 和令牌值中的相对 url() 引用,指向正确的包路径。
  • 提供 catalog.json 端点和 SSE 事件流,供宿主刷新包列表。

dsh-web-theme-packs DSH 插件适合哪些场景

  • 为 DSH Web 客户端创建自定义浅色主题,无需修改客户端代码。
  • 团队成员通过将品牌主题包放入 $DSH_HOME/theme-packs 目录来共享。
  • 在深色主题和高对比度主题之间快速切换,用于无障碍测试。
  • 将字体和自定义 CSS 调整与令牌覆盖打包在一起,实现一致的外观。
  • 分发季节性或活动主题包(如节日配色),可随时开关。

dsh-web-theme-packs DSH 插件适合谁

  • 希望个性化 UI 外观的 DSH Web 客户端用户。
  • 需要为团队或组织提供品牌主题的管理员或开发者。

dsh-web-theme-packs DSH 插件的限制

  • 仅覆盖语义令牌和可选 CSS;无法替换 React 图标组件或重新排列三栏布局。
  • 第三方令牌集不会进行完整性检查——不完整的覆盖会保留内置别名,可能导致配色混合。
  • 自定义包 ID 不在内置 ui-theme.preference 模式中;移除插件会丢弃选择,但不会重置最后的外观偏好。
  • 不支持替换窗口外观、图标集和布局的 Codex 风格皮肤(不同格式)。
  • 包 JSON 和 CSS 仅包含数据;加载器从不执行包中的 JavaScript。

dsh-web-theme-packs DSH 插件的仓库 README 摘录

以下文字摘自 dsh-web-theme-packs DSH 插件的上游仓库 tzy168/dsh-web-theme-packs 的 README,版权归原作者,仅作引用。

English | [中文](README.zh.md) Out-of-tree Web plugin: drop folders of theme files (colors, extra CSS, fonts, images) into a scanned directory, and the plugin registers them with [`ThemeRuntime`](../packages/client/ui-theme/README.md) so the existing layout presenter applies `--dsw-*` tokens. Multiple packs can sit side by side; Settings → General → Theme packs switches among them. This is a standalone bundle that will move to its own repository; it is not part of the shipped `dsh-web-app` roster. Codex-style skins that replace window chrome, icon sets, and layout are a different format. A DSH pack overrides semantic tokens and may add CSS/assets on top of the three-column Web client. It cannot replace React icon components or rearrange columns. ## Install From this checkout, after `pnpm install` at the repository root: ```sh pnpm --filter dsh-web-theme-packs bundle pnpm dsh plugin --profile web add ./dsh-web-theme-packs pnpm dsh web ``` `dsh plugin add` records the bundle on the profile. Removing it is `pnpm dsh plugin --profile web remove dsh-web-theme-packs`. ## Pack format Each pack is a directory that contains `theme.json`. Default scan roots are this package's `themes/`

阅读完整 README仓库未声明许可,使用前请先与作者确认。

dsh-web-theme-packs DSH 插件常见问题

如何安装 dsh-web-theme-packs?

克隆仓库,在根目录运行 'pnpm install',然后 'pnpm --filter dsh-web-theme-packs bundle' 构建包。最后使用 'pnpm dsh plugin --profile web add ./dsh-web-theme-packs' 将其添加到你的 DSH 配置文件中。之后用 'pnpm dsh web' 启动 Web 客户端。

我能创建一个主题包来替换整个布局吗?

不能。此插件仅覆盖语义令牌(CSS 自定义属性)并添加可选的 CSS、字体和图片。它无法替换 React 图标组件或重新排列三栏布局。如需完全更改布局,需要使用其他方式(Codex 风格皮肤)。

如果移除插件会发生什么?

插件及其配置(包括当前选中的主题包)会被移除。UI 将回退到默认的浅色/深色/系统外观。外观偏好不会自动重置;你可能需要在设置中手动重新选择。

如何添加新的主题包?

在扫描目录(默认:$DSH_HOME/theme-packs)中创建一个包含 'theme.json' 文件的文件夹。插件会监视目录并自动注册该包。文件夹必须包含有效的 theme.json,其中 'id' 符合模式 '^[a-z][a-z0-9-]*$',且不能是 'light'、'dark' 或 'system'。

插件支持深色模式主题包吗?

支持。每个包声明 'colorScheme' 字段(例如 'light' 或 'dark')。插件根据基础调色板(深色模式使用 body[data-ds-dark-theme])应用令牌。你可以创建浅色和深色主题包,并在它们之间切换。