obsidian-minimal
obsidian-minimal copied to clipboard
Differentiate between internal and external links
Is your feature request related to a problem? Please describe. It's helpful for me to differentiate between an internal link (knowledge that I actively synthesize) and an external link (information that I haven't yet incorporate into my knowledge base.
Describe the solution you'd like Currently the Links setting in Style Settings only can change link color which govern both Internal and External Links. It'd be great if Internal, External and Unresolved link settings are separated.
The reason I haven't done it yet is that it squares the number of scenarios to account for with link color, specifically when it comes to handling links inside of headings, italics, bolded text, unresolved/resolved links, etc. which themselves can have their own colors — you get in a kind of specificity arms race where there is no "right" answer, some people would want the link color to "win", whereas some people would want the formatted text color to "win".
My best recommendation in the near term is to use a snippet because you can configure it exactly as you prefer You can see the current CSS for external vs. internal here: https://github.com/kepano/obsidian-minimal/blob/master/src/scss/features/link-underline.scss
Thanks a lot for your reply! What I did for my case is that I use CSS highlight snippets (copied elsewhere, I don't know how to code) to differentiate between different heading levels, which allows the text color of links to be visible even if they're at heading level.
Like this
If you can support having heading colored highlight instead of colored text that'd be great. Currently I have to tweak quite a bit manually and I'm always nervous that it'll break one day.
In case it helps anyone, I had the same issue. I solved it by adding a custom css snippet (custom.css) to the vault, loading it via settings → appearance → CSS snippets and pasting the following code:
body{ --link-unresolved-opacity: 0.7; }
You'll be able to see the changes as soon as you save your file, so if you're using a text editor (e.g. notepad / system equivalent) you can leave Obsidian open as you tweak.
Additional settings from the console:
--link-external-color: --link-external-color-hover: --link-external-decoration: --link-external-decoration-hover: --link-internal-color: --link-internal-color-hover: --link-internal-decoration: --link-unresolved-color: --link-unresolved-opacity: --link-unresolved-decoration-style: --link-unresolved-decoration-color:
There is a good explanation of how to find these settings from the console here.
As described above this can now be achieved via the new variables in 0.16
It seems like the variables changed a bit. This (mostly) works for me:
body{
/* Color for internal links */
--link-color: red;
/* Color for external links */
--link-external-color: green;
/* Color for unresolved links */
--link-unresolved-opacity: 0.7;
--link-unresolved-color: yellow;
}
Shown in image:
- Unresolved link
- Internal link
- external link
Unresolved links don't work in edit mode though. Not sure whether this is a bug in Obsidian or on purpose:
Closed in Minimal 6.1.0
@kepano Thank you for giving this setting a UI!
Unresolved links don't work in edit mode though.
This is still the case unfortunately. Any possibility to fix / add this?
@kepano Thank you for giving this setting a UI!
Unresolved links don't work in edit mode though.
This is still the case unfortunately. Any possibility to fix / add this?
Are you talking about source mode or live preview? Should work in Live Preview. Obsidian doesn't have a selector for unresolved links in source mode
I was talking about source view. So it seems this is not possible (yet).