Grouping tags in graph view: Can I colour ALL tags?

I really like the local graph view, as it gives me a quicker overview of my connections in this note. I’ve also discovered the option of giving different groups colors, which I use to mark the different folders.
It seems that I can do this to individual tags, as well, but I can’t figure out a way to do this with ALL tags. The reason for this is that the default tan-like colour is a bit too close to the gray of the links that don’t have a note yet.

I’ve tried stuff like tag:"" and path:#, but I can’t figure it out.

Any ideas?
Thanks :slight_smile:

See Autofill graph colors based on tags

If you want to change color for all tags and If you know some basic CSS, you can modify current theme CSS.
My current theme for example has line:

–graph-fill-tag: hsla(144, 100%, 77%, 1);

Change value there.

I’m looking in the CSS file of my theme, but I can’t find any of those lines. Any idea why?

You can also add a particular css snippet to avoid modifying your theme file.

Ok, that’s a good idea. I’m not sure how to start on that though.

How can you add a CSS snippet?

  1. Open Settings (the gear icon on the left panel or Ctrl + , as the the default hotkey)
  2. Select Appearance
  3. Scroll to CSS snippets section and click on the folder icon to “Open snippets folder”. This will open .obsidian/snippets folder inside your vault.
  4. Create a css file there named as you like e.g graph-color-override.css with the css rules you need.
  5. Return to CSS snippets settings, press the “Reload snippets” button and your css file should appear below
  6. Activate your css snippet using the slider checkbox.

Sorry, I replied kind of quick. You have to find something similar in your CSS.
Try looking for a block pertaining to graph (CSS is usually commented by developer) and look for sth like ‘graph-element-color-something:’.

What theme do you use?

I’ve tried this in a snippet, as well as .theme-light .graph-view.color-fill-tag { color: #440154; }
which both turns the tag node black, so that’s a start :slight_smile:

Any idea how to get anything but black though lol?

What theme are you using?

“Minimal” though I just tried turning that off and the same thing happened.

This should work:

(see lines 3019-3022 in your theme)

Edit: Forgive me, this is not for tags… Tags are styled in line 3052 (though due to cascade (I don’t know why) this line does not work uncommented).

Thank you!! I’ll try that out right away, though just out of curiousity, I now have a CSS file as andrezgz recommended with these lines

.theme-light .graph-view.color-fill-tag { color: #00fb00; }

.theme-dark .graph-view.color-fill-tag { color: #00fb00; }

What’s interesting is that it now works in light mode, i.e. the tag nodes now show up as green. In dark mode it does not. Any ideas on that?

I saw in another thread that it was better to use snippets for this since if the theme is updated the edit would be lost. is that correct?

1 Like

Sure thing it’s better to do it with snippets.
Your snippet should work on both modes (dark & light).
I just checked and it works for me. Try reloading the vault (like… did you try rebooting? xd).
A nice theme, by the way. I overlooked it. I use Discordian and recently Yin and Yang on daily basis.
All the best!

Ah, now it works! I had reloaded the program a few times, but whatever, it works now :slight_smile: Thanks for your help!!

1 Like

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