From 83eb81a86e3efdcfbde3cf9aef158c3e6457bb62 Mon Sep 17 00:00:00 2001 From: ArenaDruid <95113209+ArenaDruid@users.noreply.github.com> Date: Tue, 4 Feb 2025 14:39:10 +0800 Subject: [PATCH] Quartz sync: 2025-02-04 14:39:10 --- content/blog-20250204.md | 2 +- content/test.md | 8 ++++++++ quartz/styles/custom.scss | 23 +++++++++++++++++++++++ 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 content/test.md diff --git a/content/blog-20250204.md b/content/blog-20250204.md index 486e9b0fb..367b2159c 100644 --- a/content/blog-20250204.md +++ b/content/blog-20250204.md @@ -42,7 +42,7 @@ comments: true ## 🛠️ 安装指南 ### 方法一:快速安装(推荐) -1. 下载 [[chinese-italic-kaiti.css]] +1. 下载 chinese-italic-kaiti.css 2. 放入 Obsidian 库的 `.obsidian/snippets/` 目录 3. 启用:设置 → 外观 → CSS 代码片段 → 开启 diff --git a/content/test.md b/content/test.md new file mode 100644 index 000000000..52de6be15 --- /dev/null +++ b/content/test.md @@ -0,0 +1,8 @@ +--- +comments: false +--- + +*纯中文斜体* +_中英文混合斜体 Chinese & English_ +**粗体 _嵌套斜体_** +`代码块不受影响` \ No newline at end of file diff --git a/quartz/styles/custom.scss b/quartz/styles/custom.scss index b0c09dcb9..3df11415f 100644 --- a/quartz/styles/custom.scss +++ b/quartz/styles/custom.scss @@ -1,3 +1,26 @@ @use "./base.scss"; // put your custom CSS here! + +/* 定义中文斜体专用字体 */ +@font-face { + font-family: 'ChineseItalic'; + font-style: italic; + src: local('楷体'), + local('Kaiti SC'), + local('STKaiti'); + unicode-range: U+4E00-9FFF; /* 中文字符范围 */ +} + +/* 智能应用规则 */ +em, .cm-em, i { + font-family: + -apple-system, /* 西文字体栈 */ + BlinkMacSystemFont, + 'Segoe UI', + Roboto, + 'ChineseItalic', /* 中文斜体触发 */ + sans-serif; + + font-style: italic; /* 必须保持斜体状态 */ +} \ No newline at end of file