From 5c89d20d9c5da6fdd2a27569fd131c7abf51490c Mon Sep 17 00:00:00 2001 From: home-PC Date: Thu, 19 Mar 2026 23:02:50 +0800 Subject: [PATCH] vault backup: 2026-03-19 23:02:49 --- .obsidian/appearance.json | 5 ++++- .obsidian/snippets/PDF-DarkMode.css | 14 ++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 .obsidian/snippets/PDF-DarkMode.css diff --git a/.obsidian/appearance.json b/.obsidian/appearance.json index 0245f9c..da2e7bd 100644 --- a/.obsidian/appearance.json +++ b/.obsidian/appearance.json @@ -1,4 +1,7 @@ { "theme": "obsidian", - "accentColor": "#5c82f5" + "accentColor": "#5c82f5", + "enabledCssSnippets": [ + "PDF-DarkMode" + ] } \ No newline at end of file diff --git a/.obsidian/snippets/PDF-DarkMode.css b/.obsidian/snippets/PDF-DarkMode.css new file mode 100644 index 0000000..8bab97c --- /dev/null +++ b/.obsidian/snippets/PDF-DarkMode.css @@ -0,0 +1,14 @@ +/* 针对新版 Obsidian:在深色模式下强制反转 PDF 页面和画布 */ + +.theme-dark .workspace-leaf-content[data-type="pdf"] .page, +.theme-dark .internal-embed[src$=".pdf"] .page, +.theme-dark .pdf-viewer canvas, +.theme-dark .pdf-embed canvas { + filter: invert(100%) hue-rotate(180deg) brightness(85%) contrast(110%) !important; +} + +/* 顺便把 PDF 页面之间的缝隙背景也调暗,防刺眼 */ +.theme-dark .workspace-leaf-content[data-type="pdf"] .view-content, +.theme-dark .pdf-container { + background-color: #1e1e1e !important; +}