@bytechain.cn/colamd-themes 0.5.9 → 0.6.0

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.
@@ -0,0 +1,529 @@
1
+ /*
2
+ * ColaMD Theme: swiss-lemon-dark
3
+ * 瑞士国际主义 · 柠檬黄 · 深色
4
+ * 契约:ColaMD 2.7.13(CodeMirror 6 + Pele)
5
+ *
6
+ * 配色保持本主题自己的深墨底 + 暖白字 + 柠檬黄,不套用参考稿的绿色。
7
+ * 参考稿只提供布局与字体的抽象:
8
+ * - 标题「越大越粗」:display 800 / section 700 / subhead 600;
9
+ * - 全文齐左,不做中文首行缩进;
10
+ * - 分隔线放在标题上方,而不是标题下划线;
11
+ * - 编号列表用等宽柠檬数字,表格用细线 + 等宽小表头;
12
+ * - 引用块抽象成卡片,代码块保留左侧强调线。
13
+ *
14
+ * 变量一律写在 :root;编辑器没有 <h1>/<blockquote> 元素。
15
+ */
16
+
17
+ :root {
18
+ /* ── 语义色:深墨底 + 暖白字 + 单一柠檬黄锚点 ── */
19
+ --bg-color: #0a0a0a;
20
+ --text-color: #fafaf8;
21
+ --text-secondary: #c6c6bf;
22
+ --text-muted: #8c8c86;
23
+ --border-color: #2b2b29;
24
+ --link-color: #FFD500;
25
+
26
+ --code-bg: #171716;
27
+ --code-block-bg: #161615;
28
+ --code-block-text: #f0f0ee;
29
+
30
+ --blockquote-border: #FFD500;
31
+ --blockquote-bg: var(--code-bg);
32
+ --table-header-bg: transparent;
33
+
34
+ --selection-bg: rgba(255, 213, 0, 0.30);
35
+ --highlight-bg: rgba(255, 213, 0, 0.28);
36
+
37
+ /* ── 字体族:参考稿的无衬线正文 + 等宽微标签 ── */
38
+ --font-body: "Inter", "Helvetica Neue", "Helvetica", "Arial", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC", "Noto Sans SC", "Microsoft YaHei UI", "Microsoft YaHei", "微软雅黑", sans-serif;
39
+ --font-mono: "JetBrains Mono", "IBM Plex Mono", "SF Mono", "Cascadia Code", "Consolas", "Courier New", ui-monospace, monospace;
40
+ --type-body: 16px;
41
+ --editor-font-size: var(--type-body);
42
+ --editor-column-width: 780px;
43
+
44
+ /* ── 字体层级:抽象成 display / section / subhead / body / label 五档 ── */
45
+ --type-display: 2.6em;
46
+ --type-section: 1.75em;
47
+ --type-subhead: 1.3em;
48
+ --type-label: 0.78em;
49
+ --type-small: 0.9em;
50
+
51
+ --weight-display: 800;
52
+ --weight-section: 700;
53
+ --weight-subhead: 600;
54
+ --weight-body: 400;
55
+ --weight-label: 600;
56
+
57
+ --tracking-display: -0.04em;
58
+ --tracking-section: -0.03em;
59
+ --tracking-subhead: -0.02em;
60
+ --tracking-label: 0.12em;
61
+ --tracking-mono: 0.02em;
62
+
63
+ --leading-display: 0.98;
64
+ --leading-section: 1.1;
65
+ --leading-body: 1.65;
66
+
67
+ /* ── 布局基元:间距、细线、卡片、表格、列表、直角 ── */
68
+ --layout-rule: 1px;
69
+ --layout-section-gap: 2.6em;
70
+ --layout-block-gap: 1.4em;
71
+ --layout-card-pad: 1.1em 1.3em;
72
+ --layout-cell-pad: 0.9em 0.6em;
73
+ --layout-list-marker: 2.2em;
74
+ --layout-radius: 0px;
75
+
76
+ /* ── PPT 版式令牌:与 slides.css 的公开契约对齐 ── */
77
+ --slide-title-font: var(--font-body);
78
+ --slide-title-weight: 800;
79
+ --slide-subhead-weight: 700;
80
+ --slide-title-size: 3.6em;
81
+ --slide-title-tracking: -0.035em;
82
+ --slide-cover-title-size: 5.2em;
83
+ --slide-section-title-size: 4.2em;
84
+ --slide-lead-size: 1.1em;
85
+ --slide-kicker-size: clamp(10px, 0.66vw, 13px);
86
+ --slide-kicker-tracking: 0.16em;
87
+ --slide-kicker-transform: uppercase;
88
+ --slide-chrome-opacity: 0.62;
89
+ --slide-chrome-transform: uppercase;
90
+ --slide-kpi-number-size: 4.2em;
91
+ --slide-quote-size: 1.8em;
92
+ --slide-page-top-pad: 54px;
93
+ --slide-page-top-pad-print: 48px;
94
+
95
+ /* ── Pele 图表:暗底 + 柠檬黄 ── */
96
+ --pele-bg: #161615;
97
+ --pele-fg: #fafaf8;
98
+ --pele-muted: #8c8c86;
99
+ --pele-line: #FFD500;
100
+ --pele-surface: #0a0a0a;
101
+ --pele-surface-alt: #1c1c1a;
102
+ --pele-border: #FFD500;
103
+ --pele-accent: #FFD500;
104
+ --pele-radius: 0px;
105
+ }
106
+
107
+ /* ═══════════════════════════════════════════════════════════
108
+ SECTION 1 — 编辑器正文
109
+ ═══════════════════════════════════════════════════════════ */
110
+
111
+ #editor .cm-content {
112
+ font-family: var(--font-body);
113
+ font-size: var(--editor-font-size);
114
+ font-weight: var(--weight-body);
115
+ line-height: var(--leading-body);
116
+ font-feature-settings: "ss01", "cv11";
117
+ -webkit-font-smoothing: antialiased;
118
+ text-rendering: optimizeLegibility;
119
+ text-align: left;
120
+ }
121
+
122
+ /* ── 1.1 标题层级:上置分隔线,越大越粗 ── */
123
+ #editor .cm-content .cm-md-atxheading1,
124
+ #editor .cm-content .cm-md-atxheading2,
125
+ #editor .cm-content .cm-md-atxheading3,
126
+ #editor .cm-content .cm-md-atxheading4,
127
+ #editor .cm-content .cm-md-atxheading5,
128
+ #editor .cm-content .cm-md-atxheading6 {
129
+ font-family: var(--font-body);
130
+ color: var(--text-color);
131
+ line-height: var(--leading-section);
132
+ letter-spacing: var(--tracking-section);
133
+ text-align: left;
134
+ text-indent: 0;
135
+ }
136
+
137
+ /* H1:文档级 display,顶部一条 2px 柠檬线 */
138
+ #editor .cm-content .cm-md-atxheading1 {
139
+ margin: 0.8em 0 0.8em;
140
+ padding-top: 0.35em;
141
+ border-top: 2px solid var(--link-color);
142
+ font-size: var(--type-display);
143
+ font-weight: var(--weight-display);
144
+ line-height: var(--leading-display);
145
+ letter-spacing: var(--tracking-display);
146
+ }
147
+ #editor .cm-content .cm-md-atxheading1:first-child {
148
+ margin-top: 0;
149
+ }
150
+
151
+ /* H2:章节级,顶部 hairline + 底部柠檬线下划线 */
152
+ #editor .cm-content .cm-md-atxheading2 {
153
+ margin: 1.6em 0 0.8em;
154
+ padding: 0.5em 0 0.4em;
155
+ border-top: var(--layout-rule) solid var(--border-color);
156
+ border-bottom: 2px solid var(--link-color);
157
+ font-size: var(--type-section);
158
+ font-weight: var(--weight-section);
159
+ }
160
+
161
+ /* H3 / H4:小标题,不加线,靠字重和字距分层 */
162
+ #editor .cm-content .cm-md-atxheading3 {
163
+ margin: 1.2em 0 0.45em;
164
+ font-size: var(--type-subhead);
165
+ font-weight: var(--weight-subhead);
166
+ letter-spacing: var(--tracking-subhead);
167
+ }
168
+ #editor .cm-content .cm-md-atxheading4 {
169
+ margin: 1em 0 0.4em;
170
+ font-size: 1.12em;
171
+ font-weight: var(--weight-subhead);
172
+ letter-spacing: var(--tracking-subhead);
173
+ }
174
+
175
+ /* H5 / H6:微标签,等宽、大写、拉开字距 */
176
+ #editor .cm-content .cm-md-atxheading5,
177
+ #editor .cm-content .cm-md-atxheading6 {
178
+ margin: 1.2em 0 0.4em;
179
+ font-family: var(--font-mono);
180
+ font-size: var(--type-label);
181
+ font-weight: var(--weight-label);
182
+ letter-spacing: var(--tracking-label);
183
+ text-transform: uppercase;
184
+ color: var(--text-muted);
185
+ }
186
+
187
+ /* ── 1.2 行内强调:加粗 = 柠檬黄 700 ── */
188
+ #editor .cm-content .cm-md-strong {
189
+ color: var(--link-color);
190
+ font-weight: 700;
191
+ }
192
+ #editor .cm-content .cm-md-em {
193
+ font-style: italic;
194
+ color: var(--text-secondary);
195
+ }
196
+ #editor .cm-content .cm-md-strike {
197
+ text-decoration: line-through;
198
+ }
199
+ #editor .cm-content .cm-md-highlight {
200
+ background: var(--highlight-bg);
201
+ color: var(--text-color);
202
+ }
203
+
204
+ /* ── 1.3 链接:柠檬黄 + 底部横线 ── */
205
+ #editor .cm-content .cm-md-link {
206
+ color: var(--link-color);
207
+ text-decoration: none;
208
+ border-bottom: var(--layout-rule) solid var(--link-color);
209
+ }
210
+ #editor .cm-content .cm-md-url {
211
+ color: var(--text-muted);
212
+ }
213
+
214
+ /* ── 1.4 行内代码:直角暗块 ── */
215
+ #editor .cm-content .cm-md-inlinecode {
216
+ font-family: var(--font-mono);
217
+ font-size: var(--type-small);
218
+ background: var(--code-bg);
219
+ color: var(--code-block-text);
220
+ border-radius: var(--layout-radius);
221
+ padding: 1px 6px;
222
+ }
223
+
224
+ #editor .cm-content .cm-md-marker,
225
+ #editor .cm-content .cm-md-quotemark,
226
+ #editor .cm-content .cm-md-listmark {
227
+ color: var(--text-muted);
228
+ }
229
+
230
+ /* ── 1.5 代码块:左侧柠檬竖线 + 暗底 ── */
231
+ #editor .cm-content .cm-md-codeblock {
232
+ font-family: var(--font-mono);
233
+ font-size: var(--type-small);
234
+ line-height: 1.65;
235
+ background: var(--code-block-bg);
236
+ color: var(--code-block-text);
237
+ border-left: 4px solid var(--link-color);
238
+ padding: 0 1.2em;
239
+ }
240
+ #editor .cm-content .cm-md-codeblock-first {
241
+ border-radius: var(--layout-radius);
242
+ }
243
+ #editor .cm-content .cm-md-codeblock-last {
244
+ border-radius: var(--layout-radius);
245
+ }
246
+
247
+ /* ── 1.6 引用块:抽象成卡片,保留左侧强调线 ── */
248
+ #editor .cm-content .cm-md-blockquote {
249
+ background: var(--blockquote-bg);
250
+ color: var(--text-secondary);
251
+ border-left: 2px solid var(--blockquote-border);
252
+ padding: 0 1.3em;
253
+ text-indent: 0;
254
+ }
255
+
256
+ /* ── 1.7 编号/项目列表:等宽柠檬数字,留出固定编号槽 ── */
257
+ #editor .cm-content .cm-md-listmark {
258
+ display: inline-block;
259
+ min-width: var(--layout-list-marker);
260
+ font-family: var(--font-mono);
261
+ font-size: 1.15em;
262
+ font-weight: 500;
263
+ letter-spacing: var(--tracking-mono);
264
+ color: var(--link-color);
265
+ }
266
+
267
+ /* ── 1.8 表格:细线网格,表头是等宽微标签,不是色块 ── */
268
+ #editor .cm-content .cm-md-table-widget {
269
+ font-size: 0.92em;
270
+ }
271
+ #editor .cm-content .cm-md-table-widget th,
272
+ #editor .cm-content .cm-md-table-widget td {
273
+ border: 0;
274
+ border-bottom: var(--layout-rule) solid var(--border-color);
275
+ padding: var(--layout-cell-pad);
276
+ text-align: left;
277
+ vertical-align: top;
278
+ }
279
+ #editor .cm-content .cm-md-table-widget th {
280
+ background: var(--table-header-bg);
281
+ color: var(--text-muted);
282
+ font-family: var(--font-mono);
283
+ font-size: var(--type-label);
284
+ font-weight: var(--weight-label);
285
+ text-transform: uppercase;
286
+ letter-spacing: var(--tracking-label);
287
+ border-bottom: 2px solid var(--link-color);
288
+ }
289
+ #editor .cm-content .cm-md-table-widget td {
290
+ font-variant-numeric: tabular-nums;
291
+ }
292
+ #editor .cm-content .cm-md-table-widget td:first-child {
293
+ font-weight: 600;
294
+ color: var(--text-color);
295
+ }
296
+ #editor .cm-content .cm-md-table-widget tr:last-child td {
297
+ border-bottom: 0;
298
+ }
299
+
300
+ /* ── 1.9 分隔线、图片、图表:统一的块间距 ── */
301
+ #editor .cm-content .cm-md-hr {
302
+ border-top: var(--layout-rule) solid var(--border-color);
303
+ margin: var(--layout-section-gap) 0;
304
+ }
305
+ #editor .cm-content .cm-md-image,
306
+ #editor .cm-content .cm-md-mermaid {
307
+ margin: var(--layout-block-gap) 0;
308
+ }
309
+
310
+ /* 全文齐左,不做中文首行缩进 */
311
+ #editor .cm-content .cm-line {
312
+ text-indent: 0;
313
+ }
314
+
315
+ /* ═══════════════════════════════════════════════════════════
316
+ SECTION 2 — 导出 HTML(.colamd-document)
317
+ ═══════════════════════════════════════════════════════════ */
318
+
319
+ .colamd-document {
320
+ font-family: var(--font-body);
321
+ font-size: var(--editor-font-size);
322
+ font-weight: var(--weight-body);
323
+ line-height: var(--leading-body);
324
+ text-align: left;
325
+ font-feature-settings: "ss01", "cv11";
326
+ color: var(--text-color);
327
+ }
328
+
329
+ /* ── 2.1 标题:与编辑器同一套层级 ── */
330
+ .colamd-document h1,
331
+ .colamd-document h2,
332
+ .colamd-document h3,
333
+ .colamd-document h4,
334
+ .colamd-document h5,
335
+ .colamd-document h6 {
336
+ font-family: var(--font-body);
337
+ color: var(--text-color);
338
+ line-height: var(--leading-section);
339
+ letter-spacing: var(--tracking-section);
340
+ text-align: left;
341
+ }
342
+ .colamd-document h1 {
343
+ margin: 0.8em 0 0.8em;
344
+ padding-top: 0.35em;
345
+ border-top: 2px solid var(--link-color);
346
+ font-size: var(--type-display);
347
+ font-weight: var(--weight-display);
348
+ line-height: var(--leading-display);
349
+ letter-spacing: var(--tracking-display);
350
+ }
351
+ .colamd-document h1:first-child {
352
+ margin-top: 0;
353
+ }
354
+ .colamd-document h2 {
355
+ margin: 1.6em 0 0.8em;
356
+ padding: 0.5em 0 0.4em;
357
+ border-top: var(--layout-rule) solid var(--border-color);
358
+ border-bottom: 2px solid var(--link-color);
359
+ font-size: var(--type-section);
360
+ font-weight: var(--weight-section);
361
+ }
362
+ .colamd-document h3 {
363
+ margin: 1.2em 0 0.45em;
364
+ font-size: var(--type-subhead);
365
+ font-weight: var(--weight-subhead);
366
+ letter-spacing: var(--tracking-subhead);
367
+ }
368
+ .colamd-document h4 {
369
+ margin: 1em 0 0.4em;
370
+ font-size: 1.12em;
371
+ font-weight: var(--weight-subhead);
372
+ letter-spacing: var(--tracking-subhead);
373
+ }
374
+ .colamd-document h5,
375
+ .colamd-document h6 {
376
+ margin: 1.2em 0 0.4em;
377
+ font-family: var(--font-mono);
378
+ font-size: var(--type-label);
379
+ font-weight: var(--weight-label);
380
+ letter-spacing: var(--tracking-label);
381
+ text-transform: uppercase;
382
+ color: var(--text-muted);
383
+ }
384
+
385
+ /* ── 2.2 行内元素 ── */
386
+ .colamd-document strong {
387
+ color: var(--link-color);
388
+ font-weight: 700;
389
+ }
390
+ .colamd-document em {
391
+ font-style: italic;
392
+ color: var(--text-secondary);
393
+ }
394
+ .colamd-document a {
395
+ color: var(--link-color);
396
+ text-decoration: none;
397
+ border-bottom: var(--layout-rule) solid var(--link-color);
398
+ }
399
+ .colamd-document code {
400
+ background: var(--code-bg);
401
+ color: var(--code-block-text);
402
+ font-family: var(--font-mono);
403
+ font-size: var(--type-small);
404
+ border-radius: var(--layout-radius);
405
+ }
406
+
407
+ /* ── 2.3 代码块、引用卡片、表格、分隔线 ── */
408
+ .colamd-document svg.pele {
409
+ background: var(--pele-bg);
410
+ border-radius: var(--pele-radius);
411
+ }
412
+ .colamd-document pre {
413
+ font-family: var(--font-mono);
414
+ font-size: var(--type-small);
415
+ line-height: 1.65;
416
+ background: var(--code-block-bg);
417
+ border-left: 4px solid var(--link-color);
418
+ border-radius: var(--layout-radius);
419
+ padding: 1em 1.2em;
420
+ }
421
+ .colamd-document pre code {
422
+ color: var(--code-block-text);
423
+ }
424
+ .colamd-document blockquote {
425
+ background: var(--blockquote-bg);
426
+ color: var(--text-secondary);
427
+ border-left: 2px solid var(--blockquote-border);
428
+ padding: var(--layout-card-pad);
429
+ }
430
+ .colamd-document mark {
431
+ background: var(--highlight-bg);
432
+ color: var(--text-color);
433
+ border-radius: var(--layout-radius);
434
+ }
435
+
436
+ .colamd-document table {
437
+ width: 100%;
438
+ border-collapse: collapse;
439
+ font-size: 0.92em;
440
+ }
441
+ .colamd-document th,
442
+ .colamd-document td {
443
+ border: 0;
444
+ border-bottom: var(--layout-rule) solid var(--border-color);
445
+ padding: var(--layout-cell-pad);
446
+ text-align: left;
447
+ vertical-align: top;
448
+ }
449
+ .colamd-document th {
450
+ background: var(--table-header-bg);
451
+ color: var(--text-muted);
452
+ font-family: var(--font-mono);
453
+ font-size: var(--type-label);
454
+ font-weight: var(--weight-label);
455
+ text-transform: uppercase;
456
+ letter-spacing: var(--tracking-label);
457
+ border-bottom: 2px solid var(--link-color);
458
+ }
459
+ .colamd-document td {
460
+ font-variant-numeric: tabular-nums;
461
+ }
462
+ .colamd-document td:first-child {
463
+ font-weight: 600;
464
+ color: var(--text-color);
465
+ }
466
+ .colamd-document tr:last-child td {
467
+ border-bottom: 0;
468
+ }
469
+ .colamd-document hr {
470
+ border-top: var(--layout-rule) solid var(--border-color);
471
+ margin: var(--layout-section-gap) 0;
472
+ }
473
+
474
+ /* 全文齐左,不做缩进 */
475
+ .colamd-document p {
476
+ text-indent: 0;
477
+ }
478
+ .colamd-document li p,
479
+ .colamd-document td p,
480
+ .colamd-document th p,
481
+ .colamd-document blockquote p {
482
+ text-indent: 0;
483
+ }
484
+
485
+ /* ═══════════════════════════════════════════════════════════
486
+ SECTION 3 — 幻灯片版式覆盖(放映 body.presenting 与导出
487
+ body.slides-printing 生效,编辑视图不受影响)
488
+ ═══════════════════════════════════════════════════════════ */
489
+
490
+ /* steps 版式的步骤名胶囊:透明底 + 柠檬描边 + 柠檬文字的全圆胶囊。
491
+ * 选择器带 #editor .cm-content:压过应用内置的实心标签块画法,
492
+ * 也压过本文件 1.2 节的加粗规则,保证描边风格不被改写。
493
+ * 细线代替色块是本主题的设计语言,胶囊不填色,靠描边和字色分层。 */
494
+ body.presenting #editor .cm-content .cm-md-slide-steps .cm-md-listmark,
495
+ body.slides-printing #editor .cm-content .cm-md-slide-steps .cm-md-listmark {
496
+ display: none;
497
+ }
498
+
499
+ body.presenting #editor .cm-content .cm-md-slide-steps .cm-md-strong,
500
+ body.slides-printing #editor .cm-content .cm-md-slide-steps .cm-md-strong {
501
+ display: inline-flex;
502
+ align-items: center;
503
+ justify-content: center;
504
+ flex: 0 0 auto;
505
+ min-width: 2.4em;
506
+ padding: 0.22em 0.9em;
507
+ border: 1.5px solid var(--pele-accent);
508
+ border-radius: 999px;
509
+ background: transparent;
510
+ color: var(--pele-accent);
511
+ font-family: var(--slide-title-font);
512
+ font-size: 0.95em;
513
+ line-height: 1.25;
514
+ white-space: nowrap;
515
+ }
516
+
517
+ /* ═══════════════════════════════════════════════════════════
518
+ SECTION 4 — 打印
519
+ ═══════════════════════════════════════════════════════════ */
520
+
521
+ @media print {
522
+ html,
523
+ body {
524
+ background: var(--bg-color);
525
+ color: var(--text-color);
526
+ -webkit-print-color-adjust: exact;
527
+ print-color-adjust: exact;
528
+ }
529
+ }