-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy paththeme.css
More file actions
2723 lines (2379 loc) · 99.4 KB
/
Copy paththeme.css
File metadata and controls
2723 lines (2379 loc) · 99.4 KB
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
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
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* ============================================================
Folio — Obsidian Theme
字体: Anthropic Sans / Inter (正文·标题·UI) · JetBrains Mono (代码)
标题自 v1.1.9 起默认无衬线(中英混排更稳);
原衬线社论标题保留为 opt-in: snippets/folio-heading-font-serif.css
色彩: Ivory #FAF9F5 · Slate #141413 · Clay #D97757
============================================================*/
/* ── 字体族(开源平替 + CJK 回退) ── */
body {
--font-text-theme: 'Anthropic Sans', 'Inter', 'Instrument Sans', system-ui, "Segoe UI", Roboto, Helvetica, Arial, "Source Han Sans SC", "Source Han Sans CN", "Noto Sans CJK SC", "思源黑体", "PingFang SC", "Microsoft YaHei", sans-serif;
/* 衬线栈:主题默认不消费(标题走 --font-text-theme),由 snippets/folio-heading-font-serif.css 按需启用 */
--font-heading-theme: 'Anthropic Serif', 'Source Serif 4', 'Source Serif Pro', 'Source Serif', Georgia, "GenRyuMin2 TW", "源流明體月", "GenRyuMin2 TC", "源流明體丹", "GenRyuMin2 JP", "源流明朝", "GenRyuMin", "源流明體", "Source Han Serif SC", "Source Han Serif CN", "Noto Serif CJK SC", "思源宋体", "Songti SC", "STSong", serif;
--font-monospace-theme: 'Anthropic Mono', 'JetBrains Mono', ui-monospace, monospace;
--font-interface-theme: 'Anthropic Sans', 'Instrument Sans', 'Inter', system-ui, "Segoe UI", Roboto, Helvetica, Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
/* ── 圆角(对齐 Obsidian 官方变量,不自造) ── */
/* Obsidian 1.x 已内置 --radius-s/m/l/xl,此处仅确认值 */
--radius-s: 4px; /* inline code, small elements */
--radius-m: 8px; /* buttons, inputs, code blocks */
--radius-l: 16px; /* cards, modals, embeds */
--radius-xl: 24px; /* image hero */
--radius-pill: 100vw; /* tags, toggles */
/* ── 核心组件覆写 ── */
--blockquote-border-thickness: 0px;
--checkbox-radius: 50%;
--checkbox-size: 16px;
--checkbox-border-width: 1.5px;
--checkbox-border-color: rgba(20, 20, 19, 0.2);
--checkbox-border-color-hover: var(--interactive-accent);
--checkbox-color: var(--interactive-accent);
--checkbox-color-hover: var(--interactive-accent);
--checkbox-marker-color: var(--background-primary);
/* ── 过渡(统一速率,不在组件里各写各的) ── */
--anim-fast: 0.15s cubic-bezier(0.215, 0.61, 0.355, 1);
--anim-medium: 0.2s ease;
/* ── 共享 SVG 资源(一处维护) ── */
--quote-icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23b08968'><path d='M14.017 21v-7.391c0-5.704 3.731-9.57 8.983-10.609l.995 2.151c-2.432.917-3.995 3.638-3.995 5.849h4v10h-9.983zm-14.017 0v-7.391c0-5.704 3.748-9.57 9-10.609l.996 2.151c-2.433.917-3.996 3.638-3.996 5.849h3.983v10h-9.983z'/></svg>");
/* Obsidian 官方 logo 几何线稿(轮廓 + 真实切面缝线,源自官方 SVG 路径,作蒙版用 stroke=black) */
--obsidian-gem-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512' fill='none' stroke='black' stroke-width='34' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M382.3 475.6c-3.1 23.4-26 41.6-48.7 35.3-32.4-8.9-69.9-22.8-103.6-25.4l-51.7-4a34 34 0 0 1-22-10.2l-89-91.7a34 34 0 0 1-6.7-37.7s55-121 57.1-127.3c2-6.3 9.6-61.2 14-90.6 1.2-7.9 5-15 11-20.3L248 8.9a34.1 34.1 0 0 1 49.6 4.3L386 125.6a37 37 0 0 1 7.6 22.4c0 21.3 1.8 65 13.6 93.2 11.5 27.3 32.5 57 43.5 71.5a17.3 17.3 0 0 1 1.3 19.2 1494 1494 0 0 1-44.8 70.6c-15 22.3-21.9 49.9-25 73.1z'/%3E%3Cpath d='M278.4 307.8c-19.7-49.4-25.8-86.4-24.5-115.9a171 171 0 0 1 19.4-71c2.3-4.8 4.8-9.5 7.2-14.1 7.1-13.9 14-27 17.6-41.4a96 96 0 0 0-2-54'/%3E%3Cpath d='M188.5 291.3c17.6 42.8 18.8 103-22.6 187'/%3E%3Cpath d='M311.3 315.4c-36-13.4-75.2-9-115 .7'/%3E%3C/svg%3E");
/* ── 标题字号(Obsidian 读取 --h1-size 等来渲染编辑器) ── */
--inline-title-size: 1.75em;
--h1-size: 1.75em;
--h2-size: 1.3em;
--h3-size: 1.15em;
--h4-size: 1.05em;
--h5-size: 1.0em;
--h6-size: 0.92em;
/* ── 间距排版 (Spacing) ── */
--list-spacing: 0.25em; /* 列表项/待办项间距:收紧,使连续列表不显松散(单项内换行仅靠 line-height,无此 margin) */
--p-spacing: 1.2rem; /* 段落间距 */
/* ── Callout 颜色(典雅书卷色板,模式无关) ── */
--callout-color-info: #6A9BCC; /* Sky */
--callout-color-warning: #D4A27F; /* Kraft */
--callout-color-error: #C46686; /* Fig */
--callout-color-success: #788C5D; /* Olive */
--callout-color-clay: #D97757; /* Clay */
--callout-color-slate: #5E5D59; /* Slate Light */
--callout-color-heather: #827DBD; /* Heather */
/* ── 辅助文字层级(页岩灰色系) ── */
--slate-light: #B0AEA5; /* Slate Light — 次要文字、图标 */
/* ── 表格默认间距排版(通透卡片:更大留白)── */
--table-padding-x: 16px;
--table-padding-y: 10px;
--table-header-padding-x: 16px;
--table-header-padding-y: 13px;
--table-line-height: 1.45;
--table-frame-color: rgba(176, 137, 104, 0.5); /* 保留(当前无框,备用) */
--table-border-width: 0px; /* 关掉 Obsidian 默认单元格边框,三线由主题显式绘制 */
/* ── Mermaid 图表字体 ── */
--font-mermaid: var(--font-interface-theme);
/* ── 字体平滑与排版 ── */
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
font-family: var(--font-interface-theme);
font-variant-numeric: lining-nums;
font-feature-settings: "lnum";
}
/* ============================================================
@settings — Folio 可视化配置(Style Settings 插件)
────────────────────────────────────────────────────
设计原则:
1. 主题 token 定义一字不改。Style Settings 通过
body.theme-*.css-settings-manager 注入覆盖,特异性 (0,2,1)
天然压过主题的 body.theme-* (0,1,1),无需自引用 var() hack。
2. 零运行时开销:不引入 color-mix、不加变量层级。
3. 只暴露纯视觉、低耦合项。accent 派生态(hover/selected 等)
不联动 —— 见 STYLE_SETTINGS_TEST.md「已知非联动项」。
============================================================ */
/* @settings
name: Folio
id: folio-theme
settings:
# ─── 强调色 ───
-
id: interactive-accent
title: 强调色(Accent / Clay)
description: 主强调色。改动会联动 checkbox、滑块、active 图标、链接高亮等所有引用 --interactive-accent 的组件。hover 态等派生色不联动。
type: variable-themed-color
format: hex
opacity: false
default-light: '#D97757'
default-dark: '#D97757'
# ─── 标题字号 ───
-
id: inline-title-size
title: Inline Title 字号
type: variable-text
default: '1.75em'
-
id: h1-size
title: H1 字号
type: variable-text
default: '1.75em'
-
id: h2-size
title: H2 字号
type: variable-text
default: '1.3em'
-
id: h3-size
title: H3 字号
type: variable-text
default: '1.15em'
# ─── 圆角 ───
-
id: radius-s
title: 小圆角(inline code / 小元素)
type: variable-text
default: '4px'
-
id: radius-m
title: 中圆角(按钮 / 输入框 / 代码块)
type: variable-text
default: '8px'
-
id: radius-l
title: 大圆角(卡片 / 模态框 / 嵌入)
type: variable-text
default: '16px'
# ─── Callout 色板(典雅书卷色,模式无关) ───
-
id: callout-color-info
title: Callout Info(Sky)
type: variable-color
format: hex
default: '#6A9BCC'
-
id: callout-color-warning
title: Callout Warning(Kraft)
type: variable-color
format: hex
default: '#D4A27F'
-
id: callout-color-error
title: Callout Error(Fig)
type: variable-color
format: hex
default: '#C46686'
-
id: callout-color-success
title: Callout Success(Olive)
type: variable-color
format: hex
default: '#788C5D'
-
id: callout-color-clay
title: Callout Clay
type: variable-color
format: hex
default: '#D97757'
-
id: callout-color-slate
title: Callout Slate
type: variable-color
format: hex
default: '#5E5D59'
-
id: callout-color-heather
title: Callout Heather
type: variable-color
format: hex
default: '#827DBD'
# ─── 间距排版 ───
-
id: p-spacing
title: 段落间距
type: variable-text
default: '1.2rem'
-
id: list-spacing
title: 列表项间距
type: variable-text
default: '0.25em'
-
id: table-padding-x
title: 表格水平内边距
type: variable-text
default: '16px'
-
id: table-padding-y
title: 表格垂直内边距
type: variable-text
default: '10px'
*/
/* ── 亮色模式 ──────────────────────────────────────────────── */
body.theme-light {
background-color: #FAF9F5; /* 窗口 resize 时最先涂的颜色,消除白闪 */
/* 背景层级(从亮到暗)*/
--background-primary: #FAF9F5; /* Ivory Light — 编辑器 */
--background-primary-alt: #F0EEE6; /* Ivory Medium — tab 栏/状态栏 */
--background-secondary: #EBE9E0; /* Ivory Dark — 侧边栏 */
--background-secondary-alt: #E8E6DC; /* Ivory Darker — inline code */
--folio-floating-surface: #FFFDF7; /* 浮层卡片:暖白,逐通道亮于页面,靠阴影抬升 */
--background-modifier-border: rgba(20, 20, 19, 0.08);
--background-modifier-form-field: #FFFFFF;
--background-modifier-form-field-highlighted: #FFF8F0;
--background-modifier-box-shadow: rgba(20, 20, 19, 0.06);
--background-modifier-success: #E8F0E4;
--background-modifier-error: #F5E8E8;
--background-modifier-cover: rgba(250, 249, 245, 0.92);
/* 文字层级 */
--text-normal: #3D3D3A; /* Slate Medium */
--text-muted: #5E5D59; /* Slate Light */
--text-faint: var(--slate-light); /* Slate Light — 次要文字 */
--text-on-accent: #FAF9F5;
--text-on-accent-inverted: #FAF9F5;
--text-error: #A63D2F;
--text-success: #5A7A3A;
--text-highlight-bg: rgba(217, 119, 87, 0.15);
--text-accent: #D97757; /* Clay */
--text-accent-hover: #C6613F; /* Accent */
/* 强调色 */
--interactive-accent: #D97757;
--interactive-accent-hover:#C6613F;
--interactive-accent-rgb: 217, 119, 87;
/* Obsidian 内部 focus/选中用 --color-accent,不设则默认蓝 */
--color-accent: #D97757;
--color-accent-1: rgba(217, 119, 87, 0.15);
--color-accent-2: rgba(217, 119, 87, 0.08);
/* 标题颜色 */
--h1-color: #141413;
--h2-color: #141413;
--h3-color: #141413;
--h4-color: #1A1A18;
--h5-color: #3D3D3A;
--h6-color: #5E5D59;
/* 导航 */
--nav-item-background-hover: rgba(217, 119, 87, 0.08);
--nav-item-background-active: rgba(217, 119, 87, 0.14);
--nav-item-background-selected: rgba(217, 119, 87, 0.14);
--nav-item-color: #5E5D59;
--nav-item-color-hover: #141413;
--nav-item-color-active: #D97757;
--nav-item-color-selected: #D97757;
/* 图标 */
--icon-color: #8A8985;
--icon-color-hover: #5E5D59;
--icon-color-active: #D97757;
--icon-color-focused:#D97757;
/* 标签页(官方变量,由 Obsidian 内部 CSS 读取并渲染) */
--tab-text-color-focused-active: #141413;
--tab-text-color-focused-active-current: #D97757;
--tab-background-active: var(--background-primary);
--tab-outline-color: #E2E0D7; /* 实色描边,避免 rgba 在弧线处叠加变粗 */
--tab-outline-width: 1px;
/* 滑块(官方变量) */
--slider-track-background: #D4D2C9;
--slider-track-height: 4px;
--slider-thumb-border-color: var(--background-primary);
--slider-thumb-border-width: 2px;
--slider-thumb-height: 16px;
--slider-thumb-width: 16px;
--slider-thumb-radius: 50%;
/* 标签(.tag 规则实际消费的 token) */
--tag-background: rgba(217, 119, 87, 0.10);
--tag-background-hover: rgba(217, 119, 87, 0.18);
--tag-color: #A47665; /* 较深陶土文字 */
--tag-color-hover: #8C6051;
/* 滚动条 */
--scrollbar-bg: #EBE9E0;
--scrollbar-thumb-bg: #D4D2C9;
--scrollbar-active-thumb-bg: #D97757;
/* 杂项 */
--highlight-mix-blend-mode: darken;
--divider-color: rgba(20, 20, 19, 0.08);
--prompt-border-color: rgba(20, 20, 19, 0.08);
/* 表格(官方变量 + 强制禁用交替效果) */
--table-column-alt-background: transparent;
--table-row-alt-background: transparent;
--table-row-background-hover: rgba(217, 119, 87, 0.06); /* 悬停:淡陶土色 */
--table-rule: rgba(20, 20, 19, 0.68); /* 三线颜色(比纯文字色略柔) */
--tooltip-bg: #141413;
--tooltip-color: #FAF9F5;
/* 文字色微染背景(替代 color-mix 运行时计算) */
--bg-text-tint: rgba(61, 61, 58, 0.08);
/* 阴影体系(统一为完整声明,而非单层颜色) */
--shadow-subtle: 0 1px 3px rgba(20, 20, 19, 0.06);
--shadow-medium: 0 4px 12px rgba(20, 20, 19, 0.08);
--shadow-large: 0 8px 24px rgba(20, 20, 19, 0.10);
--shadow-modal: 0 16px 48px rgba(20, 20, 19, 0.12), 0 4px 16px rgba(20, 20, 19, 0.08);
/* 语法高亮色板 (暖调书卷风格) */
--code-keyword: #C6613F; /* Clay 深色变体 - 关键字 */
--code-string: #5A7A3A; /* Olive 深色 - 字符串 */
--code-number: #A63D2F; /* Fig 深色 - 数字 */
--code-comment: #8A8985; /* Slate Faint - 注释 */
--code-function: #4A7AA8; /* Sky 深色 - 函数 */
--code-type: #6E6AA8; /* Heather 深色 - 类型 */
--code-variable: #141413; /* Slate Dark - 变量 */
--code-property: #3D3D3A; /* Slate Medium - 属性 */
--code-operator: #5E5D59; /* Slate Light - 运算符 */
}
/* ── 暗色模式 ──────────────────────────────────────────────── */
body.theme-dark {
background-color: #1A1A18; /* 窗口 resize 时最先涂的颜色,消除白闪 */
--background-primary: #1A1A18;
--background-primary-alt: #1E1E1C;
--background-secondary: #141413;
--background-secondary-alt: #111110;
--folio-floating-surface: #242422; /* 暗色浮层:比页面更亮一档,制造抬升 */
--background-modifier-border: rgba(250, 249, 245, 0.08);
--background-modifier-form-field: #242422;
--background-modifier-form-field-highlighted: #2A2720;
--background-modifier-box-shadow: rgba(0, 0, 0, 0.3);
--background-modifier-success: #1B2E1B;
--background-modifier-error: #2E1B1B;
--background-modifier-cover: rgba(26, 26, 24, 0.92);
--text-normal: rgba(250, 249, 245, 0.87);
--text-muted: rgba(250, 249, 245, 0.62);
--text-faint: rgba(250, 249, 245, 0.42);
--text-on-accent: #FAF9F5;
--text-on-accent-inverted: #1A1A18;
--text-error: #E07060;
--text-success: #7AAF5A;
--text-highlight-bg: rgba(217, 119, 87, 0.25);
--text-accent: #D97757;
--text-accent-hover: #E8916A;
--interactive-accent: #D97757;
--interactive-accent-hover: #E8916A;
--interactive-accent-rgb: 217, 119, 87;
--color-accent: #D97757;
--color-accent-1: rgba(217, 119, 87, 0.2);
--color-accent-2: rgba(217, 119, 87, 0.1);
--h1-color: #FAF9F5;
--h2-color: #FAF9F5;
--h3-color: #FAF9F5;
--h4-color: rgba(250, 249, 245, 0.90);
--h5-color: rgba(250, 249, 245, 0.80);
--h6-color: rgba(250, 249, 245, 0.60);
--nav-item-background-hover: rgba(217, 119, 87, 0.10);
--nav-item-background-active: rgba(217, 119, 87, 0.16);
--nav-item-background-selected: rgba(217, 119, 87, 0.16);
--nav-item-color: rgba(250, 249, 245, 0.60);
--nav-item-color-hover: rgba(250, 249, 245, 0.85);
--nav-item-color-active: #D97757;
--nav-item-color-selected: #D97757;
--icon-color: rgba(250, 249, 245, 0.40);
--icon-color-hover: rgba(250, 249, 245, 0.60);
--icon-color-active: #D97757;
--icon-color-focused:#D97757;
--tab-text-color-focused-active: rgba(250, 249, 245, 0.85);
--tab-text-color-focused-active-current: #D97757;
--tab-background-active: var(--background-primary);
--tab-outline-color: #2A2A27; /* 实色描边,避免 rgba 在弧线处叠加变粗 */
--tab-outline-width: 1px;
/* 滑块(官方变量) */
--slider-track-background: #333331;
--slider-track-height: 4px;
--slider-thumb-border-color: var(--background-primary);
--slider-thumb-border-width: 2px;
--slider-thumb-height: 16px;
--slider-thumb-width: 16px;
--slider-thumb-radius: 50%;
--tag-background: rgba(217, 119, 87, 0.12);
--tag-background-hover: rgba(217, 119, 87, 0.20);
--tag-color: #D9A08C; /* 浅陶土文字,暗底可读(≈7.7:1) */
--tag-color-hover: #E9B7A4;
/* 复选框边框:body 里的深色描边在暗底上不可见,换象牙描边 */
--checkbox-border-color: rgba(250, 249, 245, 0.25);
--scrollbar-bg: #1A1A18;
--scrollbar-thumb-bg: #333331;
--scrollbar-active-thumb-bg: #D97757;
--highlight-mix-blend-mode: screen;
--divider-color: rgba(250, 249, 245, 0.08);
--prompt-border-color: rgba(250, 249, 245, 0.08);
--tooltip-bg: #FAF9F5;
--tooltip-color: #141413;
--bg-text-tint: rgba(250, 249, 245, 0.07);
/* 表格(官方变量 + 强制禁用交替效果) */
--table-column-alt-background: transparent;
--table-row-alt-background: transparent;
--table-row-background-hover: rgba(217, 119, 87, 0.10); /* 悬停:淡陶土色 */
--table-rule: rgba(250, 249, 245, 0.62); /* 三线颜色(暗色:柔化的浅色)*/
/* 阴影体系(统一为完整声明,而非单层颜色) */
--shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.15);
--shadow-medium: 0 4px 12px rgba(0, 0, 0, 0.20);
--shadow-large: 0 8px 24px rgba(0, 0, 0, 0.25);
--shadow-modal: 0 16px 48px rgba(0, 0, 0, 0.30), 0 4px 16px rgba(0, 0, 0, 0.20);
/* 语法高亮色板 (暖调书卷风格) */
--code-keyword: #E8916A; /* Accent 浅色变体 - 关键字 */
--code-string: #7AAF5A; /* Olive 浅色 - 字符串 */
--code-number: #E07060; /* Fig 浅色 - 数字 */
--code-comment: #706F6A; /* Slate Faint 暗色 - 注释 */
--code-function: #7CB3E6; /* Sky 浅色 - 函数 */
--code-type: #9E9AD6; /* Heather 浅色 - 类型 */
--code-variable: rgba(250, 249, 245, 0.87); /* Ivory - 变量 */
--code-property: rgba(250, 249, 245, 0.75); /* Ivory Medium - 属性 */
--code-operator: rgba(250, 249, 245, 0.60); /* Ivory Light - 运算符 */
}
/* ════════════════════════════════════════════════════════════
TYPOGRAPHY
════════════════════════════════════════════════════════════ */
/* ── 标题排版设计(高度契合典雅社论风格的衬线标题) ── */
/* 基础 font-family,一次性声明 */
.markdown-rendered h1,
.markdown-rendered h2,
.markdown-rendered h3,
.markdown-rendered h4,
.markdown-rendered h5,
.inline-title {
font-family: var(--font-text-theme) !important;
}
.markdown-rendered h1 {
font-weight: 700;
line-height: 1.1; letter-spacing: -0.025em;
color: var(--h1-color);
margin-top: 2.5em; margin-bottom: 0.6em; /* 文中 H1 与 H2 同级留白,不再贴死上文 */
}
/* 文档顶部(紧随标题区/首个内容块)的 H1 不需要大间距 */
.markdown-preview-sizer > .mod-header + div > h1,
.markdown-preview-sizer > div:first-child > h1 {
margin-top: 0;
}
.inline-title {
font-weight: 700;
line-height: 1.1; letter-spacing: -0.025em;
color: var(--h1-color);
}
.markdown-rendered h2 {
font-weight: 600;
line-height: 1.15; letter-spacing: -0.02em;
color: var(--h2-color);
margin-top: 2.5em; margin-bottom: 0.75em;
}
.markdown-rendered h3 {
font-weight: 600;
line-height: 1.2; letter-spacing: -0.01em;
color: var(--h3-color);
margin-top: 2em; margin-bottom: 0.35em;
}
.markdown-rendered h4 {
font-weight: 600;
line-height: 1.25;
color: var(--h4-color);
margin-top: 1.5em; margin-bottom: 0.3em;
}
.markdown-rendered h5 {
font-weight: 600;
line-height: 1.3; letter-spacing: 0.02em;
color: var(--h5-color);
margin-top: 1.5em; margin-bottom: 0.3em;
}
.markdown-rendered h6 {
font-family: var(--font-text-theme) !important;
font-weight: 600;
line-height: 1.4; letter-spacing: 0.09em;
text-transform: uppercase;
color: var(--h6-color);
margin-top: 1.5em; margin-bottom: 0.3em;
}
/* 标题连续出现时缩小间距(div.el-h* 是兄弟,h* 在 div 内部)
:where 兜底覆盖任意级别相邻(含跳级如 h2→h4),零特异性,下面的精调规则优先 */
.markdown-rendered :where(.el-h1, .el-h2, .el-h3, .el-h4, .el-h5, .el-h6) + :where(.el-h1, .el-h2, .el-h3, .el-h4, .el-h5, .el-h6) > :where(h1, h2, h3, h4, h5, h6) { margin-top: 0.8em; }
.markdown-rendered div.el-h1 + div.el-h2 > h2 { margin-top: 1.0em; }
.markdown-rendered div.el-h2 + div.el-h3 > h3 { margin-top: 0.8em; }
.markdown-rendered div.el-h3 + div.el-h4 > h4 { margin-top: 0.5em; }
/* Live Preview 行容器 — font-size 由 --h*-size 变量统一控制,此处不再硬写 */
.HyperMD-header-1,
.cm-header-1 {
font-family: var(--font-text-theme) !important;
font-weight: 700; letter-spacing: -0.025em;
}
.HyperMD-header-2,
.cm-header-2 {
font-family: var(--font-text-theme) !important;
font-weight: 600; letter-spacing: -0.02em;
}
.HyperMD-header-3,
.cm-header-3 {
font-family: var(--font-text-theme) !important;
font-weight: 600;
}
.HyperMD-header-4,
.cm-header-4,
.HyperMD-header-5,
.cm-header-5 {
font-family: var(--font-text-theme) !important;
font-weight: 600;
}
.HyperMD-header-6,
.cm-header-6 {
font-family: var(--font-text-theme) !important;
font-weight: 600; text-transform: uppercase; letter-spacing: 0.09em;
}
/* ── 正文排版设计(排除 codeblock 和 heading 行) ── */
.cm-line:not(.HyperMD-codeblock):not(.HyperMD-header),
.markdown-rendered p,
.markdown-rendered li,
.markdown-rendered dd {
font-family: var(--font-text-theme);
line-height: 1.65;
font-size: 1.0625em; /* 17px (精细化社论字号,16px * 1.0625 = 17px) */
}
/* 区分段落间距与换行间距 */
.markdown-rendered p {
margin-bottom: var(--p-spacing, 1.2em);
}
/* 区分不同列表项之间的间距 (收紧,与段落间距拉开差距) */
.markdown-rendered li {
margin-bottom: var(--list-spacing, 0.25em);
}
/* 嵌套/松散列表:上面的 1.0625em 会随层级复利放大(li li、li>p 逐层相乘),重置回父级字号 */
.markdown-rendered li li,
.markdown-rendered li p {
font-size: 1em;
}
.markdown-rendered ul,
.markdown-rendered ol {
margin-block: 0.4em;
}
.markdown-rendered li > p {
margin-bottom: 0.15em;
}
.markdown-source-view.mod-cm6 .cm-line.HyperMD-list-line {
padding-bottom: var(--list-spacing, 0.25em) !important;
}
/* 内容区粗体/斜体 — 用 .markdown-rendered 约束,不影响 UI */
.markdown-rendered strong,
.markdown-source-view .cm-strong { font-weight: 700; }
.markdown-rendered em,
.markdown-source-view .cm-em { font-style: italic; }
/* ── 链接(仅内容区,不干扰侧边栏等 UI 链接) ── */
/* 方案 A:隐匿修饰线(Ghost Underline)
核心设计哲学:
1. 静态克制:完全融入上下文环境(自动继承文字颜色,下划线自带 40% 透明度)
2. 交互清晰:触碰时给予强烈的视觉反馈(统一亮起主题陶土色)
3. 极简纯净:彻底清除 Obsidian 原生附带的杂乱图标和背景
*/
.markdown-rendered a,
.markdown-source-view.mod-cm6 a,
.cm-link,
.cm-url,
.internal-link,
.external-link,
.markdown-source-view.mod-cm6 .cm-hmd-internal-link {
color: inherit !important;
text-decoration: underline !important;
text-decoration-color: color-mix(in srgb, currentColor 40%, transparent) !important;
text-decoration-thickness: 1px !important;
text-underline-offset: 4px !important;
text-decoration-skip-ink: auto !important;
background-color: transparent !important;
background-image: none !important;
padding: 0 !important;
margin: 0 !important;
transition: color var(--anim-medium), text-decoration-color var(--anim-medium);
}
.markdown-rendered a:hover,
.markdown-source-view.mod-cm6 a:hover,
.cm-link:hover,
.internal-link:hover,
.external-link:hover,
.markdown-source-view.mod-cm6 .cm-hmd-internal-link:hover {
color: var(--text-accent) !important;
text-decoration-color: var(--text-accent) !important;
}
/* 标签胶囊与脚注序号不是"链接"视觉语言,豁免上面的鬼影下划线 */
a.tag,
.markdown-rendered a.tag,
.footnote-ref a,
.footnote-link,
.footnote-backref {
text-decoration: none !important;
}
/* ── 引用块 ── */
/* ── 阅读模式 ── */
.markdown-rendered blockquote {
position: relative;
border-left: none !important;
background: transparent !important;
padding: 0 0 0 28px !important;
margin: 1.5em 0;
font-style: normal;
color: var(--text-muted);
}
/* 小巧精致的设计感引号 SVG */
.markdown-rendered blockquote::before {
content: "";
position: absolute;
left: 0;
top: 4px;
width: 14px;
height: 14px;
opacity: 0.45;
background-image: var(--quote-icon);
background-size: contain;
background-repeat: no-repeat;
pointer-events: none;
}
/* 字号/行高不再缩小,与编辑模式(正文 17px)观感对齐 */
.markdown-rendered blockquote p {
margin-bottom: 0;
}
/* ── 实时预览模式 (Live Preview) ── */
.markdown-source-view.mod-cm6 .HyperMD-quote {
border-left: none !important;
background: transparent !important;
font-style: normal !important;
color: var(--text-muted) !important;
}
/* 彻底消灭原生的左侧实线! */
.markdown-source-view.mod-cm6 .cm-blockquote-border {
display: none !important;
}
/* 将原本的 > 符号伪装成小巧的设计感引号 */
.markdown-source-view.mod-cm6 .cm-formatting-quote {
color: transparent !important;
position: relative;
display: inline-block;
width: 28px; /* 与阅读模式的 28px padding 保持完美一致 */
}
.markdown-source-view.mod-cm6 .cm-formatting-quote::before {
content: "";
position: absolute;
left: 0;
top: 4px;
width: 14px;
height: 14px;
opacity: 0.45;
background-image: var(--quote-icon);
background-size: contain;
background-repeat: no-repeat;
pointer-events: none;
}
/* 核心魔法:如果当前行是引用块,且上一行也是引用块,则隐藏当前行的引号图标。
这样就能把多行引用在 Live Preview 中视觉上合并成一个完整的引用块!*/
.cm-line.HyperMD-quote + .cm-line.HyperMD-quote .cm-formatting-quote::before {
display: none !important;
}
/* Callout 豁免:callout 底层语法也是 blockquote,点击展开源码时其 `>` 行
同样带 HyperMD-quote,会被上面的引号伪装误伤(冒出引号图标 + 透明占位块)。
标题行特有 HyperMD-callout class——去掉图标、恢复 `>` 可见,编辑时一目了然 */
.markdown-source-view.mod-cm6 .HyperMD-callout .cm-formatting-quote::before {
display: none !important;
}
.markdown-source-view.mod-cm6 .HyperMD-callout .cm-formatting-quote {
color: var(--text-faint) !important;
width: auto;
}
/* 紧随标题行的内容行同样恢复 `>`(内容行没有专属 class,用相邻链覆盖常见深度) */
.markdown-source-view.mod-cm6 .HyperMD-callout + .HyperMD-quote .cm-formatting-quote,
.markdown-source-view.mod-cm6 .HyperMD-callout + .HyperMD-quote + .HyperMD-quote .cm-formatting-quote,
.markdown-source-view.mod-cm6 .HyperMD-callout + .HyperMD-quote + .HyperMD-quote + .HyperMD-quote .cm-formatting-quote,
.markdown-source-view.mod-cm6 .HyperMD-callout + .HyperMD-quote + .HyperMD-quote + .HyperMD-quote + .HyperMD-quote .cm-formatting-quote,
.markdown-source-view.mod-cm6 .HyperMD-callout + .HyperMD-quote + .HyperMD-quote + .HyperMD-quote + .HyperMD-quote + .HyperMD-quote .cm-formatting-quote {
color: var(--text-faint) !important;
width: auto;
}
/* ── 代码 ── */
/* 行内代码(编辑器 + 阅读模式统一) */
.cm-inline-code,
.cm-s-obsidian .cm-inline-code,
.markdown-rendered code {
font-family: var(--font-monospace-theme);
background: var(--background-secondary-alt);
border: 1px solid var(--background-modifier-border);
border-radius: var(--radius-s);
padding: 2px 6px;
font-size: 0.85em;
color: var(--text-normal);
}
/* 代码块 (阅读视图 & 渲染的嵌入代码块) */
.markdown-rendered pre {
font-family: var(--font-monospace-theme);
background: var(--background-primary-alt);
border: 1px solid var(--background-modifier-border);
border-radius: var(--radius-m);
padding: 18px 20px;
line-height: 1.6;
font-size: 0.875em;
}
/* 编辑视图 (Live Preview) 中的代码块行 */
.HyperMD-codeblock {
font-family: var(--font-monospace-theme);
background: var(--background-primary-alt);
font-size: 0.875em;
line-height: 1.6;
padding-left: 20px !important;
padding-right: 20px !important;
border-left: 1px solid var(--background-modifier-border) !important;
border-right: 1px solid var(--background-modifier-border) !important;
border-top: none !important;
border-bottom: none !important;
border-radius: 0 !important;
box-shadow: none !important;
}
/* 代码块起始行 */
.HyperMD-codeblock-begin {
border-top: 1px solid var(--background-modifier-border) !important;
border-top-left-radius: var(--radius-m) !important;
border-top-right-radius: var(--radius-m) !important;
padding-top: 18px !important;
}
/* 代码块结束行 */
.HyperMD-codeblock-end {
border-bottom: 1px solid var(--background-modifier-border) !important;
border-bottom-left-radius: var(--radius-m) !important;
border-bottom-right-radius: var(--radius-m) !important;
padding-bottom: 18px !important;
}
/* ── 语法高亮映射 (CodeMirror 6 Editor & Prism.js Reader) ── */
/* 关键字 */
.cm-keyword,
.token.keyword {
color: var(--code-keyword) !important;
font-weight: 600;
}
/* 字符串 */
.cm-string,
.token.string {
color: var(--code-string) !important;
}
/* 数字与常量 */
.cm-number,
.cm-atom,
.token.number,
.token.boolean,
.token.constant {
color: var(--code-number) !important;
}
/* 注释 */
.cm-comment,
.token.comment {
color: var(--code-comment) !important;
font-style: italic;
}
/* 函数名 */
.cm-def,
.token.function {
color: var(--code-function) !important;
}
/* 类型与类名 */
.cm-type,
.token.class-name,
.token.type {
color: var(--code-type) !important;
}
/* 属性名 */
.cm-property,
.token.property,
.token.attr-name {
color: var(--code-property) !important;
}
/* 运算符与标点 */
.cm-operator,
.cm-punctuation,
.token.operator,
.token.punctuation {
color: var(--code-operator) !important;
}
/* 变量 */
.cm-variable,
.token.variable {
color: var(--code-variable) !important;
}
/* ── 列表 ── */
.markdown-rendered ul li::marker,
.markdown-rendered ol li::marker {
color: var(--interactive-accent);
}
/* Live Preview 列表标记(不用 !important,直接用足够的选择器特异性) */
.markdown-source-view .cm-formatting-list-ol,
.markdown-source-view .cm-formatting-list-ul {
color: var(--interactive-accent);
}
/* ── 分隔线 ── */
hr,
.markdown-rendered hr,
.HyperMD-hr {
border: none;
height: 1px;
background: var(--background-modifier-border);
margin: 48px 0;
}
/* ── 标签 ── */
.tag,
.cm-hashtag {
background: var(--tag-background); /* 极轻微的陶土底色 */
color: var(--tag-color); /* 陶土文字色,token 分模式取值保证可读性 */
border: none; /* 彻底去除边框 */
border-radius: var(--radius-pill); /* 恢复标准的胶囊圆角 */
padding: 3px 10px;
font-size: 0.8em;
font-weight: 500;
font-family: var(--font-interface-theme);
letter-spacing: 0.02em;
line-height: 1.4;
vertical-align: baseline;
}
/* 渲染模式下强制文字颜色一致 */
.markdown-rendered a.tag,
.markdown-rendered td a.tag,
.markdown-rendered th a.tag,
.markdown-rendered li a.tag,
.markdown-rendered blockquote a.tag,
a.tag {
color: var(--tag-color) !important;
}
.tag:hover {
background: var(--tag-background-hover); /* 悬停时底色稍微加深一点点 */
color: var(--tag-color-hover) !important; /* 悬停时文字对比更强一点 */
}
/* Live Preview 标签同样有 hover 反馈(与阅读模式一致)。
胶囊拆成 begin/end 两半,悬停任一半时用兄弟选择器点亮另一半 */
.cm-hashtag:hover,
.cm-hashtag-begin:hover + .cm-hashtag-end,
.cm-hashtag-begin:has(+ .cm-hashtag-end:hover) {
background: var(--tag-background-hover);
color: var(--tag-color-hover);
}
/* Live Preview:完美的胶囊拼接(因为没有边框,所以拼接毫无破绽) */
.cm-hashtag.cm-hashtag-begin {
border-radius: var(--radius-pill) 0 0 var(--radius-pill);
padding-left: 10px; padding-right: 1px;
}
.cm-hashtag.cm-hashtag-end {
border-radius: 0 var(--radius-pill) var(--radius-pill) 0;
padding-left: 1px; padding-right: 10px;
}
/* ── 复选框(Circle Minimal · 圆形极简风) ── */
.task-list-item-checkbox {
appearance: none;
-webkit-appearance: none;
width: var(--checkbox-size);
height: var(--checkbox-size);
border: var(--checkbox-border-width) solid var(--checkbox-border-color);
border-radius: var(--checkbox-radius);
background: transparent;
cursor: pointer;
/* 弹性回弹:勾选时填充"落定"(reduced-motion 下由全局规则禁用) */
transition: background-color 0.22s cubic-bezier(0.34, 1.4, 0.64, 1),
border-color 0.22s cubic-bezier(0.34, 1.4, 0.64, 1);
vertical-align: middle;
position: relative;
}
.task-list-item-checkbox:hover {
border-color: var(--checkbox-border-color-hover);
}
.task-list-item-checkbox:checked {
background: var(--checkbox-color);
border-color: var(--checkbox-color);
}
/* 极简短勾 — 必须走 Obsidian 原生 ::after mask 通道:
原生对勾以 ::after 蒙版绘制在最上层,input 的 background-image
会被它整个盖住(此前改勾"不生效"的根因),故在同一通道替换造型 */
.task-list-item-checkbox:checked::after {
content: '';
position: absolute;
inset: 0;
width: 100%;
height: 100%;
background-color: var(--checkbox-marker-color);
-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M10.6 6 L7.2 9.9 L5.4 8.1' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M10.6 6 L7.2 9.9 L5.4 8.1' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
-webkit-mask-size: 100%;
mask-size: 100%;
-webkit-mask-position: center;
mask-position: center;
-webkit-mask-repeat: no-repeat;
mask-repeat: no-repeat;