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; +}