@bytechain.cn/colamd-themes 0.3.2 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/.claude/skills/colamd-themes-preview.skill.md +333 -0
  2. package/.claude/skills/colamd-themes.skill.md +10 -0
  3. package/.dsh/skills/colamd-themes/SKILL.md +14 -0
  4. package/.github/supported-topics.yml +17 -0
  5. package/.hermes/skills/tools/colamd-themes/SKILL.md +14 -0
  6. package/.openclaw/skills/colamd-themes/SKILL.md +1 -37
  7. package/.opencode/skills/colamd-themes/SKILL.md +17 -0
  8. package/.trae/rules/colamd-themes.md +0 -36
  9. package/CHANGELOG.md +331 -241
  10. package/DSH_SUPPORT_SUMMARY.md +87 -0
  11. package/README.md +414 -384
  12. package/README_CN.md +412 -384
  13. package/RELEASENOTE.md +541 -389
  14. package/dist/cli.js +36 -55
  15. package/dist/cli.js.map +1 -1
  16. package/dist/color-utils.d.ts +1 -0
  17. package/dist/color-utils.js +25 -6
  18. package/dist/color-utils.js.map +1 -1
  19. package/dist/extractors/pdf-extractor.js +6 -1
  20. package/dist/extractors/pdf-extractor.js.map +1 -1
  21. package/dist/extractors/url-extractor.d.ts +0 -4
  22. package/dist/extractors/url-extractor.js +13 -126
  23. package/dist/extractors/url-extractor.js.map +1 -1
  24. package/dist/generator.d.ts +1 -1
  25. package/dist/generator.js +32 -11
  26. package/dist/generator.js.map +1 -1
  27. package/dist/models.d.ts +5 -4
  28. package/dist/models.js +2 -3
  29. package/dist/models.js.map +1 -1
  30. package/dist/renderer.d.ts +6 -3
  31. package/dist/renderer.js +54 -93
  32. package/dist/renderer.js.map +1 -1
  33. package/dist/templates/template.css +220 -498
  34. package/dist/templates/theme-paradigm.md +530 -658
  35. package/dist/templates/theme-template.hbs +256 -370
  36. package/dist/theme-store.js +19 -3
  37. package/dist/theme-store.js.map +1 -1
  38. package/dist/utils/document-paradigm.d.ts +12 -0
  39. package/dist/utils/document-paradigm.js +109 -0
  40. package/dist/utils/document-paradigm.js.map +1 -0
  41. package/dist/validators.d.ts +4 -1
  42. package/dist/validators.js +115 -1
  43. package/dist/validators.js.map +1 -1
  44. package/mcp-server/dist/index.d.ts +13 -0
  45. package/mcp-server/dist/index.d.ts.map +1 -0
  46. package/mcp-server/dist/index.js +0 -0
  47. package/mcp-server/dist/index.js.map +1 -0
  48. package/mcp-server/package-lock.json +1759 -0
  49. package/mcp-server/package.json +24 -0
  50. package/mcp-server/src/index.ts +0 -0
  51. package/mcp-server/tsconfig.json +19 -0
  52. package/package.json +54 -36
  53. package/skills/build-skills.sh +30 -5
  54. package/skills/colamd-themes/SKILL.md +180 -178
  55. package/src/cli.ts +474 -487
  56. package/src/color-systems.ts +289 -289
  57. package/src/color-utils.ts +137 -120
  58. package/src/contrast.ts +66 -66
  59. package/src/docx-style-paradigm.ts +811 -811
  60. package/src/export-cli.ts +356 -356
  61. package/src/extractors/base.ts +8 -8
  62. package/src/extractors/docx-extractor.ts +417 -417
  63. package/src/extractors/pdf-extractor.ts +533 -527
  64. package/src/extractors/url-extractor.ts +846 -981
  65. package/src/generator.ts +197 -169
  66. package/src/index.ts +29 -29
  67. package/src/models.ts +212 -212
  68. package/src/renderer.ts +310 -359
  69. package/src/templates/template.css +220 -498
  70. package/src/templates/theme-paradigm.md +530 -658
  71. package/src/templates/theme-template.hbs +256 -370
  72. package/src/theme-store.ts +185 -170
  73. package/src/types/pdf-parse.d.ts +12 -12
  74. package/src/utils/cli-utils.ts +84 -84
  75. package/src/utils/document-paradigm.ts +118 -0
  76. package/src/validators.ts +298 -176
  77. package/themes/academic-paper-pt.css +353 -1805
  78. package/themes/academic-paper.css +350 -1099
  79. package/themes/academic-style.css +342 -2430
  80. package/themes/colly.css +256 -370
  81. package/themes/elegant.css +288 -671
  82. package/themes/forest-ink.css +240 -664
  83. package/themes/guizang.css +250 -732
  84. package/themes/hermes-security.css +279 -0
  85. package/themes/meeting-minutes.css +256 -370
  86. package/themes/pixso-design.css +278 -1261
  87. package/themes/salvator-blog.css +256 -370
  88. package/themes/shimo-theme.css +256 -0
  89. package/themes/swiss-design.css +285 -746
  90. package/themes/template.css +220 -498
  91. package/themes/trae-blue.css +280 -737
  92. package/themes/word-contract.css +249 -0
  93. package/themes-preview/demo-content.md +187 -187
  94. package/tsconfig.json +18 -18
  95. package/src/mermaid-presets.ts +0 -142
  96. package/themes/swiss-design copy.css +0 -746
  97. package/themes-preview/colly-preview.html +0 -623
  98. package/themes-preview/meeting-minutes-preview.html +0 -625
  99. package/themes-preview/salvator-blog-preview.html +0 -623
@@ -1,737 +1,280 @@
1
- /*
2
- * ColaMD 主题:Trae Blue(Trae IDE 文档风格)
3
- * 版本:v1.0
4
- *
5
- * 风格来源:docs.trae.cn — Trae IDE 官方文档站
6
- * 风格特征:
7
- * - 白底 + Slate 灰阶文字,高可读性技术文档风格
8
- * - 系统原生无衬线字体,中英文混排自然
9
- * - 右侧大纲菜单(TOC side menu),层级清晰
10
- * - 蓝色点缀(#3b82f6),克制且高效
11
- *
12
- * 导入:Theme > Import Theme
13
- */
14
-
15
- /* ═══════════════════════════════════════════════════════════
16
- SECTION 1 — 设计令牌 (Design Tokens)
17
- ═══════════════════════════════════════════════════════════ */
18
-
19
- body.theme-custom {
20
-
21
- /* ═══════════════════════════════════════════════════════════
22
- 1.1 种子色板 — Trae 亮底蓝点缀
23
- 白底 + 深 slate 文字 + 亮蓝点缀
24
- ═══════════════════════════════════════════════════════════ */
25
-
26
- --seed-accent: #3b82f6; /* Trae Blue 主色 */
27
- --seed-accent-light: #eff6ff; /* 极浅蓝背景 */
28
- --seed-accent-dark: #2563eb; /* 深蓝 hover */
29
-
30
- /* 表面色:Slate 亮色层级(Tailwind slate-50/100 体系) */
31
- --seed-surface: #ffffff; /* L0 页面背景(纯白) */
32
- --seed-panel: #f8fafc; /* L1 卡片/侧栏背景(极浅灰蓝)*/
33
- --seed-panel-alt: #f1f5f9; /* L2 代码区/引用块背景 */
34
-
35
- /* 文字色:Slate 灰阶 — 高可读性,蓝灰调 */
36
- --seed-ink: #0f172a; /* T0 正文/标题(slate-900) */
37
- --seed-ink-muted: #475569; /* T1 次要文字(slate-600) */
38
- --seed-ink-dim: #94a3b8; /* T2 弱化文字(slate-400) */
39
-
40
- /* 边框色:极淡,仅以微差区分层级 */
41
- --seed-border: #e2e8f0; /* 淡边框(slate-200) */
42
- --seed-border-strong: #3b82f6; /* 强调边框 = Trae Blue */
43
-
44
- /* ═══════════════════════════════════════════════════════════
45
- 1.2 字体系统 — 思源宋体正文字 + 思源黑体标题
46
- ═══════════════════════════════════════════════════════════ */
47
-
48
- --font-body: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun",
49
- Georgia, "Times New Roman", serif;
50
-
51
- --font-heading: "Noto Sans SC", "Source Han Sans SC", "YouHei",
52
- "Heiti SC", "Microsoft YaHei", sans-serif;
53
-
54
- --font-code: "Cascadia Code", "JetBrains Mono", "Fira Code", "SF Mono", Menlo, Consolas, monospace;
55
-
56
- --font-mermaid: var(--font-heading);
57
-
58
- /* ═══════════════════════════════════════════════════════════
59
- 1.3 字号 & 间距
60
- ═══════════════════════════════════════════════════════════ */
61
-
62
- --font-size-root: 15px;
63
-
64
- --font-scale-h1: 2.0; /* 30px */
65
- --font-scale-h2: 1.8; /* 22px */
66
- --font-scale-h3: 1.5; /* 18px */
67
- --font-scale-h4: 1.2; /* 16px */
68
- --font-scale-h5: 1.0; /* 15px */
69
- --font-scale-h6: 0.867; /* 13px */
70
-
71
- --font-size-mermaid: 12px;
72
-
73
- --line-height-body: 1.75;
74
- --line-height-heading: 1.35;
75
- --line-height-code: 1.6;
76
-
77
- /* ═══════════════════════════════════════════════════════════
78
- 1.4 圆角 & 间距
79
- ═══════════════════════════════════════════════════════════ */
80
- --radius-sm: 4px;
81
- --radius-md: 6px;
82
- --radius-lg: 8px;
83
- --content-width: 780px;
84
-
85
- /* ═══════════════════════════════════════════════════════════
86
- SECTION 2 — 语义映射 (Semantic Mapping)
87
- ═══════════════════════════════════════════════════════════ */
88
-
89
- --bg-color: var(--seed-surface);
90
- --surface-color: var(--seed-panel);
91
- --surface-alt: var(--seed-panel-alt);
92
-
93
- --text-color: var(--seed-ink);
94
- --heading-color: var(--seed-ink);
95
- --text-muted: var(--seed-ink-muted);
96
- --text-dim: var(--seed-ink-dim);
97
-
98
- --link-color: var(--seed-accent);
99
- --accent-color: var(--seed-accent);
100
- --accent-dark: var(--seed-accent-dark);
101
- --accent-light: var(--seed-accent-light);
102
- --selection-bg: rgba(59, 130, 246, 0.12);
103
-
104
- --border-color: var(--seed-border);
105
- --blockquote-border: var(--seed-accent);
106
- --hr-color: var(--seed-border);
107
-
108
- --code-bg: #f1f5f9;
109
- --code-color: var(--seed-accent);
110
-
111
- --code-block-bg: #f8fafc;
112
- --code-block-text: var(--seed-ink);
113
- --code-block-color: var(--seed-ink);
114
-
115
- --blockquote-bg: var(--seed-panel);
116
-
117
- --table-header-bg: var(--seed-accent-light);
118
- --table-border: var(--seed-border);
119
- --table-header-text: var(--seed-ink);
120
-
121
- --scrollbar-thumb: var(--seed-border);
122
- --scrollbar-thumb-hover: var(--seed-ink-muted);
123
-
124
- /* ═══════════════════════════════════════════════════════════
125
- SECTION 3 — Mermaid 图表变量
126
- ═══════════════════════════════════════════════════════════ */
127
-
128
- --mermaid-background: var(--seed-surface);
129
- --mermaid-border-color: var(--seed-border);
130
- --mermaid-border-radius: var(--radius-md);
131
- --mermaid-padding: 24px;
132
-
133
- --mermaid-font-family: var(--font-mermaid);
134
- --mermaid-font-size: var(--font-size-mermaid);
135
-
136
- --mermaid-node-fill: var(--seed-panel);
137
- --mermaid-node-stroke: var(--seed-ink-muted);
138
- --mermaid-node-stroke-width: 1px;
139
- --mermaid-node-text: var(--seed-ink);
140
-
141
- --mermaid-edge-stroke: var(--seed-ink-muted);
142
- --mermaid-edge-stroke-width: 1px;
143
-
144
- --mermaid-cluster-fill: var(--seed-panel-alt);
145
- --mermaid-cluster-stroke: var(--seed-border);
146
-
147
- --mermaid-label-text: var(--seed-ink);
148
- --mermaid-edge-label-text: var(--seed-ink-muted);
149
- --mermaid-edge-label-bg: var(--seed-surface);
150
-
151
- --mermaid-title-text: var(--seed-ink);
152
- --mermaid-axis-text: var(--seed-ink-muted);
153
- --mermaid-highlight: var(--seed-accent);
154
-
155
- --mermaid-person-stroke: var(--seed-ink-muted);
156
- --mermaid-person-fill: var(--seed-panel);
157
-
158
- --mermaid-label-offset-y: 0px;
159
-
160
- /* ═══════════════════════════════════════════════════════════
161
- SECTION 4 — 排版微调
162
- ═══════════════════════════════════════════════════════════ */
163
- --line-height-base: var(--line-height-body);
164
- }
165
-
166
- /* ═════════════════════════════════════════════════════════════
167
- SECTION 5 — 选择器级微调 (Selector Fine-Tuning)
168
- ═════════════════════════════════════════════════════════════ */
169
-
170
- /* ── 5.0 全局:白底 + Slate 灰阶文字 ── */
171
- html { font-size: var(--font-size-root); }
172
- body.theme-custom, html, body {
173
- background-color: var(--bg-color);
174
- color: var(--text-color);
175
- font-family: var(--font-body);
176
- font-weight: 300;
177
- line-height: var(--line-height-body);
178
- text-align: left;
179
- -webkit-font-smoothing: antialiased;
180
- -moz-osx-font-smoothing: grayscale;
181
- }
182
-
183
- /* ── 5.1 编辑区:居中留白 ── */
184
- #write {
185
- max-width: var(--content-width);
186
- margin: 0 auto;
187
- padding: 48px 64px 120px;
188
- }
189
-
190
- /* ── 5.1.1 正文段落:首行缩进 ── */
191
- body.theme-custom p, body.theme-custom #write > p {
192
- margin: 0;
193
- line-height: var(--line-height-body);
194
- text-align: left;
195
- text-indent: 2em;
196
- font-size: var(--font-size-root);
197
- }
198
- body.theme-custom p + p { margin-top: 0; }
199
-
200
- /* 重置:列表、表格、引用块、图表中的段落不缩进 */
201
- body.theme-custom li p,
202
- body.theme-custom li,
203
- body.theme-custom td p,
204
- body.theme-custom th p,
205
- body.theme-custom blockquote p,
206
- body.theme-custom .mermaid-block p,
207
- body.theme-custom figure p,
208
- body.theme-custom pre p {
209
- text-indent: 0;
210
- }
211
-
212
- /* 列表整体缩进与正文首行对齐 — 直接参考 academic-paper.css §5.7 */
213
- body.theme-custom ul,
214
- body.theme-custom ol,
215
- body.theme-custom li {
216
- margin: 0;
217
- padding: 0;
218
- }
219
-
220
- body.theme-custom #editor .ProseMirror > ul,
221
- body.theme-custom #editor .ProseMirror > ol,
222
- body.theme-custom #write > ul,
223
- body.theme-custom #write > ol {
224
- margin: 6px 0 6px 2em;
225
- padding-left: 1.5em;
226
- list-style-position: outside;
227
- }
228
-
229
- body.theme-custom ul ul,
230
- body.theme-custom ul ol,
231
- body.theme-custom ol ul,
232
- body.theme-custom ol ol {
233
- margin: 0;
234
- padding-left: 1.5em;
235
- }
236
-
237
- body.theme-custom li {
238
- line-height: var(--line-height-body);
239
- font-family: var(--font-body);
240
- font-size: var(--font-size-root);
241
- font-weight: normal;
242
- text-indent: 0;
243
- padding: 2px 0;
244
- }
245
-
246
- body.theme-custom li::before {
247
- content: none;
248
- }
249
-
250
- body.theme-custom #editor .ProseMirror li > p {
251
- display: inline;
252
- margin: 0;
253
- padding: 0;
254
- text-indent: 0;
255
- font-size: inherit;
256
- font-weight: inherit;
257
- font-family: inherit;
258
- }
259
-
260
- /* ── 5.1.2 列表层级颜色:逐级降灰,重点突出 ── */
261
-
262
- /* 一级列表:正文黑,确保重点可读 */
263
- body.theme-custom #write > ul > li,
264
- body.theme-custom #write > ol > li,
265
- body.theme-custom #editor .ProseMirror > ul > li,
266
- body.theme-custom #editor .ProseMirror > ol > li {
267
- color: var(--seed-ink);
268
- }
269
-
270
- /* 一级列表内 strong:加深为纯黑,强化重点 */
271
- body.theme-custom #write > ul > li strong,
272
- body.theme-custom #write > ol > li strong,
273
- body.theme-custom #editor .ProseMirror > ul > li strong,
274
- body.theme-custom #editor .ProseMirror > ol > li strong {
275
- color: #020617;
276
- font-weight: 700;
277
- }
278
-
279
- /* 一级列表内 a:保持蓝色 */
280
- body.theme-custom #write > ul > li a,
281
- body.theme-custom #write > ol > li a {
282
- color: var(--link-color);
283
- }
284
-
285
- /* 二级列表:中灰 slate-600,视觉收缩 */
286
- body.theme-custom #write > ul > li > ul > li,
287
- body.theme-custom #write > ul > li > ol > li,
288
- body.theme-custom #write > ol > li > ul > li,
289
- body.theme-custom #write > ol > li > ol > li {
290
- color: var(--seed-ink-muted);
291
- }
292
-
293
- /* 三级列表:浅灰 slate-400,辅助收敛 */
294
- body.theme-custom #write > ul > li > ul > li > ul > li,
295
- body.theme-custom #write > ul > li > ul > li > ol > li,
296
- body.theme-custom #write > ul > li > ol > li > ul > li,
297
- body.theme-custom #write > ul > li > ol > li > ol > li,
298
- body.theme-custom #write > ol > li > ul > li > ul > li,
299
- body.theme-custom #write > ol > li > ul > li > ol > li,
300
- body.theme-custom #write > ol > li > ol > li > ul > li,
301
- body.theme-custom #write > ol > li > ol > li > ol > li {
302
- color: var(--seed-ink-dim);
303
- font-size: calc(var(--font-size-root) * 0.933);
304
- }
305
-
306
- /* 四级及更深:保持三级色 */
307
- body.theme-custom #write ul ul ul ul li,
308
- body.theme-custom #write ol ol ol ol li {
309
- color: var(--seed-ink-dim);
310
- font-size: calc(var(--font-size-root) * 0.9);
311
- }
312
-
313
- /* ── 5.2 标题:Trae 文档风 — 蓝底序号 + 紧凑层级 ── */
314
- body.theme-custom h1, body.theme-custom h2, body.theme-custom h3,
315
- body.theme-custom h4, body.theme-custom h5, body.theme-custom h6 {
316
- font-family: var(--font-heading);
317
- color: var(--heading-color);
318
- font-weight: 600;
319
- line-height: var(--line-height-heading);
320
- text-align: left;
321
- letter-spacing: -0.015em;
322
- }
323
-
324
- body.theme-custom h1 {
325
- font-size: calc(var(--font-size-root) * var(--font-scale-h1));
326
- margin-top: 2em;
327
- margin-bottom: 0.5em;
328
- padding-bottom: 0.35em;
329
- border-bottom: 1px solid var(--seed-border);
330
- }
331
-
332
- body.theme-custom h2 {
333
- font-size: calc(var(--font-size-root) * var(--font-scale-h2));
334
- margin-top: 1.75em;
335
- margin-bottom: 0.5em;
336
- padding-left: 0.75em;
337
- border-left: 3px solid var(--seed-accent);
338
- }
339
-
340
- body.theme-custom h3 {
341
- font-size: calc(var(--font-size-root) * var(--font-scale-h3));
342
- margin-top: 1.5em;
343
- margin-bottom: 0.4em;
344
- }
345
-
346
- body.theme-custom h4 {
347
- font-size: calc(var(--font-size-root) * var(--font-scale-h4));
348
- color: var(--seed-accent);
349
- margin-top: 1.25em;
350
- margin-bottom: 0.8em;
351
- padding-left: 1em;
352
- }
353
-
354
- body.theme-custom h5 {
355
- font-size: calc(var(--font-size-root) * var(--font-scale-h5));
356
- color: var(--seed-ink-muted);
357
- }
358
-
359
- body.theme-custom h6 {
360
- font-size: calc(var(--font-size-root) * var(--font-scale-h6));
361
- color: var(--seed-ink-dim);
362
- }
363
-
364
- /* ── 5.3 内联强调 ── */
365
- body.theme-custom strong { color: var(--seed-ink); font-weight: 600; }
366
- body.theme-custom em { font-style: italic; color: var(--seed-ink-muted); }
367
-
368
- /* ── 5.4 链接:Trae Blue + 底部横线 ── */
369
- body.theme-custom a {
370
- color: var(--link-color);
371
- text-decoration: none;
372
- border-bottom: 1px solid var(--link-color);
373
- }
374
- body.theme-custom a:hover {
375
- color: var(--accent-dark);
376
- border-bottom: 2px solid var(--accent-dark);
377
- }
378
-
379
- /* ── 5.5 内联代码 ── */
380
- body.theme-custom code {
381
- font-family: var(--font-code);
382
- font-size: 0.9em;
383
- background: var(--code-bg);
384
- color: var(--code-color);
385
- border-radius: var(--radius-sm);
386
- padding: 2px 6px;
387
- }
388
-
389
- /* ── 5.6 代码块 ── */
390
- body.theme-custom pre {
391
- background: var(--code-block-bg);
392
- font-family: var(--font-code);
393
- font-size: 13px;
394
- line-height: var(--line-height-code);
395
- border-radius: var(--radius-md);
396
- border: 1px solid var(--seed-border);
397
- padding: 16px 20px;
398
- }
399
- body.theme-custom pre code {
400
- color: var(--code-block-text);
401
- background: transparent;
402
- }
403
-
404
- /* ── 5.7 引用块 ── */
405
- body.theme-custom blockquote {
406
- background: var(--blockquote-bg);
407
- border-left: 3px solid var(--blockquote-border);
408
- padding: 12px 20px 12px 24px;
409
- border-radius: var(--radius-md);
410
- color: var(--seed-ink-muted);
411
- }
412
-
413
- /* ── 5.8 表格 ── */
414
- body.theme-custom table {
415
- border-collapse: collapse;
416
- }
417
- body.theme-custom table th {
418
- background: var(--table-header-bg);
419
- color: var(--table-header-text);
420
- font-family: var(--font-heading);
421
- font-weight: 600;
422
- font-size: 0.875em;
423
- padding: 10px 14px;
424
- border: 1px solid var(--seed-border);
425
- }
426
- body.theme-custom table td {
427
- padding: 8px 14px;
428
- border: 1px solid var(--seed-border);
429
- color: var(--seed-ink-muted);
430
- }
431
-
432
- /* ── 5.9 分割线 ── */
433
- body.theme-custom hr {
434
- border: none;
435
- border-top: 1px solid var(--hr-color);
436
- margin: 2.5em 0;
437
- }
438
-
439
- /* ── 5.10 图片 ── */
440
- body.theme-custom img { max-width: 100%; border-radius: var(--radius-md); }
441
-
442
- /* ── 5.11 图表标题 ── */
443
- body.theme-custom .mermaid-block + p {
444
- text-align: center;
445
- font-family: var(--font-heading);
446
- font-size: 0.875em;
447
- color: var(--text-muted);
448
- margin-top: 8px;
449
- }
450
-
451
- /* ═════════════════════════════════════════════════════════════
452
- ── 5.11 右侧菜单:大纲 / TOC 侧栏 — Trae 文档站风格
453
- 目标:渲染成 Trae docs 右侧导航菜单的效果
454
- ═════════════════════════════════════════════════════════════ */
455
-
456
- /* ── 5.11.0 侧栏全局容器 ── */
457
- body.theme-custom #sidebar,
458
- body.theme-custom .sidebar-content {
459
- background: var(--seed-panel);
460
- border-left: 1px solid var(--seed-border);
461
- font-family: var(--font-body);
462
- font-size: 13px;
463
- color: var(--seed-ink-muted);
464
- }
465
-
466
- /* ── 5.11.1 大纲面板:Trae 右侧导航菜单 ── */
467
- body.theme-custom .outline-content {
468
- font-size: 13px;
469
- line-height: 1.6;
470
- padding: 12px 0;
471
- }
472
-
473
- body.theme-custom .outline-item {
474
- padding: 4px 16px 4px 20px;
475
- border-left: 2px solid transparent;
476
- transition: all 0.15s ease;
477
- cursor: pointer;
478
- color: var(--seed-ink-muted);
479
- }
480
-
481
- body.theme-custom .outline-item:hover {
482
- color: var(--seed-ink);
483
- background: var(--seed-panel-alt);
484
- border-left-color: var(--seed-ink-muted);
485
- }
486
-
487
- body.theme-custom .outline-item.outline-active {
488
- color: var(--seed-accent);
489
- background: var(--seed-accent-light);
490
- border-left-color: var(--seed-accent);
491
- font-weight: 500;
492
- }
493
-
494
- /* 大纲层级缩进 */
495
- body.theme-custom .outline-h1 { padding-left: 20px; font-weight: 600; }
496
- body.theme-custom .outline-h2 { padding-left: 32px; }
497
- body.theme-custom .outline-h3 { padding-left: 44px; font-size: 12px; }
498
- body.theme-custom .outline-h4 { padding-left: 56px; font-size: 12px; color: var(--seed-ink-dim); }
499
-
500
- /* ── 5.11.2 内联 TOC(文档内目录) ── */
501
- body.theme-custom .md-toc {
502
- font-size: 0.9em;
503
- background: var(--seed-panel);
504
- border: 1px solid var(--seed-border);
505
- border-radius: var(--radius-md);
506
- padding: 16px 20px;
507
- margin: 16px 0;
508
- }
509
-
510
- body.theme-custom .md-toc-content {
511
- margin-left: 0;
512
- }
513
-
514
- body.theme-custom .md-toc-item {
515
- padding: 3px 0;
516
- color: var(--seed-ink-muted);
517
- }
518
-
519
- body.theme-custom .md-toc-item a {
520
- color: var(--seed-ink-muted);
521
- border-bottom: none;
522
- }
523
- body.theme-custom .md-toc-item a:hover {
524
- color: var(--seed-accent);
525
- border-bottom: none;
526
- }
527
-
528
- body.theme-custom .md-toc-h1 .md-toc-inner { font-weight: 600; }
529
- body.theme-custom .md-toc-h2 .md-toc-inner { padding-left: 12px; }
530
- body.theme-custom .md-toc-h3 .md-toc-inner { padding-left: 24px; }
531
-
532
- /* ── 5.11.3 搜索高亮 ── */
533
- body.theme-custom #write .md-search-hit {
534
- background: rgba(59, 130, 246, 0.18);
535
- border-radius: 2px;
536
- color: var(--seed-ink);
537
- }
538
-
539
- /* ── 5.12 响应式 ── */
540
- @media only screen and (max-width: 768px) {
541
- #write { padding: 20px; }
542
- body.theme-custom h1 { font-size: calc(var(--font-size-root) * 1.5); }
543
- }
544
-
545
- /* ═════════════════════════════════════════════════════════════
546
- SECTION 6 — 打印 / 导出
547
- 屏幕已为亮色方案,打印保持一致。隐藏侧栏菜单。
548
- ═════════════════════════════════════════════════════════════ */
549
- @media print {
550
- @page {
551
- size: A4;
552
- margin: 10mm 10mm 10mm 10mm;
553
- }
554
-
555
- body.theme-custom {
556
- --seed-accent: #3b82f6;
557
- --seed-accent-light: #eff6ff;
558
- --seed-accent-dark: #2563eb;
559
- --seed-surface: #ffffff;
560
- --seed-panel: #f8fafc;
561
- --seed-panel-alt: #f1f5f9;
562
- --seed-ink: #0f172a;
563
- --seed-ink-muted: #475569;
564
- --seed-ink-dim: #94a3b8;
565
- --seed-border: #e2e8f0;
566
- --font-size-root: 15px;
567
- --line-height-body: 1.75;
568
- --line-height-heading: 1.35;
569
- --line-height-code: 1.6;
570
- --font-scale-h1: 2.0;
571
- --font-scale-h2: 1.467;
572
- --font-scale-h3: 1.2;
573
- --font-scale-h4: 1.2;
574
- --font-scale-h5: 1.0;
575
- --font-scale-h6: 0.867;
576
- --content-width: 780px;
577
- --font-size-mermaid: 12px;
578
- --accent-color: var(--seed-accent);
579
- --accent-dark: var(--seed-accent-dark);
580
- --code-bg: #f1f5f9;
581
- --code-color: var(--seed-accent);
582
- --code-block-bg: #f8fafc;
583
- --code-block-text: var(--seed-ink);
584
- --blockquote-bg: var(--seed-panel);
585
- --table-header-bg: var(--seed-accent-light);
586
- --table-header-text: var(--seed-ink);
587
- --border-color: var(--seed-border);
588
- --hr-color: var(--seed-border);
589
- --font-body: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun",
590
- Georgia, "Times New Roman", serif;
591
- --font-heading: "Noto Sans SC", "Source Han Sans SC", "YouHei",
592
- "Heiti SC", "Microsoft YaHei", sans-serif;
593
- --font-code: "Cascadia Code", "JetBrains Mono", "Fira Code", "SF Mono", Menlo, Consolas, monospace;
594
- }
595
-
596
- html {
597
- font-size: var(--font-size-root) !important;
598
- }
599
- html, body, body.theme-custom {
600
- background: var(--seed-surface) !important;
601
- color: var(--seed-ink) !important;
602
- font-family: var(--font-body) !important;
603
- font-weight: 380 !important;
604
- line-height: var(--line-height-body) !important;
605
- text-align: left !important;
606
- -webkit-print-color-adjust: exact !important;
607
- print-color-adjust: exact !important;
608
- }
609
-
610
- #write {
611
- max-width: var(--content-width) !important;
612
- margin: 0 auto !important;
613
- padding: 40px 28px 100px !important;
614
- }
615
-
616
- body.theme-custom p, body.theme-custom #write > p {
617
- margin: 0 !important;
618
- line-height: var(--line-height-body) !important;
619
- text-align: left !important;
620
- text-indent: 2em !important;
621
- font-size: var(--font-size-root) !important;
622
- }
623
- body.theme-custom p + p { margin-top: 0 !important; }
624
-
625
- body.theme-custom li p,
626
- body.theme-custom li,
627
- body.theme-custom td p,
628
- body.theme-custom th p,
629
- body.theme-custom blockquote p,
630
- body.theme-custom .mermaid-block p,
631
- body.theme-custom figure p,
632
- body.theme-custom pre p {
633
- text-indent: 0 !important;
634
- }
635
-
636
- body.theme-custom ul, body.theme-custom ol, body.theme-custom li {
637
- margin: 0 !important;
638
- padding: 0 !important;
639
- }
640
-
641
- body.theme-custom #editor .ProseMirror > ul,
642
- body.theme-custom #editor .ProseMirror > ol,
643
- body.theme-custom #write > ul,
644
- body.theme-custom #write > ol {
645
- margin: 6px 0 6px 2em !important;
646
- padding-left: 1.5em !important;
647
- list-style-position: outside !important;
648
- }
649
-
650
- body.theme-custom ul ul, body.theme-custom ul ol,
651
- body.theme-custom ol ul, body.theme-custom ol ol {
652
- margin: 0 !important;
653
- padding-left: 1.5em !important;
654
- }
655
-
656
- body.theme-custom li {
657
- line-height: var(--line-height-body) !important;
658
- font-family: var(--font-body) !important;
659
- font-size: var(--font-size-root) !important;
660
- font-weight: normal !important;
661
- text-indent: 0 !important;
662
- padding: 2px 0 !important;
663
- }
664
-
665
- body.theme-custom li::before {
666
- content: none !important;
667
- }
668
-
669
- body.theme-custom #editor .ProseMirror li > p {
670
- display: inline !important;
671
- margin: 0 !important;
672
- padding: 0 !important;
673
- text-indent: 0 !important;
674
- font-size: inherit !important;
675
- font-weight: inherit !important;
676
- font-family: inherit !important;
677
- }
678
-
679
- body.theme-custom h1, body.theme-custom h2, body.theme-custom h3,
680
- body.theme-custom h4, body.theme-custom h5, body.theme-custom h6 {
681
- font-family: var(--font-heading) !important;
682
- font-weight: 600 !important;
683
- line-height: var(--line-height-heading) !important;
684
- text-align: left !important;
685
- letter-spacing: -0.015em !important;
686
- color: var(--seed-ink) !important;
687
- }
688
-
689
- body.theme-custom h1 {
690
- font-size: calc(var(--font-size-root) * var(--font-scale-h1)) !important;
691
- margin-top: 2em !important;
692
- margin-bottom: 0.5em !important;
693
- padding-bottom: 0.35em !important;
694
- border-bottom: 1px solid var(--seed-border) !important;
695
- }
696
-
697
- body.theme-custom h2 {
698
- font-size: calc(var(--font-size-root) * var(--font-scale-h2)) !important;
699
- margin-top: 1.75em !important;
700
- margin-bottom: 0.5em !important;
701
- padding-left: 0.75em !important;
702
- border-left: 3px solid var(--seed-accent) !important;
703
- }
704
-
705
- body.theme-custom h3 {
706
- font-size: calc(var(--font-size-root) * var(--font-scale-h3)) !important;
707
- }
708
-
709
- body.theme-custom h4 {
710
- font-size: calc(var(--font-size-root) * var(--font-scale-h4)) !important;
711
- color: var(--seed-accent) !important;
712
- margin-top: 1.25em !important;
713
- margin-bottom: 0.8em !important;
714
- padding-left: 1em !important;
715
- }
716
-
717
- body.theme-custom table th {
718
- background: var(--table-header-bg) !important;
719
- color: var(--table-header-text) !important;
720
- }
721
-
722
- body.theme-custom code, body.theme-custom pre code {
723
- color: var(--seed-accent) !important;
724
- }
725
-
726
- body.theme-custom a {
727
- color: var(--link-color) !important;
728
- border-bottom: 1px solid var(--link-color) !important;
729
- }
730
-
731
- /* 打印时隐藏侧栏 TOC 菜单 */
732
- body.theme-custom #sidebar,
733
- body.theme-custom .sidebar-content,
734
- body.theme-custom .outline-content {
735
- display: none !important;
736
- }
737
- }
1
+ /*
2
+ * ColaMD 主题:Trae Blue(Trae IDE 文档风格)
3
+ * 风格:纯白底 + Slate 灰阶文字 + Trae Blue(#2563eb)点缀
4
+ * 契约:ColaMD Extend 2.7(CodeMirror 6 + Pele)
5
+ *
6
+ * 风格来源:docs.trae.cn 官方文档站。原 v1.0 依赖 body.theme-custom 与
7
+ * #write / .ProseMirror 等已失效结构;本版按 2.7 契约重写:变量落在 :root,
8
+ * 编辑器规则只用 .cm-md-* 行级钩子,导出样式挂在 .colamd-document。
9
+ */
10
+
11
+ :root {
12
+ /* ── 1.1 Seed Palette(Slate 亮色 + Trae Blue) ── */
13
+ --seed-accent: #2563eb;
14
+ --seed-accent-light: rgba(37, 99, 235, 0.12);
15
+ --seed-accent-dark: #1d4ed8;
16
+ --seed-surface: #ffffff;
17
+ --seed-panel: #f5f5f5;
18
+ --seed-panel-alt: #ececec;
19
+ --seed-ink: #0f1828;
20
+ --seed-ink-muted: #45536b;
21
+ --seed-ink-dim: #93a2b8;
22
+ --seed-border: #d9d9dc;
23
+ --seed-border-strong: #2563eb;
24
+
25
+ /* ── 1.2 Semantic Colors(活变量) ── */
26
+ --bg-color: var(--seed-surface);
27
+ --text-color: var(--seed-ink);
28
+ --text-secondary: #334155;
29
+ --text-muted: var(--seed-ink-muted);
30
+ --border-color: var(--seed-border);
31
+ --link-color: var(--seed-accent);
32
+
33
+ --code-bg: var(--seed-panel-alt);
34
+ --code-block-bg: var(--seed-panel);
35
+ --code-block-text: var(--seed-ink);
36
+
37
+ --blockquote-border: var(--seed-accent);
38
+ --blockquote-bg: var(--seed-panel);
39
+ --table-header-bg: #eff6ff;
40
+
41
+ --selection-bg: rgba(37, 99, 235, 0.15);
42
+ --highlight-bg: #eff6ff;
43
+
44
+ /* ── 1.3 Typography & Metrics(活变量) ── */
45
+ --font-body: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", Georgia, "Times New Roman", serif;
46
+ --font-mono: "Cascadia Code", "JetBrains Mono", "Fira Code", "SF Mono", Menlo, Consolas, monospace;
47
+ --editor-font-size: 15px;
48
+ --editor-column-width: 780px;
49
+
50
+ /* ── 1.4 Pele 图表:浅底 + Slate 线 + 蓝色强调 ── */
51
+ --pele-bg: var(--code-block-bg);
52
+ --pele-fg: var(--code-block-text);
53
+ --pele-muted: var(--text-muted);
54
+ --pele-line: #94a3b8;
55
+ --pele-surface: #eef2f7;
56
+ --pele-surface-alt: #e2e8f0;
57
+ --pele-border: #64748b;
58
+ --pele-accent: var(--link-color);
59
+ --pele-radius: 6px;
60
+ }
61
+
62
+ /* ═══════════════════════════════════════════════════════════
63
+ SECTION 2 — 编辑器 DOM(#editor .cm-content + .cm-md-*)
64
+ ═══════════════════════════════════════════════════════════ */
65
+
66
+ /* ── 2.0 正文:思源宋体,1.75 倍行距 ── */
67
+ #editor .cm-content {
68
+ font-family: var(--font-body);
69
+ font-size: var(--editor-font-size);
70
+ line-height: 1.75;
71
+ color: var(--text-color);
72
+ background: var(--bg-color);
73
+ }
74
+
75
+ /* ── 2.1 标题:思源黑体,Slate 900 ── */
76
+ #editor .cm-content .cm-md-atxheading1,
77
+ #editor .cm-content .cm-md-atxheading2,
78
+ #editor .cm-content .cm-md-atxheading3,
79
+ #editor .cm-content .cm-md-atxheading4,
80
+ #editor .cm-content .cm-md-atxheading5,
81
+ #editor .cm-content .cm-md-atxheading6 {
82
+ font-family: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
83
+ color: var(--text-color);
84
+ font-weight: 700;
85
+ line-height: 1.35;
86
+ padding-top: 0.6em;
87
+ }
88
+
89
+ #editor .cm-content .cm-md-atxheading1 {
90
+ font-size: 2em;
91
+ padding-top: 1em;
92
+ padding-bottom: 0.3em;
93
+ }
94
+ #editor .cm-content .cm-md-atxheading2 { font-size: 1.75em; }
95
+ #editor .cm-content .cm-md-atxheading3 { font-size: 1.5em; }
96
+ #editor .cm-content .cm-md-atxheading4 { font-size: 1.2em; }
97
+ #editor .cm-content .cm-md-atxheading5 { font-size: 1.05em; }
98
+ #editor .cm-content .cm-md-atxheading6 {
99
+ font-size: 0.95em;
100
+ color: var(--text-secondary);
101
+ }
102
+
103
+ /* ── 2.2 行内:蓝色是唯一强调色 ── */
104
+ #editor .cm-content .cm-md-strong {
105
+ color: var(--link-color);
106
+ font-weight: 700;
107
+ }
108
+ #editor .cm-content .cm-md-em {
109
+ font-style: italic;
110
+ color: var(--text-secondary);
111
+ }
112
+ #editor .cm-content .cm-md-strike {
113
+ color: var(--text-muted);
114
+ text-decoration: line-through;
115
+ }
116
+ #editor .cm-content .cm-md-highlight {
117
+ background: var(--highlight-bg);
118
+ color: var(--text-color);
119
+ padding: 1px 4px;
120
+ border-radius: 2px;
121
+ }
122
+
123
+ #editor .cm-content .cm-md-link {
124
+ color: var(--link-color);
125
+ text-decoration: none;
126
+ }
127
+ #editor .cm-content .cm-md-url {
128
+ color: var(--text-muted);
129
+ font-size: 0.9em;
130
+ }
131
+
132
+ #editor .cm-content .cm-md-marker,
133
+ #editor .cm-content .cm-md-quotemark,
134
+ #editor .cm-content .cm-md-listmark {
135
+ color: var(--text-muted);
136
+ }
137
+
138
+ /* ── 2.3 内联代码:浅灰蓝底 + 蓝色字 ── */
139
+ #editor .cm-content .cm-md-inlinecode {
140
+ font-family: var(--font-mono);
141
+ font-size: 0.9em;
142
+ background: var(--code-bg);
143
+ color: var(--link-color);
144
+ padding: 2px 6px;
145
+ margin: 0 2px;
146
+ border-radius: 4px;
147
+ }
148
+
149
+ /* ── 2.4 引用块:浅底 + 蓝色左竖线(每行一个 div,禁纵向 padding) ── */
150
+ #editor .cm-content .cm-md-blockquote {
151
+ background: var(--blockquote-bg);
152
+ color: var(--text-secondary);
153
+ border-left: 4px solid var(--blockquote-border);
154
+ padding-left: 20px;
155
+ padding-right: 16px;
156
+ }
157
+
158
+ /* ── 2.5 代码块:极浅底 + 深字,圆角落在首末行 ── */
159
+ #editor .cm-content .cm-md-codeblock {
160
+ font-family: var(--font-mono);
161
+ font-size: 0.88em;
162
+ line-height: 1.6;
163
+ background: var(--code-block-bg);
164
+ color: var(--code-block-text);
165
+ padding-left: 20px;
166
+ padding-right: 20px;
167
+ }
168
+ #editor .cm-content .cm-md-codeblock-first {
169
+ border-top-left-radius: 6px;
170
+ border-top-right-radius: 6px;
171
+ }
172
+ #editor .cm-content .cm-md-codeblock-last {
173
+ border-bottom-left-radius: 6px;
174
+ border-bottom-right-radius: 6px;
175
+ }
176
+
177
+ /* ── 2.6 表格:浅蓝表头 + 蓝色表头线 ── */
178
+ #editor .cm-content .cm-md-table-widget th,
179
+ #editor .cm-content .cm-md-table-widget td {
180
+ border-color: var(--border-color);
181
+ }
182
+ #editor .cm-content .cm-md-table-widget th {
183
+ background: var(--table-header-bg);
184
+ color: var(--text-color);
185
+ font-weight: 700;
186
+ border-bottom: 2px solid var(--seed-accent);
187
+ }
188
+ #editor .cm-content .cm-md-table-widget tr:hover td {
189
+ background: var(--seed-accent-light);
190
+ }
191
+
192
+ /* ── 2.7 分隔线 ── */
193
+ #editor .cm-content .cm-md-hr {
194
+ border-top: 1px solid var(--border-color);
195
+ margin: 2.5em 0;
196
+ }
197
+
198
+ /* 本主题正文不缩进,故不写 .cm-line 的 text-indent 规则。 */
199
+
200
+ /* ═══════════════════════════════════════════════════════════
201
+ SECTION 3 — 导出 HTML(.colamd-document,只补配色)
202
+ 结构由上游 document.css 提供。
203
+ ═══════════════════════════════════════════════════════════ */
204
+
205
+ .colamd-document {
206
+ font-family: var(--font-body);
207
+ font-size: var(--editor-font-size);
208
+ line-height: 1.75;
209
+ background: var(--bg-color);
210
+ color: var(--text-color);
211
+ }
212
+
213
+ .colamd-document h1,
214
+ .colamd-document h2,
215
+ .colamd-document h3,
216
+ .colamd-document h4,
217
+ .colamd-document h5,
218
+ .colamd-document h6 {
219
+ font-family: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
220
+ color: var(--text-color);
221
+ font-weight: 700;
222
+ line-height: 1.35;
223
+ }
224
+ .colamd-document h1 { font-size: 2em; }
225
+ .colamd-document h2 { font-size: 1.75em; }
226
+ .colamd-document h3 { font-size: 1.5em; }
227
+ .colamd-document h4 { font-size: 1.2em; }
228
+ .colamd-document h5 { font-size: 1.05em; }
229
+ .colamd-document h6 { font-size: 0.95em; color: var(--text-secondary); }
230
+
231
+ .colamd-document strong { color: var(--link-color); }
232
+ .colamd-document em { color: var(--text-secondary); }
233
+ .colamd-document a {
234
+ color: var(--link-color);
235
+ text-decoration: none;
236
+ }
237
+ .colamd-document code {
238
+ background: var(--code-bg);
239
+ color: var(--link-color);
240
+ font-family: var(--font-mono);
241
+ border-radius: 4px;
242
+ }
243
+ .colamd-document pre {
244
+ background: var(--code-block-bg);
245
+ border-radius: 6px;
246
+ }
247
+ .colamd-document pre code {
248
+ background: transparent;
249
+ color: var(--code-block-text);
250
+ }
251
+ .colamd-document blockquote {
252
+ background: var(--blockquote-bg);
253
+ color: var(--text-secondary);
254
+ border-left: 4px solid var(--blockquote-border);
255
+ }
256
+ .colamd-document mark {
257
+ background: var(--highlight-bg);
258
+ color: var(--text-color);
259
+ }
260
+ .colamd-document th {
261
+ background: var(--table-header-bg);
262
+ color: var(--text-color);
263
+ border-bottom: 2px solid var(--seed-accent);
264
+ }
265
+ .colamd-document hr { border-top-color: var(--border-color); }
266
+
267
+ /* ═══════════════════════════════════════════════════════════
268
+ SECTION 4 — 打印
269
+ 2.7 直接对当前窗口 printToPDF,屏幕规则原样生效,这里只补保真。
270
+ ═══════════════════════════════════════════════════════════ */
271
+
272
+ @media print {
273
+ html,
274
+ body {
275
+ background: var(--bg-color);
276
+ color: var(--text-color);
277
+ -webkit-print-color-adjust: exact;
278
+ print-color-adjust: exact;
279
+ }
280
+ }