Private mode to hide note content

When I show my vault to others, I don’t want them to see everything — for example, my daily schedule or task lists. Since these files are pinned, they’re easily visible.

To solve this, I created a CSS snippet that enables a private mode, which I can activate when I show my vault to others.

Private Mode ON

Private mode OFF

The CSS code blurs the files , disables mouse clicks , and prevents text selection .

  • The first part of the code applies these effects to all notes that have the property cssclasses with the value PRIVATE.
  • The second part applies the same CSS to items in the Obsidian file explorer whose file path includes the term PATH.

You’ll need to adjust PRIVATE and PATH so they match the notes or folders you want to hide.

The last part of the snippet re-enables mouse clicks only for the collapse icon.

.PRIVATE  {
    filter: blur(5px);
    pointer-events: none;
    user-select: none;
}
.workspace-tabs:has(.PRIVATE) .workspace-tab-header-container,
.workspace-tabs:has(.PRIVATE) .view-header-title {
    pointer-events: none;
    user-select: none;
}
.workspace-tabs:has(.PRIVATE) .workspace-tab-header-inner-title,
.workspace-tabs:has(.PRIVATE) .view-header-title {
    filter: blur(5px);
}




.workspace-leaf-content[data-type="file-explorer"] .tree-item-self[data-path*="PATH"]  {
    filter: blur(5px);
    pointer-events: none;
    user-select: none;
}
.workspace-leaf-content[data-type="file-explorer"] .collapse-icon {
    pointer-events: all;
}
3 Likes

I like it. How do you enable/disable private mode?

I use the MySnippets plugin , which allows me to toggle my CSS snippet for private mode directly from the status bar in Obsidian. Alternatively, I believe there’s also a plugin that lets you assign hotkeys for CSS snippets.

Without community plugins, I think the only option is to use the appearance settings in Obsidian.