How to change text color of a subfolder?

Things I have tried

I have this code to change only the title color of an individual folder on the explorer tree:

.nav-folder-title[data-path="Work"] {color: #ff1100; !important;}

And it works exactly the way I want, but only for folders on root level.

I have tried this:

.nav-folder-title[data-path="Work/Project1"] {color: #FF00D5; !important;}

And this:

.nav-folder-title[data-path="Work>Project1"] {color: #FF00D5; !important;}

And this:

.nav-folder-title[data-path="Work"/"Project1"] {color: #FF00D5; !important;}

But obviously none work. I have googled, but couldn’t find any information on how to “jump” to a subfolder.

What I’m trying to do

I would like to know what is the code to change the color of an individual subfolder title.


Your example works for me on a Windows platform.

I tried again and closed and reopened Obsidian after reloading the snippet and it worked. For the root level folder, I had only to reload the snippet, not the application, that’s why I thought it wasn’t working.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.