@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.
- package/.claude/skills/colamd-themes-preview.skill.md +333 -0
- package/.claude/skills/colamd-themes.skill.md +10 -0
- package/.dsh/skills/colamd-themes/SKILL.md +14 -0
- package/.github/supported-topics.yml +17 -0
- package/.hermes/skills/tools/colamd-themes/SKILL.md +14 -0
- package/.openclaw/skills/colamd-themes/SKILL.md +1 -37
- package/.opencode/skills/colamd-themes/SKILL.md +17 -0
- package/.trae/rules/colamd-themes.md +0 -36
- package/CHANGELOG.md +331 -241
- package/DSH_SUPPORT_SUMMARY.md +87 -0
- package/README.md +414 -384
- package/README_CN.md +412 -384
- package/RELEASENOTE.md +541 -389
- package/dist/cli.js +36 -55
- package/dist/cli.js.map +1 -1
- package/dist/color-utils.d.ts +1 -0
- package/dist/color-utils.js +25 -6
- package/dist/color-utils.js.map +1 -1
- package/dist/extractors/pdf-extractor.js +6 -1
- package/dist/extractors/pdf-extractor.js.map +1 -1
- package/dist/extractors/url-extractor.d.ts +0 -4
- package/dist/extractors/url-extractor.js +13 -126
- package/dist/extractors/url-extractor.js.map +1 -1
- package/dist/generator.d.ts +1 -1
- package/dist/generator.js +32 -11
- package/dist/generator.js.map +1 -1
- package/dist/models.d.ts +5 -4
- package/dist/models.js +2 -3
- package/dist/models.js.map +1 -1
- package/dist/renderer.d.ts +6 -3
- package/dist/renderer.js +54 -93
- package/dist/renderer.js.map +1 -1
- package/dist/templates/template.css +220 -498
- package/dist/templates/theme-paradigm.md +530 -658
- package/dist/templates/theme-template.hbs +256 -370
- package/dist/theme-store.js +19 -3
- package/dist/theme-store.js.map +1 -1
- package/dist/utils/document-paradigm.d.ts +12 -0
- package/dist/utils/document-paradigm.js +109 -0
- package/dist/utils/document-paradigm.js.map +1 -0
- package/dist/validators.d.ts +4 -1
- package/dist/validators.js +115 -1
- package/dist/validators.js.map +1 -1
- package/mcp-server/dist/index.d.ts +13 -0
- package/mcp-server/dist/index.d.ts.map +1 -0
- package/mcp-server/dist/index.js +0 -0
- package/mcp-server/dist/index.js.map +1 -0
- package/mcp-server/package-lock.json +1759 -0
- package/mcp-server/package.json +24 -0
- package/mcp-server/src/index.ts +0 -0
- package/mcp-server/tsconfig.json +19 -0
- package/package.json +54 -36
- package/skills/build-skills.sh +30 -5
- package/skills/colamd-themes/SKILL.md +180 -178
- package/src/cli.ts +474 -487
- package/src/color-systems.ts +289 -289
- package/src/color-utils.ts +137 -120
- package/src/contrast.ts +66 -66
- package/src/docx-style-paradigm.ts +811 -811
- package/src/export-cli.ts +356 -356
- package/src/extractors/base.ts +8 -8
- package/src/extractors/docx-extractor.ts +417 -417
- package/src/extractors/pdf-extractor.ts +533 -527
- package/src/extractors/url-extractor.ts +846 -981
- package/src/generator.ts +197 -169
- package/src/index.ts +29 -29
- package/src/models.ts +212 -212
- package/src/renderer.ts +310 -359
- package/src/templates/template.css +220 -498
- package/src/templates/theme-paradigm.md +530 -658
- package/src/templates/theme-template.hbs +256 -370
- package/src/theme-store.ts +185 -170
- package/src/types/pdf-parse.d.ts +12 -12
- package/src/utils/cli-utils.ts +84 -84
- package/src/utils/document-paradigm.ts +118 -0
- package/src/validators.ts +298 -176
- package/themes/academic-paper-pt.css +353 -1805
- package/themes/academic-paper.css +350 -1099
- package/themes/academic-style.css +342 -2430
- package/themes/colly.css +256 -370
- package/themes/elegant.css +288 -671
- package/themes/forest-ink.css +240 -664
- package/themes/guizang.css +250 -732
- package/themes/hermes-security.css +279 -0
- package/themes/meeting-minutes.css +256 -370
- package/themes/pixso-design.css +278 -1261
- package/themes/salvator-blog.css +256 -370
- package/themes/shimo-theme.css +256 -0
- package/themes/swiss-design.css +285 -746
- package/themes/template.css +220 -498
- package/themes/trae-blue.css +280 -737
- package/themes/word-contract.css +249 -0
- package/themes-preview/demo-content.md +187 -187
- package/tsconfig.json +18 -18
- package/src/mermaid-presets.ts +0 -142
- package/themes/swiss-design copy.css +0 -746
- package/themes-preview/colly-preview.html +0 -623
- package/themes-preview/meeting-minutes-preview.html +0 -625
- package/themes-preview/salvator-blog-preview.html +0 -623
package/themes/template.css
CHANGED
|
@@ -1,498 +1,220 @@
|
|
|
1
|
-
/*
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
body
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
--
|
|
46
|
-
--
|
|
47
|
-
--
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
--
|
|
51
|
-
--
|
|
52
|
-
--
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
--
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
--
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
--
|
|
103
|
-
--
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
--
|
|
112
|
-
--
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
--
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
/* --code-block-text: #e4e7ed; */ /* 默认注释,按需取消 */
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
/* ═════════════════════════════════════════════════════════════
|
|
225
|
-
SECTION 5 — 选择器级微调 (Selector Fine-Tuning)
|
|
226
|
-
仅用于 base.css 不提供的个性化样式
|
|
227
|
-
所有值严格引用变量,禁止出现裸色值/裸字号
|
|
228
|
-
═════════════════════════════════════════════════════════════ */
|
|
229
|
-
|
|
230
|
-
/* ── 5.1 全局:字体 + 底色 + 字号 ── */
|
|
231
|
-
html { font-size: var(--font-size-root); }
|
|
232
|
-
body.theme-custom, html, body {
|
|
233
|
-
background-color: var(--bg-color);
|
|
234
|
-
color: var(--text-color);
|
|
235
|
-
font-family: var(--font-body);
|
|
236
|
-
line-height: var(--line-height-body);
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
/* ── 5.2 编辑区 ── */
|
|
240
|
-
#write {
|
|
241
|
-
max-width: var(--content-width);
|
|
242
|
-
margin: 0 auto;
|
|
243
|
-
padding: 30px 60px 100px;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
/* ── 5.3 标题:字体 + 倍率 ── */
|
|
247
|
-
body.theme-custom h1, body.theme-custom h2, body.theme-custom h3,
|
|
248
|
-
body.theme-custom h4, body.theme-custom h5, body.theme-custom h6 {
|
|
249
|
-
font-family: var(--font-heading);
|
|
250
|
-
color: var(--heading-color);
|
|
251
|
-
font-weight: 700;
|
|
252
|
-
line-height: var(--line-height-heading);
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
body.theme-custom h1 { font-size: calc(var(--font-size-root) * var(--font-scale-h1)); }
|
|
256
|
-
body.theme-custom h2 { font-size: calc(var(--font-size-root) * var(--font-scale-h2)); }
|
|
257
|
-
body.theme-custom h3 { font-size: calc(var(--font-size-root) * var(--font-scale-h3)); }
|
|
258
|
-
body.theme-custom h4 { font-size: calc(var(--font-size-root) * var(--font-scale-h4)); }
|
|
259
|
-
body.theme-custom h5 { font-size: calc(var(--font-size-root) * var(--font-scale-h5)); }
|
|
260
|
-
body.theme-custom h6 { font-size: calc(var(--font-size-root) * var(--font-scale-h6)); }
|
|
261
|
-
|
|
262
|
-
/* ── 5.4 内联强调:使用点缀色 ── */
|
|
263
|
-
body.theme-custom strong { color: var(--accent-color); }
|
|
264
|
-
|
|
265
|
-
/* ── 5.5 内联代码 ── */
|
|
266
|
-
body.theme-custom code {
|
|
267
|
-
font-family: var(--font-code);
|
|
268
|
-
background: var(--code-bg);
|
|
269
|
-
color: var(--code-color);
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
/* ── 5.6 代码块 ── */
|
|
273
|
-
body.theme-custom pre {
|
|
274
|
-
background: var(--code-block-bg);
|
|
275
|
-
font-family: var(--font-code);
|
|
276
|
-
line-height: var(--line-height-code);
|
|
277
|
-
}
|
|
278
|
-
body.theme-custom pre code {
|
|
279
|
-
color: var(--code-block-text);
|
|
280
|
-
background: transparent;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
/* ── 5.7 引用块 ── */
|
|
284
|
-
body.theme-custom blockquote {
|
|
285
|
-
background: var(--blockquote-bg);
|
|
286
|
-
border-left: 4px solid var(--blockquote-border);
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
/* ── 5.8 表格表头 ── */
|
|
290
|
-
body.theme-custom table th {
|
|
291
|
-
background: var(--table-header-bg);
|
|
292
|
-
font-weight: 700;
|
|
293
|
-
border-bottom: 2px solid var(--accent-color);
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
/* ── 5.9 分割线 ── */
|
|
297
|
-
body.theme-custom hr {
|
|
298
|
-
border: none;
|
|
299
|
-
border-top: 1px solid var(--hr-color);
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
/* ── 5.10 图片居中 ── */
|
|
303
|
-
body.theme-custom img { max-width: 100%; }
|
|
304
|
-
|
|
305
|
-
/* ── 5.11 Mermaid 图表标题(跟随图表的 p) ── */
|
|
306
|
-
/* 用于 **图X ...** 这类 Markdown 标题自动居中 */
|
|
307
|
-
body.theme-custom .mermaid-block + p {
|
|
308
|
-
text-align: center;
|
|
309
|
-
font-family: var(--font-heading);
|
|
310
|
-
font-size: calc(var(--font-size-mermaid) + 2px);
|
|
311
|
-
color: var(--text-muted);
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
/* ── 5.12 响应式 ── */
|
|
315
|
-
@media only screen and (max-width: 768px) {
|
|
316
|
-
#write { padding: 20px; }
|
|
317
|
-
body.theme-custom .mermaid-block { padding: 12px; }
|
|
318
|
-
body.theme-custom .mermaid-preview svg { max-width: 100% !important; height: auto !important; }
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
/* ═════════════════════════════════════════════════════════════
|
|
322
|
-
SECTION 6 — 打印 / 导出 (Print / Export)
|
|
323
|
-
原则:屏幕样式的完整镜像。每个屏幕属性都必须在 print 中显式声明。
|
|
324
|
-
禁止在 print 中引入新色值,禁止遗漏任何有色/有尺寸的元素。
|
|
325
|
-
═════════════════════════════════════════════════════════════ */
|
|
326
|
-
@media print {
|
|
327
|
-
@page { margin: 20mm; }
|
|
328
|
-
|
|
329
|
-
/* ── 6.0 变量重声明(Chromium 打印引擎会丢失 CSS 变量,需重新注入) ── */
|
|
330
|
-
body.theme-custom {
|
|
331
|
-
--seed-accent: #6366f1; /* ⬅ 与 SECTION 1.1 保持完全一致 */
|
|
332
|
-
--seed-accent-dark: #4f46e5;
|
|
333
|
-
--seed-surface: #ffffff;
|
|
334
|
-
--seed-ink: #1a1d26;
|
|
335
|
-
--seed-ink-muted: #6b7280;
|
|
336
|
-
--seed-panel: #f8f9fb;
|
|
337
|
-
--seed-panel-alt: #f1f3f5;
|
|
338
|
-
--seed-border: #e5e7eb;
|
|
339
|
-
--font-size-root: 16px;
|
|
340
|
-
--line-height-body: 1.75;
|
|
341
|
-
--line-height-heading: 1.35;
|
|
342
|
-
--line-height-code: 1.6;
|
|
343
|
-
--font-scale-h1: 2.0;
|
|
344
|
-
--font-scale-h2: 1.5;
|
|
345
|
-
--font-scale-h3: 1.25;
|
|
346
|
-
--font-scale-h4: 1.1;
|
|
347
|
-
--font-scale-h5: 1.0;
|
|
348
|
-
--font-scale-h6: 0.95;
|
|
349
|
-
--content-width: 820px;
|
|
350
|
-
--font-size-mermaid: 13px;
|
|
351
|
-
--accent-color: var(--seed-accent);
|
|
352
|
-
--accent-dark: var(--seed-accent-dark);
|
|
353
|
-
--code-bg: var(--seed-panel);
|
|
354
|
-
--code-color: var(--seed-accent-dark);
|
|
355
|
-
--code-block-bg: var(--seed-panel-alt);
|
|
356
|
-
--code-block-text: var(--seed-ink);
|
|
357
|
-
--blockquote-bg: var(--seed-panel);
|
|
358
|
-
--table-header-bg: var(--seed-panel);
|
|
359
|
-
--border-color: var(--seed-border);
|
|
360
|
-
--hr-color: var(--seed-border);
|
|
361
|
-
--font-body: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont,
|
|
362
|
-
"Noto Serif SC", "Source Han Serif SC", "Songti SC",
|
|
363
|
-
Georgia, "Times New Roman", serif;
|
|
364
|
-
--font-heading: "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont,
|
|
365
|
-
"Noto Sans SC", "Source Han Sans SC", "PingFang SC",
|
|
366
|
-
"Microsoft YaHei", sans-serif;
|
|
367
|
-
--font-code: "JetBrains Mono", "SF Mono", "Fira Code", Menlo, Consolas, monospace;
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
/* ── 6.1 根元素:字号 + 字体 + 行高 + 底色 ── */
|
|
371
|
-
html {
|
|
372
|
-
font-size: var(--font-size-root) !important;
|
|
373
|
-
}
|
|
374
|
-
html, body, body.theme-custom {
|
|
375
|
-
background: var(--seed-surface) !important;
|
|
376
|
-
color: var(--seed-ink) !important;
|
|
377
|
-
font-family: var(--font-body) !important;
|
|
378
|
-
line-height: var(--line-height-body) !important;
|
|
379
|
-
-webkit-print-color-adjust: exact !important;
|
|
380
|
-
print-color-adjust: exact !important;
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
/* ── 6.2 编辑区 ── */
|
|
384
|
-
#write {
|
|
385
|
-
max-width: var(--content-width) !important;
|
|
386
|
-
margin: 0 auto !important;
|
|
387
|
-
padding: 30px 60px 100px !important;
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
/* ── 6.3 标题:字号 + 字体 + 字重 + 行高 ── */
|
|
391
|
-
body.theme-custom h1, body.theme-custom h2, body.theme-custom h3,
|
|
392
|
-
body.theme-custom h4, body.theme-custom h5, body.theme-custom h6 {
|
|
393
|
-
font-family: var(--font-heading) !important;
|
|
394
|
-
color: var(--seed-ink) !important;
|
|
395
|
-
font-weight: 700 !important;
|
|
396
|
-
line-height: var(--line-height-heading) !important;
|
|
397
|
-
-webkit-print-color-adjust: exact !important;
|
|
398
|
-
print-color-adjust: exact !important;
|
|
399
|
-
}
|
|
400
|
-
body.theme-custom h1 { font-size: calc(var(--font-size-root) * var(--font-scale-h1)) !important; }
|
|
401
|
-
body.theme-custom h2 { font-size: calc(var(--font-size-root) * var(--font-scale-h2)) !important; }
|
|
402
|
-
body.theme-custom h3 { font-size: calc(var(--font-size-root) * var(--font-scale-h3)) !important; }
|
|
403
|
-
body.theme-custom h4 { font-size: calc(var(--font-size-root) * var(--font-scale-h4)) !important; }
|
|
404
|
-
body.theme-custom h5 { font-size: calc(var(--font-size-root) * var(--font-scale-h5)) !important; }
|
|
405
|
-
body.theme-custom h6 { font-size: calc(var(--font-size-root) * var(--font-scale-h6)) !important; }
|
|
406
|
-
|
|
407
|
-
/* ── 6.4 内联强调 ── */
|
|
408
|
-
body.theme-custom strong {
|
|
409
|
-
color: var(--accent-color) !important;
|
|
410
|
-
font-weight: 700 !important;
|
|
411
|
-
-webkit-print-color-adjust: exact !important;
|
|
412
|
-
print-color-adjust: exact !important;
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
/* ── 6.5 内联代码:字体 + 背景 + 颜色 ── */
|
|
416
|
-
body.theme-custom code {
|
|
417
|
-
font-family: var(--font-code) !important;
|
|
418
|
-
background: var(--code-bg) !important;
|
|
419
|
-
color: var(--code-color) !important;
|
|
420
|
-
-webkit-print-color-adjust: exact !important;
|
|
421
|
-
print-color-adjust: exact !important;
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
/* ── 6.6 代码块:背景 + 字体 + 行高 ── */
|
|
425
|
-
body.theme-custom pre {
|
|
426
|
-
background: var(--code-block-bg) !important;
|
|
427
|
-
font-family: var(--font-code) !important;
|
|
428
|
-
line-height: var(--line-height-code) !important;
|
|
429
|
-
-webkit-print-color-adjust: exact !important;
|
|
430
|
-
print-color-adjust: exact !important;
|
|
431
|
-
}
|
|
432
|
-
body.theme-custom pre code {
|
|
433
|
-
color: var(--code-block-text) !important;
|
|
434
|
-
background: transparent !important;
|
|
435
|
-
}
|
|
436
|
-
|
|
437
|
-
/* ── 6.7 引用块:背景 + 左侧竖线(色值与屏幕一致:accent) ── */
|
|
438
|
-
body.theme-custom blockquote {
|
|
439
|
-
background: var(--blockquote-bg) !important;
|
|
440
|
-
border-left: 4px solid var(--seed-accent) !important;
|
|
441
|
-
-webkit-print-color-adjust: exact !important;
|
|
442
|
-
print-color-adjust: exact !important;
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
/* ── 6.8 表格:边框合并 + 表头 ── */
|
|
446
|
-
body.theme-custom table {
|
|
447
|
-
border-collapse: collapse !important;
|
|
448
|
-
}
|
|
449
|
-
body.theme-custom table th {
|
|
450
|
-
background: var(--table-header-bg) !important;
|
|
451
|
-
color: var(--seed-ink) !important;
|
|
452
|
-
font-weight: 700 !important;
|
|
453
|
-
border-bottom: 2px solid var(--accent-color) !important;
|
|
454
|
-
-webkit-print-color-adjust: exact !important;
|
|
455
|
-
print-color-adjust: exact !important;
|
|
456
|
-
}
|
|
457
|
-
body.theme-custom table td {
|
|
458
|
-
border-color: var(--seed-border) !important;
|
|
459
|
-
}
|
|
460
|
-
|
|
461
|
-
/* ── 6.9 链接 ── */
|
|
462
|
-
body.theme-custom a {
|
|
463
|
-
color: var(--seed-accent) !important;
|
|
464
|
-
-webkit-print-color-adjust: exact !important;
|
|
465
|
-
print-color-adjust: exact !important;
|
|
466
|
-
}
|
|
467
|
-
|
|
468
|
-
/* ── 6.10 分割线 ── */
|
|
469
|
-
body.theme-custom hr {
|
|
470
|
-
border: none !important;
|
|
471
|
-
border-top: 1px solid var(--hr-color) !important;
|
|
472
|
-
}
|
|
473
|
-
|
|
474
|
-
/* ── 6.11 图片 ── */
|
|
475
|
-
body.theme-custom img {
|
|
476
|
-
max-width: 100% !important;
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
/* ── 6.12 Mermaid 图表容器 ── */
|
|
480
|
-
body.theme-custom .mermaid-block {
|
|
481
|
-
background: var(--seed-surface) !important;
|
|
482
|
-
border-color: var(--seed-border) !important;
|
|
483
|
-
-webkit-print-color-adjust: exact !important;
|
|
484
|
-
print-color-adjust: exact !important;
|
|
485
|
-
}
|
|
486
|
-
body.theme-custom .mermaid-preview svg * {
|
|
487
|
-
-webkit-print-color-adjust: exact !important;
|
|
488
|
-
print-color-adjust: exact !important;
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
/* ── 6.13 图表标题 ── */
|
|
492
|
-
body.theme-custom .mermaid-block + p {
|
|
493
|
-
color: var(--seed-ink-muted) !important;
|
|
494
|
-
text-align: center !important;
|
|
495
|
-
font-family: var(--font-heading) !important;
|
|
496
|
-
font-size: calc(var(--font-size-mermaid) + 2px) !important;
|
|
497
|
-
}
|
|
498
|
-
}
|
|
1
|
+
/* ===== ColaMD 自定义主题模板(2.7 契约)=====
|
|
2
|
+
|
|
3
|
+
复制这一份改就是了:改配色、改字体、改文件名,然后 Theme > Import Theme,
|
|
4
|
+
或者放进 ~/.colamd/themes/。
|
|
5
|
+
|
|
6
|
+
三件事先说清楚:
|
|
7
|
+
|
|
8
|
+
1. 变量写在 :root 里。没写的活变量继承 Light 主题的默认值,所以只想改配色的话,
|
|
9
|
+
下面第一段往往就够了,选择器那一段可以整段删掉。
|
|
10
|
+
2. 编辑器里没有 <h1>、<blockquote> 这种元素:标题是一「行」带一个类,引用与代码块
|
|
11
|
+
是每一行一个 div,加粗是一个 span。所以只能选 .cm-md-* 这些钩子。
|
|
12
|
+
3. 引用块与代码块**不能加纵向 padding**:一行一个 div,纵向 padding 会按行累加。
|
|
13
|
+
要留呼吸感只给 padding-left / padding-right。
|
|
14
|
+
|
|
15
|
+
这份故意不是一套好看的配色,它是照着改的起点。 */
|
|
16
|
+
|
|
17
|
+
:root {
|
|
18
|
+
/* ---- 语义色(活变量)---- */
|
|
19
|
+
--bg-color: #ffffff; /* 正文底色 */
|
|
20
|
+
--text-color: #24292f; /* 正文字色 */
|
|
21
|
+
--text-secondary: #57606a; /* 次级文字:引用、标签 */
|
|
22
|
+
--text-muted: #6e7781; /* 压淡文字:行号、链接地址、列表圆点 */
|
|
23
|
+
--border-color: #d0d7de; /* 分隔线、表格边框、面板描边 */
|
|
24
|
+
--link-color: #0969da; /* 链接、搜索高亮 */
|
|
25
|
+
|
|
26
|
+
--code-bg: rgba(175, 184, 193, 0.2); /* 行内代码底色 */
|
|
27
|
+
--code-block-bg: #f6f8fa; /* 代码块底色:明暗决定 Pele 图表配色 */
|
|
28
|
+
--code-block-text: #24292f; /* 代码块文字 */
|
|
29
|
+
|
|
30
|
+
--blockquote-border: #d0d7de; /* 引用块左竖线 */
|
|
31
|
+
--blockquote-bg: transparent; /* 引用块底色,transparent 就是不要底 */
|
|
32
|
+
--table-header-bg: #f6f8fa; /* 表头底色 */
|
|
33
|
+
--selection-bg: rgba(9, 105, 218, 0.15);/* 选中背景 */
|
|
34
|
+
--highlight-bg: #fff3bf; /* ==高亮== 底色 */
|
|
35
|
+
|
|
36
|
+
/* ---- 字体与度量(活变量)---- */
|
|
37
|
+
--font-body: Georgia, 'Songti SC', 'Noto Serif SC', serif;
|
|
38
|
+
--font-mono: 'SF Mono', 'Fira Code', Menlo, Consolas, monospace;
|
|
39
|
+
--editor-font-size: 16px;
|
|
40
|
+
--editor-column-width: 780px;
|
|
41
|
+
|
|
42
|
+
/* ---- Pele 图表(可选,9 个)----
|
|
43
|
+
图直接画在 --code-block-bg 上,缺省会由代码块底色与字色推导。 */
|
|
44
|
+
--pele-bg: var(--code-block-bg);
|
|
45
|
+
--pele-fg: var(--code-block-text);
|
|
46
|
+
--pele-muted: color-mix(in srgb, var(--code-block-text) 70%, var(--code-block-bg));
|
|
47
|
+
--pele-line: var(--code-block-text);
|
|
48
|
+
--pele-surface: color-mix(in srgb, var(--code-block-text) 18%, var(--code-block-bg));
|
|
49
|
+
--pele-surface-alt: color-mix(in srgb, var(--code-block-text) 28%, var(--code-block-bg));
|
|
50
|
+
--pele-border: color-mix(in srgb, var(--code-block-text) 45%, var(--code-block-bg));
|
|
51
|
+
--pele-accent: var(--link-color);
|
|
52
|
+
--pele-radius: 6px;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/* ===== 编辑器 DOM =====
|
|
56
|
+
CodeMirror 6 的选择器优先级:行级规则写成「两个类」才压得住它运行时注入的
|
|
57
|
+
baseTheme,所以下面一律用 #editor .cm-content .cm-md-*。 */
|
|
58
|
+
|
|
59
|
+
#editor .cm-content {
|
|
60
|
+
font-family: var(--font-body);
|
|
61
|
+
line-height: 1.75;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/* 标题。只要一级二级就这样写,三级往下照抄类名即可。 */
|
|
65
|
+
#editor .cm-content .cm-md-atxheading1,
|
|
66
|
+
#editor .cm-content .cm-md-atxheading2 {
|
|
67
|
+
color: #1b4f72;
|
|
68
|
+
padding-bottom: 0.25em;
|
|
69
|
+
border-bottom: 1px solid var(--border-color);
|
|
70
|
+
}
|
|
71
|
+
#editor .cm-content .cm-md-atxheading3,
|
|
72
|
+
#editor .cm-content .cm-md-atxheading4,
|
|
73
|
+
#editor .cm-content .cm-md-atxheading5,
|
|
74
|
+
#editor .cm-content .cm-md-atxheading6 {
|
|
75
|
+
color: #1b4f72;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/* 行内格式。 */
|
|
79
|
+
#editor .cm-content .cm-md-strong { color: var(--link-color); }
|
|
80
|
+
#editor .cm-content .cm-md-em { font-style: italic; }
|
|
81
|
+
#editor .cm-content .cm-md-strike { text-decoration: line-through; }
|
|
82
|
+
#editor .cm-content .cm-md-highlight { background: var(--highlight-bg); }
|
|
83
|
+
#editor .cm-content .cm-md-link { color: var(--link-color); }
|
|
84
|
+
#editor .cm-content .cm-md-url { color: var(--text-muted); }
|
|
85
|
+
|
|
86
|
+
#editor .cm-content .cm-md-inlinecode {
|
|
87
|
+
font-family: var(--font-mono);
|
|
88
|
+
background: var(--code-bg);
|
|
89
|
+
color: var(--text-color);
|
|
90
|
+
border-radius: 3px;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/* 标记字符(#、>、-、围栏):光标不在这一行时压淡。 */
|
|
94
|
+
#editor .cm-content .cm-md-marker,
|
|
95
|
+
#editor .cm-content .cm-md-quotemark,
|
|
96
|
+
#editor .cm-content .cm-md-listmark {
|
|
97
|
+
color: var(--text-muted);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/* 引用块:一行一个 div,所以只给左右内边距。 */
|
|
101
|
+
#editor .cm-content .cm-md-blockquote {
|
|
102
|
+
background: var(--blockquote-bg);
|
|
103
|
+
color: var(--text-secondary);
|
|
104
|
+
border-left: 3px solid var(--blockquote-border);
|
|
105
|
+
padding-left: 16px;
|
|
106
|
+
padding-right: 16px;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/* 代码块:同样一行一个 div;圆角放在首行/末行。 */
|
|
110
|
+
#editor .cm-content .cm-md-codeblock {
|
|
111
|
+
background: var(--code-block-bg);
|
|
112
|
+
color: var(--code-block-text);
|
|
113
|
+
padding-left: 16px;
|
|
114
|
+
padding-right: 16px;
|
|
115
|
+
}
|
|
116
|
+
#editor .cm-content .cm-md-codeblock-first {
|
|
117
|
+
border-top-left-radius: 6px;
|
|
118
|
+
border-top-right-radius: 6px;
|
|
119
|
+
}
|
|
120
|
+
#editor .cm-content .cm-md-codeblock-last {
|
|
121
|
+
border-bottom-left-radius: 6px;
|
|
122
|
+
border-bottom-right-radius: 6px;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/* 表格:单元格是 .cm-md-table-widget 里的 th / td。 */
|
|
126
|
+
#editor .cm-content .cm-md-table-widget th,
|
|
127
|
+
#editor .cm-content .cm-md-table-widget td {
|
|
128
|
+
border-color: var(--border-color);
|
|
129
|
+
}
|
|
130
|
+
#editor .cm-content .cm-md-table-widget th {
|
|
131
|
+
background: var(--table-header-bg);
|
|
132
|
+
color: var(--text-color);
|
|
133
|
+
border-bottom: 2px solid var(--link-color);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/* 分隔线。 */
|
|
137
|
+
#editor .cm-content .cm-md-hr { border-top-color: var(--border-color); }
|
|
138
|
+
|
|
139
|
+
/* 中文正文首行缩进:一行就是一个 div,标题/引用/代码/列表行归零。 */
|
|
140
|
+
#editor .cm-content .cm-line { text-indent: 2em; }
|
|
141
|
+
|
|
142
|
+
#editor .cm-content .cm-md-atxheading1,
|
|
143
|
+
#editor .cm-content .cm-md-atxheading2,
|
|
144
|
+
#editor .cm-content .cm-md-atxheading3,
|
|
145
|
+
#editor .cm-content .cm-md-atxheading4,
|
|
146
|
+
#editor .cm-content .cm-md-atxheading5,
|
|
147
|
+
#editor .cm-content .cm-md-atxheading6,
|
|
148
|
+
#editor .cm-content .cm-md-blockquote,
|
|
149
|
+
#editor .cm-content .cm-md-codeblock,
|
|
150
|
+
#editor .cm-content .cm-md-hr,
|
|
151
|
+
#editor .cm-content .cm-md-mermaid,
|
|
152
|
+
#editor .cm-content .cm-md-li-0,
|
|
153
|
+
#editor .cm-content .cm-md-li-1,
|
|
154
|
+
#editor .cm-content .cm-md-li-2,
|
|
155
|
+
#editor .cm-content .cm-md-li-3,
|
|
156
|
+
#editor .cm-content .cm-md-li-4,
|
|
157
|
+
#editor .cm-content .cm-md-li-5,
|
|
158
|
+
#editor .cm-content .cm-md-li-6 {
|
|
159
|
+
text-indent: 0;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/* ===== 导出的 HTML =====
|
|
163
|
+
导出件是语义标签(h1/p/pre/table…),挂在 .colamd-document 上,
|
|
164
|
+
编辑器里不存在这个类。document.css 已给结构,这里只补配色。 */
|
|
165
|
+
|
|
166
|
+
.colamd-document {
|
|
167
|
+
font-family: var(--font-body);
|
|
168
|
+
font-size: var(--editor-font-size);
|
|
169
|
+
line-height: 1.75;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.colamd-document h1,
|
|
173
|
+
.colamd-document h2,
|
|
174
|
+
.colamd-document h3,
|
|
175
|
+
.colamd-document h4,
|
|
176
|
+
.colamd-document h5,
|
|
177
|
+
.colamd-document h6 {
|
|
178
|
+
color: #1b4f72;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.colamd-document strong { color: var(--link-color); }
|
|
182
|
+
.colamd-document code {
|
|
183
|
+
background: var(--code-bg);
|
|
184
|
+
color: var(--text-color);
|
|
185
|
+
font-family: var(--font-mono);
|
|
186
|
+
}
|
|
187
|
+
.colamd-document pre { background: var(--code-block-bg); }
|
|
188
|
+
.colamd-document pre code { color: var(--code-block-text); }
|
|
189
|
+
.colamd-document blockquote {
|
|
190
|
+
background: var(--blockquote-bg);
|
|
191
|
+
color: var(--text-secondary);
|
|
192
|
+
border-left-color: var(--blockquote-border);
|
|
193
|
+
}
|
|
194
|
+
.colamd-document mark { background: var(--highlight-bg); }
|
|
195
|
+
.colamd-document th {
|
|
196
|
+
background: var(--table-header-bg);
|
|
197
|
+
border-bottom: 2px solid var(--link-color);
|
|
198
|
+
}
|
|
199
|
+
.colamd-document hr { border-top-color: var(--border-color); }
|
|
200
|
+
|
|
201
|
+
.colamd-document p { text-indent: 2em; }
|
|
202
|
+
.colamd-document li p,
|
|
203
|
+
.colamd-document td p,
|
|
204
|
+
.colamd-document th p,
|
|
205
|
+
.colamd-document blockquote p {
|
|
206
|
+
text-indent: 0;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/* ===== 打印 =====
|
|
210
|
+
应用直接对当前窗口 printToPDF,上面所有规则原样生效。 */
|
|
211
|
+
|
|
212
|
+
@media print {
|
|
213
|
+
html,
|
|
214
|
+
body {
|
|
215
|
+
background: var(--bg-color);
|
|
216
|
+
color: var(--text-color);
|
|
217
|
+
-webkit-print-color-adjust: exact;
|
|
218
|
+
print-color-adjust: exact;
|
|
219
|
+
}
|
|
220
|
+
}
|