I would like my internal links to be yellow and my external links to remain blue
Things I have tried
I’m very new to Obsidian, so I’m still not comfortable enough to understand the topics I visited. I installed the Supercharged plugin, as well as the Style Settings plugin.
I’m comfortable with CSS in general, but I don’t know how it works with Obsidian, what to target, where to add the code, etc.
It indeed made some changes, but not what I was trying to achieve.
So using your CSS, all links (internal or external) are now that blue that you picked --link-external-color: blue;
This is the original without CSS
This is after applying your CSS
When I hover over any of the links, the color changes to the original
So my goal would be to have this where internal links to other notes would be yellow and then external links to websites would retain the original lighter blue
I don’t need it to change color when I hover over, though.
Isn’t [markdown](links.md) an internal link, or am I misunderstanding what an internal link is?
Let me see if I can explain what I need
This will be yellow: [Hazel - Change Filename with Clipboard-Text](Hazel%20-%20Change%20Filename%20with%20Clipboard-Text.md)
This will remain the original light blue from the default theme: [https://forum.obsidian.md/t/styling-internal-links-with-a-different-color/71489](https://forum.obsidian.md/t/styling-internal-links-with-a-different-color/71489)
Like this:
Now, the CSS you shared, seems to apply that other blue to all links.
What’s weird is that according to the images you shared, you were able to achieve this on your end, where different colors were applied to different types of links. Do you think it’s something else I need to enable or disable?
I installed the Supercharged plugin and Style Settings plugin, but now I disabled them in case there was a conflict, but nothing changed.
Unfortunately I have no idea why it doesn’t work on your end since on my end it works just fine… maybe there’s a conflict from the theme you have? Or some other plugin?
If you just want to style your internal links and leave the external ones as is, doesn’t the below code work? Just remove the parts with the blue links from my CSS code and only keep the below code instead in your CSS snippet:
/* target both internal WIKI links & MD links in ALL views */
.cm-s-obsidian span.cm-hmd-internal-link,
.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-underline:hover,
.markdown-rendered .internal-link
{
color: yellow;
}
The above only colors internal links on my end, and external ones are left as per the theme.
Maybe try adding !important after the color like this:
color: yellow !important;
If this doesn’t work either, I think it’s best if you go into Obsidian’s developer console (ctrl+shift+i) and investigate the CSS styles to see what selector is forcing the blue color.
No luck…
So weird that this doesn’t work.
I started using Obsidian a few months ago and as a beginner, I don’t even have lots of plugins or customization. So it seems that there’s something in the “core” or something that’s causing this
I’ll just add that the default for internal links are [[wikilinks]]. That is what the --link-color: property covers.
[markdown](internal-links) fall in a gray zone between internal and external links for the custom properties. That is why I mentioned “If you aren’t using internal [markdown](links.md)”.
If you’re comfortable with CSS, try going into Obsidian’s developer console (ctrl+shift+i) and investigate the CSS styles to see what selector is forcing the blue color.
I disabled my plugins and reverted to the default theme, and it works just fine, so it’s not the Obsidian core either.
P.S. I do hope you have enabled your CSS snippet in the Appearance settings window to begin with, because it won’t work if you didn’t enable the snippet in the first place #justsaying