How to make some folders hidden

I need to hide some folders

Things I have tried

I tried to use css;

.nav-folder[aria-label="_attachments"],
.nav-folder-title[aria-label="_attachments"] {
  display: none !important;
}

could not make it.
It is hard to believe, while there are so many well crafted features, this simple one is not in place yet :grin:

Try

.nav-folder-title[data-path="_attachments"] {
	display: none;
}

That should hide the ā€œ_attachmentsā€ folder at the root of the vault.

To hide all ā€œ_attachmentsā€ folders, including ones inside other folders, try:

.nav-folder-title[data-path$="\_attachments"] {
	display: none;
}

The difference is the $ before the = sign.


If you don’t mind sharing, I’m curious what you drew from to come up with the version in your question. The two selectors you used do not have aria labels. (This is purely a personal interest related to trying to help folks out with their CSS questions of late. No pressure to say or to even explain why you don’t want to say!)

1 Like