Overview
dsh-warm-theme
README / EN
Package documentation
Registry summary
dsh.pub verifies the pinned bundle contract, runtime facts, and distribution semantics. The complete README remains in the source repository.
Read the full README on GitHubLIMITATIONS
Known limitations
- **不改变布局**:只覆盖颜色与材质 token。侧边栏位置、composer 结构等需 fork `dsh-web-frontend` 重建,不在本包范围内。 (唯一例外是 macOS 侧栏底色,见下。) - **不做完整性校验**:按官方说明,注册主题意味着覆盖同名别名变量,运行时不会 校验一组覆盖是否完整。本包覆盖 66 个 token(22 个手调 + 19 个派生 + 8 个残留色 + 17 个形状材质) (含 10 个 `--dsw-specific-*`)。 - **持久化用 localStorage**:未走 Host settings API,因此不参与 DSH 的设置同步; 无痕模式下降级为仅当前进程生效。 ### macOS 侧边栏底色(唯一的非 token 例外) ui-sidebar 的根容器本来写了 `background: var(--dsw-specific-sidebar-fill)`, 但紧接着有一条平台覆盖把它置空: ```css [data-platform=darwin] .<hash>_root { background: 0 0 } ``` 于是 macOS 上侧栏透明,透出 ui-layout 的 `._<hash>_frame` (`background: var(--dsw-alias-bg-base)`)—— 与正文区同色。 这是 DSH 在 macOS 上的原生设计:侧栏与正文同底,靠边框分隔。 Windows 则走另一条分支(frame 用 sidebar-fill),天然两段式。 本包用一条 CSS 规则给 macOS 补上同类效果: ```css [data-platform='darwin'] div[class*='_sidebarCol'], div:has(> [data-window-drag]):not([data-window-drag]) { background: var(--dsw-specific-sidebar-fill); } ``` 为什么不能只覆盖 token:macOS 那条规则**不是纯 token**,里面混了硬编码的蓝色: ```css color-mix(in srgb, color-mix(in srgb, var(--dsw-specific-sidebar-fill) 97%, #7a9bf0) 40%, transparent) ``` 只覆盖 `--dsw-specific-sidebar-fill` 会留下一个蓝色调,必须整条 `background` 覆盖。 **两条选择器,一主一备**: | | 锚点 | 为什么 | |---|---|---| | 主 | `[class*='_sidebarCol']` | CSS Modules 只给**哈希前缀**加随机值,`sidebarCol` 这个 local 名是稳定的;不依赖 DOM 层级,也不怕哈希变化 | | 备 | `div:has(> [data-window-drag])` | 万一 ui-layout 改了类名,还能按结构反查(`data-window-drag` 是 macOS 标题栏拖拽区,仅在 macOS 渲染) | 两条都命中时取值相同,重复也无害。`.centerCol` / `.frame` 本包一概不碰 —— 那两个在 Windows 上由原生布局正确驱动,越位覆盖会破坏 Windows 的圆角卡片。 **失效行为**:若 DSH 升级后类名与属性都改名,本规则静默失效,侧栏回落到原生同色 —— 不报错、不影响任何其它样式。`test/smoke.mjs` 里有断言盯着这件事。
