File tree Expand file tree Collapse file tree 2 files changed +28
-1
lines changed
TeXmacs/packages/themes/dark Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change 9393 < assign | preview - bg - color | #5 a7cc2 >
9494
9595 < assign | table - selection - color | #5500 ff10 >
96+
97+ < assign | todo - color | #ffb3b3>
98+
99+ < assign | todo - bg - color | #5 a1f1f >
96100
97101 < assign | gr - grid - aspect | < tuple | < tuple | axes | #999999 > | < tuple | 1 | #666666 > | < tuple | 10 | #003153 > >>
98102
Original file line number Diff line number Diff line change 54544 . 重新打开上述文档,确认版本提示块变为深色背景、浅色文字,且文字与背景对比清晰
55555 . 在深色主题和浅色主题之间重复切换,确认版本提示块会随主题变化,且浅色模式下颜色不发生额外变化
5656
57+ 测试项十:todo 块在浅色和深色模式下颜色可区分
58+ 1 . 在浅色主题下打开任意包含 ` todo ` 块的 tmu 文档
59+ 2 . 确认 ` todo ` 块保持浅色模式默认配色,即浅红背景、深红文字
60+ 3 . 切换软件主题为深色,自动重启
61+ 4 . 重新打开该文档,确认 ` todo ` 块变为深色主题专用配色,不再沿用浅色模式的浅红背景
62+ 5 . 在深色主题和浅色主题之间重复切换,确认 ` todo ` 块颜色会随主题变化,且正文可读性保持正常
63+
64+ ## 2026/04/01 todo 块在深色模式下单独覆盖颜色
65+
66+ ### What
67+ 为 ` todo ` 块补充深色主题下的前景色和背景色覆盖。
68+ 浅色模式继续使用标准样式中的默认配色;深色模式在 dark theme 中单独指定更适合暗背景的 ` todo-color ` 和 ` todo-bg-color ` 。
69+
70+ ### Why
71+ ` todo ` 宏本身没有写死颜色,而是读取样式变量。
72+ 标准定义位于 ` TeXmacs/packages/standard/std-markup.ts ` ,其中默认值是 ` todo-color=dark red ` 、` todo-bg-color=pastel red ` 。
73+ 因此只要在深色主题包里覆盖这两个变量,就可以让 ` todo ` 块在深色模式和浅色模式下呈现不同配色,而不会影响浅色模式默认效果。
74+
75+ ### How
76+ TeXmacs/packages/standard/std-markup.ts :489 定义 ` todo-color `
77+ TeXmacs/packages/standard/std-markup.ts :491 定义 ` todo-bg-color `
78+ TeXmacs/packages/standard/std-markup.ts :495 中 ` todo ` 宏通过 ` render-todo ` 读取上述变量
79+ TeXmacs/packages/themes/dark/dark.ts 添加 ` todo-color ` 和 ` todo-bg-color ` 的深色主题覆盖值
80+
5781## 2026/04/01 版本提示块抽出宏,深色模式单独覆盖前景和背景色
5882
5983### What
@@ -115,4 +139,3 @@ src/System/Boot/init_texmacs.cpp :914 启动时仍然调用 `buffer_load`,但
115139### How
116140TeXmacs/progs/texmacs/texmacs/tm-files.scm :108 添加 sync-buffer-dark-style-with-gui-theme 函数,根据当前主题颜色调整文档的背景色
117141TeXmacs/progs/texmacs/texmacs/tm-files.scm :588 load-buffer-load 函数,应用 sync-buffer-dark-style-with-gui-theme 函数
118-
You can’t perform that action at this time.
0 commit comments