I have a handful of custom CSS snippets that I like to activate and deactivate with keyboard shortcuts. As far as I can tell, Obsidian’s CSS snippets in the Appearance settings are currently either enabled or disabled, with no way to quickly toggle them without manually navigating to the settings.
The way I’ve gotten around this is to permanently enable the relevant CSS snippets, but edit the content of the relevant CSS files in the background. So, when I want to toggle the styling in one of my CSS snippets:
- I type a keyboard shortcut.
- This shortcut triggers a macro that writes or deletes CSS from the corresponding CSS snippet file. (This automation runs outside of Obsidian.)
- Obsidian recognizes that the CSS snippet file has changed, and automatically reads and applies the new styling, achieving the outcome I want.
I just installed 0.11.1, and this trick no longer seems to work. I can make whatever changes I like to the CSS files for enabled CSS snippets in Obsidian and nothing happens. This worked for me for versions of Obsidian <= 0.11.0.
Steps to reproduce
Enable a CSS snippet in the Appearance settings.
Find the corresponding CSS file and open it in an external text editor.
Enter the following CSS:
Save the file.
The status bar should disappear in the Obsidian window.
No change to the Obsidian window.
- Operating system: macOS 11.2.1
- Obsidian version: 0.11.1
Currently, I’m using the legacy “Apply custom CSS” setting as a workaround. Obsidian 0.11.1 still automatically recognizes and applies changes to the legacy obsidian.css file.
You could also frame this bug report as a feature request: I’d love for a built-in way to enable and disable individual CSS snippets via keyboard shortcuts.