Hiding Your Attachment Folder In Obsidian's Outline
A useful little CSS snippet for anyone using Obsidian that wants to hide their attachment folder from their outline.
.nav-folder.mod-root>.nav-folder-children .nav-folder>.nav-folder-title[data-path^="Attachments"],
.nav-folder.mod-root>.nav-folder-children .nav-folder>.nav-folder-title[data-path^="Attachments"] + .nav-folder-children {
display: none;
}
To use:
- Go to the directory
$VAULT/.obsidian/snippets
where$VAULT
is the directory of you vault. If thesnippets
directory doesn’t exist, create it. - Copy the CSS snippet into a new CSS file.
- Open you vault settings and go to Appearance.
- Scroll to the bottom to where you see CSS snippets.
- Click the reload button. You should see the CSS file you’ve just created appear in the list. Turn it on to apply it.
This’ll work if you’ve configured Obsidian to store attachments in a folder called “Attachments” located at the root of your vault, like I do. But I suspect the data-path
attribute holds the folder’s path so you could use whatever CSS attribute selector you need based on how you’ve configured attachments. For example, [data-path*="/Files"]
selector will probably work if you’ve configured attachments to be in folders called “Files” that sits alongside your notes (I haven’t tested this so YMMV).