Change link color but not button color

First, search the help docs and this forum. Maybe your question has been answered! The debugging steps can help, too. Still stuck? Delete this line and proceed.

What I’m trying to do

The link color by default is purple, my color picker shows it is #8b6cef

I can change it in Settings | Appearance | Accent Color BUT if I do it also changes the interface buttons/sliders/etc.

How can I change JUST the link color and not the interface color?

Things I have tried

Do you want to edit the color of internal links (links to other notes), external links, or both?

Depending on the theme you are using, there may be options in Style Settings, otherwise CSS. This should do it →

body {
  --link-color: var(--color-orange);
  --link-external-color: var(--color-yellow);
}

I set the color as var to show it, but you can change it to a hex.

Screenshot 2023-03-25 at 15.22.40

1 Like

That snippet worked great for me. Thanks so much @ariehen.

Not that it matters now but just for completeness sake. I did forget to mention I wanted to color the links in a dataview which your css (–link-color) does fine for me. I have it pulling characters etc for writing.

I am using the default theme in dark mode but with a lot of custom snippets including a dataview one (with color changes) from this post: css-stylesheet-for-dataview-table and wanted to make the color of the links fit better with what I chose as a background.

Example

Before:
image

Now:
image

I realize there are 2 modified columns, I am still leaning dataview and templater and other things like that.

Thanks again!

1 Like

Glad it works for you!

Thanks for the follow up. Always interesting to see what people are doing with Obsidian. No judgment on the double modified column :joy: You’ll get it!

Oh, and if you only wanted to target the links in dataview, this should work →

body :is(.block-language-dataview) {
  --link-color: var(--color-orange);
}

Screenshot 2023-03-26 at 4.23.18

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