Skip to content

修复 Mermaid 在自定义主题下的线条与文字对比度 - #77

Merged
shaohaozhi286 merged 2 commits into
masterfrom
codex/fix-mermaid-intrinsic-size
Sep 27, 2026
Merged

shaohaozhi286 merged 2 commits into
masterfrom
codex/fix-mermaid-intrinsic-size

Conversation

@shaohaozhi286

Copy link
Copy Markdown
Collaborator

当主题标记为深色、对话背景实际为浅粉色时,Mermaid 的浅色生命线与文字几乎不可见。现在按每张图所在区域的实际背景选择高对比默认配色,并在颜色变量、背景设置及背景过渡动画结束后重新检查和重绘。

保留原尺寸、透明无外框、横向滚动、复制、预览和导出。补充半透明背景合成、配色切换、过期异步结果及动画结束后的回归测试;共用现有任务栏徽标的对比度算法。

验证:pnpm test、pnpm build、openspec validate fix-mermaid-theme-contrast --strict、git diff --check origin/master 均通过。OpenSpec:fix-mermaid-theme-contrast。

真实生产构建在 Chrome 中验证五种图表及超宽图表,125%/150% DPI、390px 窄窗口、背景切换和放大预览通过。截图保存在本地可视化目录 mermaid-theme-contrast.png,对应的实测记录:

浅粉背景: theme=light, lifeline stroke=rgb(0, 0, 0), width=2px
深色背景: theme=dark, lifeline stroke=rgb(255, 255, 255), width=2px
时序图原尺寸: 850 × 689;图表外框 border=0,background=transparent
背景明暗切换: passed;预览: passed;原尺寸: passed;窄窗口滚动: passed

@shaohaozhi286
shaohaozhi286 merged commit 926e0f0 into master Sep 27, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants