Skip to content

Commit eaff811

Browse files
authored
[204_30] 修复欢迎文档的版本号部分在深色模式下的颜色问题 (#3087)
1 parent 8c223fb commit eaff811

File tree

5 files changed

+47
-6
lines changed

5 files changed

+47
-6
lines changed

TeXmacs/doc/about/mogan/stem.en.tmu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@
5151
<item>Mogan STEM is the community edition of <hlink|Liii STEM|https://liiistem.cn/docs/about-what-is-liiistem.html?from=app>, permanently free and open source. If you wish to support us, please consider purchasing Liii STEM.
5252
</enumerate-numeric>
5353

54-
<with|framed-color|pastel magenta|ornament-border|0ln|ornament-color|pastel yellow|<\ornamented>
54+
<\version-notice>
5555
You are using <strong|v<Xmacs-version>>. The current latest stable version is <strong|v<include|https://liiistem.cn/mogan_latest_version.tm>>. Visit the official website <hlink|https://mogan.app|https://mogan.app/en/?from=app> to download the latest stable version.
56-
</ornamented>>
56+
</version-notice>
5757

5858
<section*|Example Documents: What can I do with Mogan STEM?>
5959

TeXmacs/doc/about/mogan/stem.zh.tmu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@
4545
<item>Mogan STEM是<hlink|Liii STEM|https://liiistem.cn/docs/about-what-is-liiistem.html?from=app>的社区版,永久免费且开源,如果您想支持我们,欢迎购买Liii STEM。
4646
</enumerate-numeric>
4747

48-
<with|framed-color|pastel magenta|ornament-border|0ln|ornament-color|pastel yellow|<\ornamented>
48+
<\version-notice>
4949
您正在使用<strong|v<Xmacs-version>>,当前最新稳定版是<strong|v<include|https://liiistem.cn/mogan_latest_version.tm>>,可访问官网<hlink|https://mogan.app/zh|https://mogan.app/zh?from=app>下载最新稳定版。
50-
</ornamented>>
50+
</version-notice>
5151

5252
<section*|示例文档:我能用墨干做什么?>
5353

TeXmacs/packages/themes/dark/dark.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,15 @@
116116

117117
<assign|src-length|<macro|body|<with|mode|src|color|#2aadad|<arg|body>>>>
118118

119+
<assign|version-notice-bg-color|#6b5600>
120+
121+
<assign|version-notice-fg-color|#fff4cc>
122+
119123
\;
120124
</body>
121125

122126
<\initial>
123127
<\collection>
124128
<associate|preamble|true>
125129
</collection>
126-
</initial>
130+
</initial>

TeXmacs/styles/documentation/Mogan/tmudoc.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,20 @@
5252

5353
<assign|html-head-javascript-src|https://www.texmacs.org/javascript/texmacs_functions.js>
5454

55+
<assign|version-notice-bg-color|pastel yellow>
56+
57+
<assign|version-notice-fg-color|black>
58+
59+
<assign|version-notice-border|0ln>
60+
61+
<assign|version-notice|<\macro|body>
62+
<\with|ornament-border|<value|version-notice-border>|ornament-color|<value|version-notice-bg-color>|color|<value|version-notice-fg-color>>
63+
<\ornamented>
64+
<arg|body>
65+
</ornamented>
66+
</with>
67+
</macro>>
68+
5569
<\active*>
5670
<\src-comment>
5771
Sections, subsections and subsubsections.
@@ -140,4 +154,4 @@
140154
</body>
141155

142156
<initial|<\collection>
143-
</collection>>
157+
</collection>>

devel/204_30.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,29 @@
4747
3. 切换文档主题为深色
4848
4. 自动重启后文档直接变为黑色底,不需要二次打开
4949

50+
测试项九:版本提示块在浅色和深色模式下都清晰可读
51+
1. 在浅色主题下打开 `TeXmacs/doc/about/mogan/stem.zh.tmu``TeXmacs/doc/about/mogan/stem.en.tmu`
52+
2. 确认版本提示块保持原来的浅黄色背景,文字为深色,视觉效果与修改前一致
53+
3. 切换软件主题为深色,自动重启
54+
4. 重新打开上述文档,确认版本提示块变为深色背景、浅色文字,且文字与背景对比清晰
55+
5. 在深色主题和浅色主题之间重复切换,确认版本提示块会随主题变化,且浅色模式下颜色不发生额外变化
56+
57+
## 2026/04/01 版本提示块抽出宏,深色模式单独覆盖前景和背景色
58+
59+
### What
60+
将关于页面中“当前版本/最新稳定版”的提示块从文档内联的 `with + ornamented` 写法,抽成 Mogan 文档样式中的 `version-notice` 宏。
61+
浅色模式继续保持原来的浅黄色背景和黑色文字;深色模式通过主题变量覆盖,改为深色背景和浅色文字。
62+
63+
### Why
64+
此前提示块在文档里直接写死了 `ornament-color|pastel yellow`,而深色主题会将 decoration 的正文颜色设为白色,导致黄色底与白色字在深色模式下对比度不足。
65+
由于背景色是在文档调用点显式写死的,只改 dark 主题的全局默认值无法覆盖这个局部设置,因此需要先把这类提示块收敛到统一宏,再由深色主题覆写对应变量。
66+
67+
### How
68+
TeXmacs/styles/documentation/Mogan/tmudoc.ts 添加 `version-notice-bg-color``version-notice-fg-color``version-notice-border``version-notice` 宏,默认值保持浅色模式原样不变
69+
TeXmacs/packages/themes/dark/dark.ts 添加 `version-notice-bg-color``version-notice-fg-color` 的深色主题覆盖值
70+
TeXmacs/doc/about/mogan/stem.zh.tmu 将版本提示块改为调用 `version-notice`
71+
TeXmacs/doc/about/mogan/stem.en.tmu 将版本提示块改为调用 `version-notice`
72+
5073
## 2026/04/01 导出PDF只允许浅色
5174

5275
### What

0 commit comments

Comments
 (0)