Styling Highlighted Links CSS, works only in reading mode, no longer in editing mode

I’m compiling a CSS that changes a bunch of colors. I think one part “broke” in a recent update to Obsidian.

highlighting a link, so ==[[orange]]== should appear orange. This works in reading/preview mode, but no longer in editing mode. If I’m using the Inspector correctly, this may because of a new format of those links, data-link-text. However it seems that because of that, span.highlight.link no longer works, or rather, it’s no longer recognized as “span.highlight.link” and only as “link” (using abbreviated terms)

span.cm-highlight.cm-hmd-internal-link {
  /*  font-style: initial; */	
    background-color: var(--highlight-link);
    color: #222 !important;
}

body > .app-container div.markdown-preview-view mark > .data-link-text {
     background-color: var(--highlight-link);
     color: #222 !important;
}


span.cm-highlight.data-link-text {
  /*  font-style: initial; */	
    background-color: var(--highlight-link);
    color: #222 !important;
}

body > .app-container div.markdown-preview-view mark > .internal-link {
     background-color: var(--highlight-link);
     color: #222 !important;
}

body > .app-container div.markdown-preview-view mark > .internal-link {
     background-color: var(--highlight-link);
     color: #222 !important;
}

image

image

How can I fix this?
Thanks!

This works in a test vault (attached below).

/* EDITING AND READING INTERNAL LINK */
.markdown-source-view.mod-cm6 .cm-hmd-internal-link,
.markdown-rendered .internal-link {
  background-color: orange;
}

test2.zip (9.7 KB)

Yup, that works, thanks :slight_smile:

1 Like

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