Performance issues - PDFs viewing
Is the bug present when using the default Obsidian theme?
No
Is the bug present when snippets and plugins are disabled?
Yes
Minimal theme version
7.7.19
Describe the bug
I really like the minimal theme, but I found that compared to the default theme the PDF viewer is very sluggish. This is true also for embedded PDFs.
I installed the "style settings" plugin and deactivated the "Invert PDFs in dark mode" and "Blend PDFs in light mode" options, and set the PDF page style to "shadow" instead of "seamless" but nothing seems to work. I also have hardware acceleration activated.
Debug info
SYSTEM INFO: Obsidian version: v1.8.9 Installer version: v1.8.3 Operating system: Windows 11 Home 10.0.26100 Login status: logged in Language: en Catalyst license: none Insider build toggle: off Live preview: on Base theme: dark Community theme: Minimal v7.7.19 Snippets enabled: 0 Restricted mode: off Plugins installed: 18 Plugins enabled: 10 1: Dataview v0.5.68 2: Kanban v2.0.51 3: Better Word Count v0.10.1 4: Calendar v1.5.10 5: Git v2.32.1 6: Zotero Integration v3.2.1 7: Minimal Theme Settings v8.1.1 8: Mousewheel Image zoom v1.0.23 9: Paste image rename v1.6.1 10: Style Settings v1.0.9
RECOMMENDATIONS: Custom theme and snippets: for cosmetic issues, please first try updating your theme and disabling your snippets. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community theme and snippets. Community plugins: for bugs, please first try updating all your plugins to latest. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community plugins.
The Obsidian 1.8 version has internally restructured the PDF viewer component. The specific changes include:
- Class name change: The previously used class name pdf-viewer has been uniformly adjusted to pdfViewer format.
- CSS selector failure: The dark mode style rules in the Minimal theme were written based on the old class name.
- Version compatibility issues: The theme update failed to keep pace with the API changes in the Obsidian core in a timely manner.
This kind of class naming convention change is a common phenomenon in software iteration, usually to maintain code consistency or to follow new development standards.
Solution
There are currently two solutions available:
Temporary Solution (Manual Modification)
- Open the Obsidian settings panel.
- Go to "Appearance" → "Themes" settings.
- Click on the theme folder icon.
- Locate and open the theme.css file in the Minimal theme directory.
- Use the find and replace function of the text editor to replace all instances of pdf-viewer with pdfViewer.
- Save the file and reload Obsidian.