Here's my semi-working CSS for Obsidian: ~~~ /* Internal links / a.internal-link, / in…
- User
Here's my semi-working CSS for Obsidian:
code/* Internal links */ a.internal-link, /* in reading mode */ .cm-hmd-internal-link .cm-underline /* in editing mode */ { color: green !important; } /* Unresolved links */ a.internal-link.is-unresolved, /* in reading mode */ .is-unresolved .cm-underline /* in editing mode */ { color: red !important; } /* External links */ a.external-link, /* in reading mode */ .cm-link:not(.cm-hmd-internal-link):not(.is-unresolved) .cm-underline, .cm-url:not(.cm-hmd-internal-link):not(.is-unresolved) .cm-underline { color: blue !important; }The problem is that
[link-name](file-name)is also colored as an external link, although it links to a local note. - Assistant
It seems that in Obsidian's editing mode, the
[link-name](file-name)syntax does not assign the.cm-hmd-internal-linkclass, which is why your CSS isn't correctly identifying these as internal links. Instead, these links are getting classes like.cm-linkand.cm-url, but without the.cm-hmd-internal-linkclass.Your current CSS for external links is too broad and is matching any
.cm-linkthat is not.cm-hmd-internal-linkor.is-unresolved, which includes your internal links using the syntax.