@bytechain.cn/colamd-themes 0.5.5 → 0.5.6

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/package.json CHANGED
@@ -1,7 +1,12 @@
1
1
  {
2
2
  "name": "@bytechain.cn/colamd-themes",
3
- "version": "0.5.5",
3
+ "version": "0.5.6",
4
4
  "description": "Theme development & export tool for ColaMD — extract formatting, generate themes, and export Markdown to HTML/PDF",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/byteuser1977/ColaMD-themes.git"
8
+ },
9
+ "license": "MIT",
5
10
  "type": "module",
6
11
  "main": "dist/index.js",
7
12
  "bin": {
@@ -11,7 +16,7 @@
11
16
  },
12
17
  "scripts": {
13
18
  "build": "tsc && node --input-type=commonjs -e \"require('fs').cpSync('src/templates','dist/templates',{recursive:true})\"",
14
- "build:skills": "bash skills/build-skills.sh",
19
+ "build:skills": "node skills/build-skills.js",
15
20
  "dev": "tsx src/cli.ts",
16
21
  "start": "node dist/cli.js",
17
22
  "build:mcp": "cd mcp-server && npm run build",
@@ -52,22 +57,21 @@
52
57
  }
53
58
  },
54
59
  "dependencies": {
55
- "@bytechain.cn/colamd": "^2.7.11",
56
60
  "axios": "^1.7",
57
61
  "chalk": "^5.3",
58
62
  "cheerio": "^1.0",
59
63
  "commander": "^12.0",
60
64
  "css-tree": "^3.0",
61
65
  "handlebars": "^4.7",
62
- "mammoth": "^1.8",
63
66
  "ora": "^8.0",
64
67
  "pdf-parse": "^1.1",
65
- "pptxgenjs": "^4.0.1",
66
68
  "puppeteer": "^24.0"
67
69
  },
68
70
  "devDependencies": {
71
+ "@bytechain.cn/colamd": "^2.7.11",
69
72
  "@types/css-tree": "^2.3",
70
73
  "@types/node": "^22.0",
74
+ "mammoth": "^1.8",
71
75
  "tsx": "^4.0",
72
76
  "typescript": "^5.5"
73
77
  }
@@ -0,0 +1,78 @@
1
+ /**
2
+ * Cross-platform launcher for skills/build-skills.sh.
3
+ *
4
+ * Windows hosts often lack `bash` on PATH (npm scripts run via cmd.exe),
5
+ * so locate a bash executable explicitly: derive it from `git` on PATH,
6
+ * then the Git for Windows registry entry, then well-known install roots,
7
+ * and finally fall back to plain `bash`. On non-Windows just use `bash`.
8
+ * All CLI arguments are passed through; stdio and exit codes are inherited.
9
+ */
10
+ import { spawnSync } from "node:child_process";
11
+ import { existsSync } from "node:fs";
12
+ import path from "node:path";
13
+ import { fileURLToPath } from "node:url";
14
+
15
+ const script = path.join(path.dirname(fileURLToPath(import.meta.url)), "build-skills.sh");
16
+ const isWin = process.platform === "win32";
17
+
18
+ /** <root>\cmd\git.exe (or <root>\bin\git.exe) → <root>\bin\bash.exe. */
19
+ function bashFromGitOnPath() {
20
+ const r = spawnSync("where", ["git"], { encoding: "utf8" });
21
+ if (r.status !== 0 || !r.stdout) return null;
22
+ for (const line of r.stdout.split(/\r?\n/)) {
23
+ const gitPath = line.trim();
24
+ if (!gitPath) continue;
25
+ const root = path.dirname(path.dirname(gitPath));
26
+ for (const sub of ["bin", path.join("usr", "bin")]) {
27
+ const p = path.join(root, sub, "bash.exe");
28
+ if (existsSync(p)) return p;
29
+ }
30
+ }
31
+ return null;
32
+ }
33
+
34
+ /** HKLM/HKCU SOFTWARE\GitForWindows InstallPath → <InstallPath>\bin\bash.exe. */
35
+ function bashFromRegistry() {
36
+ for (const hive of ["HKLM", "HKCU"]) {
37
+ const r = spawnSync(
38
+ "reg",
39
+ ["query", `${hive}\\SOFTWARE\\GitForWindows`, "/v", "InstallPath"],
40
+ { encoding: "utf8" }
41
+ );
42
+ const m = r.status === 0 && r.stdout && r.stdout.match(/InstallPath\s+REG_SZ\s+(.+)/);
43
+ if (!m) continue;
44
+ const root = m[1].trim();
45
+ for (const sub of ["bin", path.join("usr", "bin")]) {
46
+ const p = path.join(root, sub, "bash.exe");
47
+ if (existsSync(p)) return p;
48
+ }
49
+ }
50
+ return null;
51
+ }
52
+
53
+ /** Ordered bash candidates; `bash` last so PATH misses fall through. */
54
+ function bashCandidates() {
55
+ if (!isWin) return ["bash"];
56
+ const found = [bashFromGitOnPath(), bashFromRegistry()].filter(Boolean);
57
+ const roots = [
58
+ process.env["ProgramFiles"],
59
+ "C:\\Program Files (x86)",
60
+ process.env["LocalAppData"] && path.join(process.env["LocalAppData"], "Programs", "Git"),
61
+ ].filter(Boolean);
62
+ for (const root of roots) {
63
+ for (const sub of ["bin", path.join("usr", "bin")]) {
64
+ const p = path.join(root, sub, "bash.exe");
65
+ if (existsSync(p)) found.push(p);
66
+ }
67
+ }
68
+ found.push("bash");
69
+ return found;
70
+ }
71
+
72
+ for (const bash of bashCandidates()) {
73
+ const r = spawnSync(bash, [script, ...process.argv.slice(2)], { stdio: "inherit" });
74
+ if (!r.error) process.exit(r.status ?? 1);
75
+ }
76
+
77
+ console.error("build:skills: bash not found — install Git for Windows or add bash to PATH.");
78
+ process.exit(1);
@@ -0,0 +1,258 @@
1
+ /*
2
+ * ColaMD Theme: Linear Dark
3
+ * 深色产品文档:近黑底 / 靛蓝强调 / hairline 边框 / 轻微负字距
4
+ * 契约:ColaMD 2.7(:root 活变量;CM6 每行一 div,引用/代码块禁纵向 padding)
5
+ */
6
+
7
+ :root {
8
+ /* ── 1.1 Seed Palette ── */
9
+ --seed-accent: #6e79dd;
10
+ --seed-accent-light: rgba(94, 106, 210, 0.16);
11
+ --seed-accent-dark: #4c59b8;
12
+ --seed-surface: #010101;
13
+ --seed-panel: #100f0f;
14
+ --seed-panel-alt: #151414;
15
+ --seed-ink: #f5f8fd;
16
+ --seed-ink-muted: #d0d6e0;
17
+ --seed-ink-dim: #8a8f98;
18
+ --seed-border: #242424;
19
+ --seed-border-strong: #34343a;
20
+
21
+ /* ── 1.2 Semantic Colors(活变量)── */
22
+ --bg-color: var(--seed-surface);
23
+ --text-color: var(--seed-ink);
24
+ --text-secondary: var(--seed-ink-muted);
25
+ --text-muted: var(--seed-ink-dim);
26
+ --border-color: var(--seed-border);
27
+ --link-color: var(--seed-accent);
28
+
29
+ --code-bg: var(--seed-panel);
30
+ --code-block-bg: var(--seed-panel-alt);
31
+ --code-block-text: var(--seed-ink);
32
+
33
+ --blockquote-border: var(--seed-accent);
34
+ --blockquote-bg: var(--seed-panel);
35
+ --table-header-bg: var(--seed-panel-alt);
36
+
37
+ --selection-bg: rgba(94, 106, 210, 0.32);
38
+ --highlight-bg: rgba(94, 106, 210, 0.24);
39
+
40
+ /* ── 1.3 Typography & Metrics(活变量)── */
41
+ --font-body: "Inter", "Noto Sans SC", "PingFang SC", "Microsoft YaHei",
42
+ system-ui, -apple-system, "Segoe UI", sans-serif;
43
+ --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo,
44
+ "Noto Sans Mono CJK SC", monospace;
45
+ --editor-font-size: 16px;
46
+ --editor-column-width: 800px;
47
+
48
+ /* ── 1.4 Pele Diagram(9 个变量)── */
49
+ --pele-bg: var(--code-block-bg);
50
+ --pele-fg: var(--code-block-text);
51
+ --pele-muted: var(--seed-ink-dim);
52
+ --pele-line: var(--seed-ink-muted);
53
+ --pele-surface: var(--seed-panel);
54
+ --pele-surface-alt: var(--seed-panel-alt);
55
+ --pele-border: var(--seed-border-strong);
56
+ --pele-accent: var(--seed-accent);
57
+ --pele-radius: 6px;
58
+ }
59
+
60
+ /* ═══════════════ SECTION 2 — Editor DOM ═══════════════ */
61
+
62
+ #editor .cm-content {
63
+ color: var(--text-color);
64
+ font-family: var(--font-body);
65
+ line-height: 1.7;
66
+ letter-spacing: -0.01em;
67
+ }
68
+
69
+ /* ── 2.1 Headings ── */
70
+ #editor .cm-content .cm-md-atxheading1,
71
+ #editor .cm-content .cm-md-atxheading2,
72
+ #editor .cm-content .cm-md-atxheading3,
73
+ #editor .cm-content .cm-md-atxheading4,
74
+ #editor .cm-content .cm-md-atxheading5,
75
+ #editor .cm-content .cm-md-atxheading6 {
76
+ color: var(--seed-ink);
77
+ font-family: var(--font-body);
78
+ font-weight: 650;
79
+ line-height: 1.25;
80
+ letter-spacing: -0.022em;
81
+ }
82
+ #editor .cm-content .cm-md-atxheading1 { font-size: 2.25em; letter-spacing: -0.035em; }
83
+ #editor .cm-content .cm-md-atxheading2 {
84
+ font-size: 1.65em;
85
+ padding-bottom: 0.25em;
86
+ border-bottom: 1px solid var(--border-color);
87
+ }
88
+ #editor .cm-content .cm-md-atxheading3 { font-size: 1.3em; }
89
+ #editor .cm-content .cm-md-atxheading4 { font-size: 1.125em; }
90
+ #editor .cm-content .cm-md-atxheading5 { font-size: 1em; }
91
+ #editor .cm-content .cm-md-atxheading6 { font-size: 0.9em; color: var(--text-secondary); }
92
+
93
+ /* ── 2.2 Inline / Lists ── */
94
+ #editor .cm-content .cm-md-strong { color: var(--seed-ink); font-weight: 700; }
95
+ #editor .cm-content .cm-md-em { font-style: italic; }
96
+ #editor .cm-content .cm-md-strike { text-decoration: line-through; }
97
+ #editor .cm-content .cm-md-highlight { background: var(--highlight-bg); }
98
+ #editor .cm-content .cm-md-link {
99
+ color: var(--link-color);
100
+ text-decoration: none;
101
+ border-bottom: 1px solid var(--seed-border-strong);
102
+ }
103
+ #editor .cm-content .cm-md-url { color: var(--text-muted); }
104
+ #editor .cm-content .cm-md-inlinecode {
105
+ color: var(--text-color);
106
+ font-family: var(--font-mono);
107
+ font-size: 0.9em;
108
+ background: var(--code-bg);
109
+ border: 1px solid var(--border-color);
110
+ border-radius: 4px;
111
+ padding: 1px 5px;
112
+ }
113
+ #editor .cm-content .cm-md-marker,
114
+ #editor .cm-content .cm-md-quotemark { color: var(--text-muted); }
115
+ #editor .cm-content .cm-md-listmark { color: var(--seed-accent); }
116
+ #editor .cm-content .cm-md-li-0,
117
+ #editor .cm-content .cm-md-li-1,
118
+ #editor .cm-content .cm-md-li-2,
119
+ #editor .cm-content .cm-md-li-3,
120
+ #editor .cm-content .cm-md-li-4,
121
+ #editor .cm-content .cm-md-li-5,
122
+ #editor .cm-content .cm-md-li-6 { color: var(--text-color); }
123
+
124
+ /* ── 2.3 Blockquote / Code Block(禁纵向 padding)── */
125
+ #editor .cm-content .cm-md-blockquote {
126
+ color: var(--text-secondary);
127
+ background: var(--blockquote-bg);
128
+ border-left: 2px solid var(--blockquote-border);
129
+ padding-left: 16px;
130
+ padding-right: 16px;
131
+ }
132
+ #editor .cm-content .cm-md-codeblock {
133
+ color: var(--code-block-text);
134
+ font-family: var(--font-mono);
135
+ background: var(--code-block-bg);
136
+ border-left: 1px solid var(--border-color);
137
+ border-right: 1px solid var(--border-color);
138
+ padding-left: 16px;
139
+ padding-right: 16px;
140
+ }
141
+ #editor .cm-content .cm-md-codeblock-first {
142
+ border-top: 1px solid var(--border-color);
143
+ border-top-left-radius: 6px;
144
+ border-top-right-radius: 6px;
145
+ }
146
+ #editor .cm-content .cm-md-codeblock-last {
147
+ border-bottom: 1px solid var(--border-color);
148
+ border-bottom-left-radius: 6px;
149
+ border-bottom-right-radius: 6px;
150
+ }
151
+
152
+ /* ── 2.4 Table / Rule ── */
153
+ #editor .cm-content .cm-md-table-widget th,
154
+ #editor .cm-content .cm-md-table-widget td {
155
+ padding: 8px 12px;
156
+ border-color: var(--border-color);
157
+ }
158
+ #editor .cm-content .cm-md-table-widget th {
159
+ color: var(--seed-ink);
160
+ font-weight: 600;
161
+ background: var(--table-header-bg);
162
+ border-bottom: 1px solid var(--seed-border-strong);
163
+ }
164
+ #editor .cm-content .cm-md-table-widget tr:nth-child(even) td { background: var(--seed-panel); }
165
+ #editor .cm-content .cm-md-hr { border-top-color: var(--border-color); }
166
+
167
+ /* ═══════════════ SECTION 3 — Exported HTML ═══════════════ */
168
+
169
+ .colamd-document {
170
+ color: var(--text-color);
171
+ font-family: var(--font-body);
172
+ font-size: var(--editor-font-size);
173
+ line-height: 1.7;
174
+ letter-spacing: -0.01em;
175
+ }
176
+ .colamd-document h1,
177
+ .colamd-document h2,
178
+ .colamd-document h3,
179
+ .colamd-document h4,
180
+ .colamd-document h5,
181
+ .colamd-document h6 {
182
+ color: var(--seed-ink);
183
+ font-family: var(--font-body);
184
+ font-weight: 650;
185
+ line-height: 1.25;
186
+ letter-spacing: -0.022em;
187
+ }
188
+ .colamd-document h1 { font-size: 2.25em; letter-spacing: -0.035em; }
189
+ .colamd-document h2 {
190
+ font-size: 1.65em;
191
+ padding-bottom: 0.25em;
192
+ border-bottom: 1px solid var(--border-color);
193
+ }
194
+ .colamd-document h3 { font-size: 1.3em; }
195
+ .colamd-document strong { color: var(--seed-ink); }
196
+ .colamd-document a {
197
+ color: var(--link-color);
198
+ text-decoration: none;
199
+ border-bottom: 1px solid var(--seed-border-strong);
200
+ }
201
+ .colamd-document ul,
202
+ .colamd-document ol { padding-left: 1.75em; }
203
+ .colamd-document li { margin: 0.25em 0; }
204
+ .colamd-document li::marker { color: var(--seed-accent); }
205
+ .colamd-document code {
206
+ color: var(--text-color);
207
+ font-family: var(--font-mono);
208
+ font-size: 0.9em;
209
+ background: var(--code-bg);
210
+ border: 1px solid var(--border-color);
211
+ border-radius: 4px;
212
+ padding: 1px 5px;
213
+ }
214
+ .colamd-document pre {
215
+ background: var(--code-block-bg);
216
+ border: 1px solid var(--border-color);
217
+ border-radius: 6px;
218
+ }
219
+ .colamd-document pre code {
220
+ color: var(--code-block-text);
221
+ background: transparent;
222
+ border: 0;
223
+ padding: 0;
224
+ }
225
+ .colamd-document blockquote {
226
+ color: var(--text-secondary);
227
+ background: var(--blockquote-bg);
228
+ border-left: 2px solid var(--blockquote-border);
229
+ }
230
+ .colamd-document mark { background: var(--highlight-bg); }
231
+ .colamd-document table { border-collapse: collapse; width: 100%; }
232
+ .colamd-document th,
233
+ .colamd-document td { border: 1px solid var(--border-color); padding: 8px 12px; }
234
+ .colamd-document th {
235
+ color: var(--seed-ink);
236
+ font-weight: 600;
237
+ background: var(--table-header-bg);
238
+ }
239
+ .colamd-document tbody tr:nth-child(even) td { background: var(--seed-panel); }
240
+ .colamd-document hr { border: 0; border-top: 1px solid var(--border-color); }
241
+ .colamd-document img {
242
+ max-width: 100%;
243
+ border: 1px solid var(--border-color);
244
+ border-radius: 6px;
245
+ }
246
+ .colamd-document svg.pele { background: var(--pele-bg); border-radius: var(--pele-radius); }
247
+
248
+ /* ═══════════════ SECTION 4 — Print ═══════════════ */
249
+
250
+ @media print {
251
+ html,
252
+ body {
253
+ background: var(--bg-color);
254
+ color: var(--text-color);
255
+ -webkit-print-color-adjust: exact;
256
+ print-color-adjust: exact;
257
+ }
258
+ }
@@ -0,0 +1,294 @@
1
+ /*
2
+ * ColaMD Theme: monotonomo
3
+ * 提取自 monotonomo.com 站点真实 CSS 设计令牌:
4
+ * 底色浅灰 #f8f8f8 / 面板 #ececec / #e0e0e0(paradigm 要求中性底)
5
+ * 标题 暖黑 #1a1918 / 粗体 深炭 #33302b / 正文 暖灰 #4a443e / 次级 #6b655f
6
+ * 信号红 #e40014 单点强调 / 中性分隔线 #d1d1d1 / 小圆角 .25rem
7
+ * 字体 Space Grotesk(正文·标题)+ JetBrains Mono(代码)
8
+ * 契约:ColaMD 2.7.8-rc.2(变量只写 :root;引用/代码块每行一 div 禁纵向 padding)
9
+ *
10
+ * 注:colamd-themes from-url 自动提取结果为白底蓝 #2b579a,未命中本站配色,
11
+ * 本文件为按站点 CSS 变量逐个对齐的手写版。
12
+ */
13
+
14
+ :root {
15
+ /* ── 1.1 Seed Palette ── */
16
+ --seed-accent: #e40014;
17
+ --seed-accent-light: #fdebed;
18
+ --seed-accent-dark: #b3000f;
19
+ --seed-surface: #f8f8f8;
20
+ --seed-panel: #ececec;
21
+ --seed-panel-alt: #e0e0e0;
22
+ --seed-ink: #1a1918;
23
+ --seed-ink-muted: #6b655f;
24
+ --seed-ink-dim: #9a928a;
25
+ --seed-border: #d1d1d1;
26
+ --seed-border-strong: #1a1918;
27
+
28
+ /* ── 1.2 Semantic Colors(活变量)── */
29
+ --bg-color: var(--seed-surface);
30
+ --text-color: #4a443e;
31
+ --text-secondary: var(--seed-ink-muted);
32
+ --text-muted: var(--seed-ink-dim);
33
+ --border-color: var(--seed-border);
34
+ --link-color: var(--seed-accent);
35
+
36
+ --code-bg: var(--seed-panel);
37
+ --code-block-bg: var(--seed-panel-alt);
38
+ --code-block-text: var(--seed-ink);
39
+
40
+ --blockquote-border: var(--seed-accent);
41
+ --blockquote-bg: transparent;
42
+ --table-header-bg: var(--seed-ink);
43
+
44
+ --selection-bg: rgba(228, 0, 20, 0.14);
45
+ --highlight-bg: rgba(228, 0, 20, 0.14);
46
+
47
+ /* ── 1.3 Typography & Metrics(活变量)── */
48
+ --font-body: "Space Grotesk", "Noto Sans SC", "PingFang SC", "Microsoft YaHei",
49
+ system-ui, -apple-system, "Segoe UI", sans-serif;
50
+ --font-mono: "JetBrains Mono", "SF Mono", "Fira Code", Menlo, Consolas, monospace;
51
+ --editor-font-size: 16px;
52
+ --editor-column-width: 760px;
53
+
54
+ /* ── 1.4 Pele Diagram(9 个变量)── */
55
+ --pele-bg: var(--code-block-bg);
56
+ --pele-fg: var(--code-block-text);
57
+ --pele-muted: var(--seed-ink-muted);
58
+ --pele-line: var(--seed-ink);
59
+ --pele-surface: var(--seed-surface);
60
+ --pele-surface-alt: var(--seed-panel);
61
+ --pele-border: var(--seed-border-strong);
62
+ --pele-accent: var(--seed-accent);
63
+ --pele-radius: 4px;
64
+ }
65
+
66
+ /* ═══════════════════════════════════════════════════════════
67
+ SECTION 2 — Editor DOM(#editor .cm-content + .cm-md-*)
68
+ ═══════════════════════════════════════════════════════════ */
69
+
70
+ #editor .cm-content {
71
+ font-family: var(--font-body);
72
+ line-height: 1.625;
73
+ letter-spacing: -0.01em;
74
+ text-align: left;
75
+ }
76
+
77
+ /* ── 2.1 Headings:Space Grotesk 紧字距 ── */
78
+ #editor .cm-content .cm-md-atxheading1,
79
+ #editor .cm-content .cm-md-atxheading2,
80
+ #editor .cm-content .cm-md-atxheading3,
81
+ #editor .cm-content .cm-md-atxheading4,
82
+ #editor .cm-content .cm-md-atxheading5,
83
+ #editor .cm-content .cm-md-atxheading6 {
84
+ font-family: var(--font-body);
85
+ color: var(--seed-ink);
86
+ font-weight: 700;
87
+ line-height: 1.25;
88
+ letter-spacing: -0.025em;
89
+ text-align: left;
90
+ }
91
+
92
+ #editor .cm-content .cm-md-atxheading1 {
93
+ font-size: 2.125em;
94
+ letter-spacing: -0.035em;
95
+ }
96
+ #editor .cm-content .cm-md-atxheading2 {
97
+ font-size: 1.5em;
98
+ padding-bottom: 0.2em;
99
+ border-bottom: 2px solid var(--seed-border);
100
+ }
101
+ #editor .cm-content .cm-md-atxheading3 { font-size: 1.2em; }
102
+ #editor .cm-content .cm-md-atxheading4 { font-size: 1.05em; }
103
+ #editor .cm-content .cm-md-atxheading5 { font-size: 1em; }
104
+ #editor .cm-content .cm-md-atxheading6 { font-size: 0.875em; }
105
+
106
+ /* ── 2.2 Inline ── */
107
+ #editor .cm-content .cm-md-strong { color: #33302b; font-weight: 700; }
108
+ #editor .cm-content .cm-md-em { font-style: italic; }
109
+ #editor .cm-content .cm-md-strike { text-decoration: line-through; }
110
+ #editor .cm-content .cm-md-highlight { background: var(--highlight-bg); }
111
+
112
+ /* 链接:红色下划线 */
113
+ #editor .cm-content .cm-md-link {
114
+ color: var(--link-color);
115
+ text-decoration: none;
116
+ border-bottom: 1px solid var(--link-color);
117
+ }
118
+ #editor .cm-content .cm-md-url { color: var(--text-muted); }
119
+
120
+ /* 内联代码:JetBrains Mono + 暖灰底 + 4px 圆角 */
121
+ #editor .cm-content .cm-md-inlinecode {
122
+ font-family: var(--font-mono);
123
+ font-size: 0.9em;
124
+ background: var(--code-bg);
125
+ color: var(--text-color);
126
+ border-radius: 4px;
127
+ padding: 1px 6px;
128
+ }
129
+
130
+ #editor .cm-content .cm-md-marker,
131
+ #editor .cm-content .cm-md-quotemark,
132
+ #editor .cm-content .cm-md-listmark {
133
+ color: var(--seed-ink-muted);
134
+ }
135
+
136
+ /* ── 2.3 Blockquote / Code Block(每行一个 div,禁用纵向 padding)── */
137
+ #editor .cm-content .cm-md-blockquote {
138
+ background: var(--blockquote-bg);
139
+ color: var(--text-secondary);
140
+ border-left: 3px solid var(--blockquote-border);
141
+ padding-left: 20px;
142
+ padding-right: 20px;
143
+ }
144
+
145
+ #editor .cm-content .cm-md-codeblock {
146
+ background: var(--code-block-bg);
147
+ color: var(--code-block-text);
148
+ border-left: 3px solid var(--seed-accent);
149
+ padding-left: 16px;
150
+ padding-right: 16px;
151
+ }
152
+ #editor .cm-content .cm-md-codeblock-first {
153
+ border-top-left-radius: 4px;
154
+ border-top-right-radius: 4px;
155
+ }
156
+ #editor .cm-content .cm-md-codeblock-last {
157
+ border-bottom-left-radius: 4px;
158
+ border-bottom-right-radius: 4px;
159
+ }
160
+
161
+ /* ── 2.4 Table / Rule ── */
162
+ #editor .cm-content .cm-md-table-widget th,
163
+ #editor .cm-content .cm-md-table-widget td {
164
+ border-color: var(--border-color);
165
+ }
166
+ #editor .cm-content .cm-md-table-widget th {
167
+ background: var(--table-header-bg);
168
+ color: var(--seed-surface);
169
+ font-weight: 600;
170
+ letter-spacing: 0.03em;
171
+ font-size: 0.875em;
172
+ border-color: var(--seed-ink);
173
+ }
174
+ #editor .cm-content .cm-md-table-widget tr:nth-child(even) td {
175
+ background: var(--seed-panel);
176
+ }
177
+ #editor .cm-content .cm-md-hr {
178
+ border-top-color: var(--border-color);
179
+ margin: 2.75em 0;
180
+ }
181
+
182
+ /* ── 2.5 中文首行缩进 ── */
183
+ #editor .cm-content .cm-line { text-indent: 2em; }
184
+
185
+ #editor .cm-content .cm-md-atxheading1,
186
+ #editor .cm-content .cm-md-atxheading2,
187
+ #editor .cm-content .cm-md-atxheading3,
188
+ #editor .cm-content .cm-md-atxheading4,
189
+ #editor .cm-content .cm-md-atxheading5,
190
+ #editor .cm-content .cm-md-atxheading6,
191
+ #editor .cm-content .cm-md-blockquote,
192
+ #editor .cm-content .cm-md-codeblock,
193
+ #editor .cm-content .cm-md-hr,
194
+ #editor .cm-content .cm-md-mermaid,
195
+ #editor .cm-content .cm-md-li-0,
196
+ #editor .cm-content .cm-md-li-1,
197
+ #editor .cm-content .cm-md-li-2,
198
+ #editor .cm-content .cm-md-li-3,
199
+ #editor .cm-content .cm-md-li-4,
200
+ #editor .cm-content .cm-md-li-5,
201
+ #editor .cm-content .cm-md-li-6 {
202
+ text-indent: 0;
203
+ }
204
+
205
+ /* ═══════════════════════════════════════════════════════════
206
+ SECTION 3 — Exported HTML(.colamd-document)
207
+ ═══════════════════════════════════════════════════════════ */
208
+
209
+ .colamd-document {
210
+ font-family: var(--font-body);
211
+ font-size: var(--editor-font-size);
212
+ line-height: 1.625;
213
+ letter-spacing: -0.01em;
214
+ text-align: left;
215
+ }
216
+
217
+ .colamd-document h1,
218
+ .colamd-document h2,
219
+ .colamd-document h3,
220
+ .colamd-document h4,
221
+ .colamd-document h5,
222
+ .colamd-document h6 {
223
+ font-family: var(--font-body);
224
+ color: var(--seed-ink);
225
+ font-weight: 700;
226
+ letter-spacing: -0.025em;
227
+ }
228
+ .colamd-document h1 { font-size: 2.125em; letter-spacing: -0.035em; }
229
+ .colamd-document h2 {
230
+ font-size: 1.5em;
231
+ padding-bottom: 0.2em;
232
+ border-bottom: 2px solid var(--seed-border);
233
+ }
234
+ .colamd-document h3 { font-size: 1.2em; }
235
+
236
+ .colamd-document strong { color: #33302b; }
237
+ .colamd-document a {
238
+ color: var(--link-color);
239
+ text-decoration: none;
240
+ border-bottom: 1px solid var(--link-color);
241
+ }
242
+ .colamd-document code {
243
+ background: var(--code-bg);
244
+ color: var(--text-color);
245
+ font-family: var(--font-mono);
246
+ font-size: 0.9em;
247
+ border-radius: 4px;
248
+ padding: 1px 6px;
249
+ }
250
+ .colamd-document pre {
251
+ background: var(--code-block-bg);
252
+ border-left: 3px solid var(--seed-accent);
253
+ border-radius: 4px;
254
+ }
255
+ .colamd-document pre code { color: var(--code-block-text); background: transparent; }
256
+ .colamd-document blockquote {
257
+ background: var(--blockquote-bg);
258
+ color: var(--text-secondary);
259
+ border-left: 3px solid var(--blockquote-border);
260
+ }
261
+ .colamd-document mark { background: var(--highlight-bg); }
262
+ .colamd-document th {
263
+ background: var(--table-header-bg);
264
+ color: var(--seed-surface);
265
+ letter-spacing: 0.03em;
266
+ font-size: 0.875em;
267
+ }
268
+ .colamd-document tbody tr:nth-child(even) td { background: var(--seed-panel); }
269
+ .colamd-document hr {
270
+ border-top-color: var(--border-color);
271
+ margin: 2.75em 0;
272
+ }
273
+
274
+ .colamd-document p { text-indent: 2em; }
275
+ .colamd-document li p,
276
+ .colamd-document td p,
277
+ .colamd-document th p,
278
+ .colamd-document blockquote p {
279
+ text-indent: 0;
280
+ }
281
+
282
+ /* ═══════════════════════════════════════════════════════════
283
+ SECTION 4 — Print
284
+ ═══════════════════════════════════════════════════════════ */
285
+
286
+ @media print {
287
+ html,
288
+ body {
289
+ background: var(--bg-color);
290
+ color: var(--text-color);
291
+ -webkit-print-color-adjust: exact;
292
+ print-color-adjust: exact;
293
+ }
294
+ }
@@ -0,0 +1,258 @@
1
+ /*
2
+ * ColaMD Theme: Stripe Fintech
3
+ * 浅色金融科技文档:Stripe 紫 / 深海军蓝标题 / 细边框与单层轻阴影
4
+ * 契约:ColaMD 2.7(:root 活变量;CM6 每行一 div,引用/代码块禁纵向 padding)
5
+ */
6
+
7
+ :root {
8
+ /* ── 1.1 Seed Palette ── */
9
+ --seed-accent: #635bff;
10
+ --seed-accent-light: #eeedff;
11
+ --seed-accent-dark: #4f46b8;
12
+ --seed-surface: #ffffff;
13
+ --seed-panel: #f9f8f8;
14
+ --seed-panel-alt: #f2f1f1;
15
+ --seed-ink: #0a2540;
16
+ --seed-ink-muted: #425466;
17
+ --seed-ink-dim: #6b7c8d;
18
+ --seed-border: #e2e2e2;
19
+ --seed-border-strong: #cbd5e1;
20
+
21
+ /* ── 1.2 Semantic Colors(活变量)── */
22
+ --bg-color: var(--seed-surface);
23
+ --text-color: var(--seed-ink-muted);
24
+ --text-secondary: var(--seed-ink-muted);
25
+ --text-muted: var(--seed-ink-dim);
26
+ --border-color: var(--seed-border);
27
+ --link-color: var(--seed-accent);
28
+
29
+ --code-bg: var(--seed-panel);
30
+ --code-block-bg: var(--seed-panel-alt);
31
+ --code-block-text: var(--seed-ink);
32
+
33
+ --blockquote-border: var(--seed-accent);
34
+ --blockquote-bg: var(--seed-panel);
35
+ --table-header-bg: var(--seed-panel);
36
+
37
+ --selection-bg: rgba(99, 91, 255, 0.16);
38
+ --highlight-bg: rgba(99, 91, 255, 0.18);
39
+
40
+ /* ── 1.3 Typography & Metrics(活变量)── */
41
+ --font-body: "Inter", "Noto Sans SC", "PingFang SC", "Microsoft YaHei",
42
+ system-ui, -apple-system, "Segoe UI", sans-serif;
43
+ --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo,
44
+ "Noto Sans Mono CJK SC", monospace;
45
+ --editor-font-size: 16px;
46
+ --editor-column-width: 760px;
47
+
48
+ /* ── 1.4 Pele Diagram(9 个变量)── */
49
+ --pele-bg: var(--code-block-bg);
50
+ --pele-fg: var(--code-block-text);
51
+ --pele-muted: var(--seed-ink-dim);
52
+ --pele-line: var(--seed-ink-muted);
53
+ --pele-surface: var(--seed-surface);
54
+ --pele-surface-alt: var(--seed-panel);
55
+ --pele-border: var(--seed-border-strong);
56
+ --pele-accent: var(--seed-accent);
57
+ --pele-radius: 6px;
58
+ }
59
+
60
+ /* ═══════════════ SECTION 2 — Editor DOM ═══════════════ */
61
+
62
+ #editor .cm-content {
63
+ color: var(--text-color);
64
+ font-family: var(--font-body);
65
+ line-height: 1.7;
66
+ }
67
+
68
+ /* ── 2.1 Headings ── */
69
+ #editor .cm-content .cm-md-atxheading1,
70
+ #editor .cm-content .cm-md-atxheading2,
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: var(--seed-ink);
76
+ font-family: var(--font-body);
77
+ font-weight: 700;
78
+ line-height: 1.3;
79
+ letter-spacing: -0.02em;
80
+ }
81
+ #editor .cm-content .cm-md-atxheading1 { font-size: 2.25em; }
82
+ #editor .cm-content .cm-md-atxheading2 {
83
+ font-size: 1.65em;
84
+ padding-bottom: 0.25em;
85
+ border-bottom: 1px solid var(--border-color);
86
+ }
87
+ #editor .cm-content .cm-md-atxheading3 { font-size: 1.3em; }
88
+ #editor .cm-content .cm-md-atxheading4 { font-size: 1.125em; }
89
+ #editor .cm-content .cm-md-atxheading5 { font-size: 1em; }
90
+ #editor .cm-content .cm-md-atxheading6 { font-size: 0.9em; color: var(--text-muted); }
91
+
92
+ /* ── 2.2 Inline / Lists ── */
93
+ #editor .cm-content .cm-md-strong { color: var(--seed-ink); font-weight: 700; }
94
+ #editor .cm-content .cm-md-em { font-style: italic; }
95
+ #editor .cm-content .cm-md-strike { text-decoration: line-through; }
96
+ #editor .cm-content .cm-md-highlight { background: var(--highlight-bg); }
97
+ #editor .cm-content .cm-md-link {
98
+ color: var(--link-color);
99
+ text-decoration: none;
100
+ border-bottom: 1px solid var(--link-color);
101
+ }
102
+ #editor .cm-content .cm-md-url { color: var(--text-muted); }
103
+ #editor .cm-content .cm-md-inlinecode {
104
+ color: var(--seed-ink);
105
+ font-family: var(--font-mono);
106
+ font-size: 0.9em;
107
+ background: var(--code-bg);
108
+ border: 1px solid var(--border-color);
109
+ border-radius: 4px;
110
+ padding: 1px 5px;
111
+ }
112
+ #editor .cm-content .cm-md-marker,
113
+ #editor .cm-content .cm-md-quotemark { color: var(--text-muted); }
114
+ #editor .cm-content .cm-md-listmark { color: var(--seed-accent); }
115
+ #editor .cm-content .cm-md-li-0,
116
+ #editor .cm-content .cm-md-li-1,
117
+ #editor .cm-content .cm-md-li-2,
118
+ #editor .cm-content .cm-md-li-3,
119
+ #editor .cm-content .cm-md-li-4,
120
+ #editor .cm-content .cm-md-li-5,
121
+ #editor .cm-content .cm-md-li-6 { color: var(--text-color); }
122
+
123
+ /* ── 2.3 Blockquote / Code Block(禁纵向 padding)── */
124
+ #editor .cm-content .cm-md-blockquote {
125
+ color: var(--text-secondary);
126
+ background: var(--blockquote-bg);
127
+ border-left: 3px solid var(--blockquote-border);
128
+ padding-left: 16px;
129
+ padding-right: 16px;
130
+ }
131
+ #editor .cm-content .cm-md-codeblock {
132
+ color: var(--code-block-text);
133
+ font-family: var(--font-mono);
134
+ background: var(--code-block-bg);
135
+ border-left: 1px solid var(--border-color);
136
+ border-right: 1px solid var(--border-color);
137
+ padding-left: 16px;
138
+ padding-right: 16px;
139
+ }
140
+ #editor .cm-content .cm-md-codeblock-first {
141
+ border-top: 1px solid var(--border-color);
142
+ border-top-left-radius: 6px;
143
+ border-top-right-radius: 6px;
144
+ }
145
+ #editor .cm-content .cm-md-codeblock-last {
146
+ border-bottom: 1px solid var(--border-color);
147
+ border-bottom-left-radius: 6px;
148
+ border-bottom-right-radius: 6px;
149
+ }
150
+
151
+ /* ── 2.4 Table / Rule ── */
152
+ #editor .cm-content .cm-md-table-widget th,
153
+ #editor .cm-content .cm-md-table-widget td {
154
+ padding: 8px 12px;
155
+ border-color: var(--border-color);
156
+ }
157
+ #editor .cm-content .cm-md-table-widget th {
158
+ color: var(--seed-ink);
159
+ font-weight: 600;
160
+ background: var(--table-header-bg);
161
+ border-bottom: 1px solid var(--seed-border-strong);
162
+ }
163
+ #editor .cm-content .cm-md-table-widget tr:nth-child(even) td { background: var(--seed-panel); }
164
+ #editor .cm-content .cm-md-hr { border-top-color: var(--border-color); }
165
+
166
+ /* ═══════════════ SECTION 3 — Exported HTML ═══════════════ */
167
+
168
+ .colamd-document {
169
+ color: var(--text-color);
170
+ font-family: var(--font-body);
171
+ font-size: var(--editor-font-size);
172
+ line-height: 1.7;
173
+ }
174
+ .colamd-document h1,
175
+ .colamd-document h2,
176
+ .colamd-document h3,
177
+ .colamd-document h4,
178
+ .colamd-document h5,
179
+ .colamd-document h6 {
180
+ color: var(--seed-ink);
181
+ font-family: var(--font-body);
182
+ font-weight: 700;
183
+ line-height: 1.3;
184
+ letter-spacing: -0.02em;
185
+ }
186
+ .colamd-document h1 { font-size: 2.25em; }
187
+ .colamd-document h2 {
188
+ font-size: 1.65em;
189
+ padding-bottom: 0.25em;
190
+ border-bottom: 1px solid var(--border-color);
191
+ }
192
+ .colamd-document h3 { font-size: 1.3em; }
193
+ .colamd-document strong { color: var(--seed-ink); }
194
+ .colamd-document a {
195
+ color: var(--link-color);
196
+ text-decoration: none;
197
+ border-bottom: 1px solid var(--link-color);
198
+ }
199
+ .colamd-document ul,
200
+ .colamd-document ol { padding-left: 1.75em; }
201
+ .colamd-document li { margin: 0.25em 0; }
202
+ .colamd-document li::marker { color: var(--seed-accent); }
203
+ .colamd-document code {
204
+ color: var(--seed-ink);
205
+ font-family: var(--font-mono);
206
+ font-size: 0.9em;
207
+ background: var(--code-bg);
208
+ border: 1px solid var(--border-color);
209
+ border-radius: 4px;
210
+ padding: 1px 5px;
211
+ }
212
+ .colamd-document pre {
213
+ background: var(--code-block-bg);
214
+ border: 1px solid var(--border-color);
215
+ border-radius: 6px;
216
+ box-shadow: 0 1px 2px rgba(10, 37, 64, 0.06);
217
+ }
218
+ .colamd-document pre code {
219
+ color: var(--code-block-text);
220
+ background: transparent;
221
+ border: 0;
222
+ padding: 0;
223
+ }
224
+ .colamd-document blockquote {
225
+ color: var(--text-secondary);
226
+ background: var(--blockquote-bg);
227
+ border-left: 3px solid var(--blockquote-border);
228
+ }
229
+ .colamd-document mark { background: var(--highlight-bg); }
230
+ .colamd-document table { border-collapse: collapse; width: 100%; }
231
+ .colamd-document th,
232
+ .colamd-document td { border: 1px solid var(--border-color); padding: 8px 12px; }
233
+ .colamd-document th {
234
+ color: var(--seed-ink);
235
+ font-weight: 600;
236
+ background: var(--table-header-bg);
237
+ }
238
+ .colamd-document tbody tr:nth-child(even) td { background: var(--seed-panel); }
239
+ .colamd-document hr { border: 0; border-top: 1px solid var(--border-color); }
240
+ .colamd-document img {
241
+ max-width: 100%;
242
+ border: 1px solid var(--border-color);
243
+ border-radius: 6px;
244
+ box-shadow: 0 1px 2px rgba(10, 37, 64, 0.06);
245
+ }
246
+ .colamd-document svg.pele { background: var(--pele-bg); border-radius: var(--pele-radius); }
247
+
248
+ /* ═══════════════ SECTION 4 — Print ═══════════════ */
249
+
250
+ @media print {
251
+ html,
252
+ body {
253
+ background: var(--bg-color);
254
+ color: var(--text-color);
255
+ -webkit-print-color-adjust: exact;
256
+ print-color-adjust: exact;
257
+ }
258
+ }