I have a CSS snippet that changes the color of both internal and external links to be this particular shade of red (#F83E43). However, the snippet only works for the reading view and not both as I would like it to be. In the live preview, the links are a lighter color of the custom accent color I have set; which is the same shade of red. (#F83E43)
/* Default color for all links in both views */
.markdown-preview-view a, .cm-s-obsidian a {
color: #F83E43 !important; /* Default color for all links */
}
/* External link color in both views */
.markdown-preview-view a.external-link, .cm-s-obsidian a.external-link {
color: #4CAF50; /* External links color */
}
/* Unresolved (non-existent) links color in both views */
body .markdown-preview-view a.is-unresolved,
body .cm-s-obsidian .cm-hmd-internal-link.cm-hmd-unresolved,
body .cm-s-obsidian span.cm-hmd-unresolved {
color: #721e21 !important; /* Darker color for unresolved links */
}
/* Dotted underline on hover for unresolved links in reading view */
body .markdown-preview-view a.is-unresolved:hover {
text-decoration: underline dotted !important;
}
/* Dotted underline on hover for unresolved links in editing view */
body .cm-s-obsidian .cm-hmd-internal-link.cm-hmd-unresolved:hover,
body .cm-s-obsidian span.cm-hmd-unresolved:hover {
text-decoration: underline dotted !important;
}