Styling internal links with a different color

Under “Files & Links” settings, try switching the toggle for “Use [[wikilinks]]” to on like I have it, because it appears that your [[ ]] wikilinks are converted automatically to []() markdown links, and then retest the snippets.

Actually I don’t think it matters, I’ve disabled mine and it still works on my end.

I have no idea what is going on on your side :man_shrugging: I’m on a desktop Obsidian on Windows, maybe you’re on Mobile or a different OS?

It doesn’t change it either, with the Wikilinks ON.

I’m on a Mac, so maybe that’s an OS issue, but I checked on my iPhone and the issue is still there, so it doesn’t seem to be directly related to the macOS itself, otherwise the iPhone would be different, right?

Both are from Apple, so… I have no idea :man_shrugging:

Ok, it’s working. Here’s what’s happening:

1 - Wikilinks has to be ON
2 - When I make changes to the .css file, even with Wikilinks turned on, the old links I created are not automatically updated so that’s why I wasn’t seeing any changes with your code. Only when I created new links was I able to see the changes
image

So I only needed the small code to make it work:

:root, body, .view-content {
    --link-color: #E7BC39;
    --link-color-hover: #d9ae2c;
  }

Really appreciate your time and help! :raised_hands:

1 Like

Here’s another code I came up with just in case:

.cm-s-obsidian span.cm-hmd-internal-link *,
.cm-s-obsidian span.cm-hmd-internal-link *,
.cm-s-obsidian span.cm-url:has([data-link-path$="md"]),
.cm-s-obsidian span.cm-url:has([data-link-path$="md"]) *,
.cm-s-obsidian span.cm-link:has([data-link-path$="md"]),
.cm-s-obsidian span.cm-link:has([data-link-path$="md"]) *,
.cm-s-obsidian span.cm-link:not(:has(~ .external-link)),
.cm-s-obsidian span.cm-url:not(:has(~ .external-link)),
.cm-s-obsidian span.cm-link:has([data-link-path$="md"]) .cm-underline:hover,
.markdown-rendered .internal-link
{
  color: yellow !important;
}
1 Like

This one doesn’t work. Toggling the Wikilinks option doesn’t change it.
It’s all good, it’s working with that other small code :slight_smile:
Appreciate it! :muscle:

1 Like

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