Change the color of highlight using double equal sign

In obsidian, I use ==abc== to highlight the text “abc”, but is there a way to change the color of this highlight? Thanks in advance.

Depending on what theme you use, there might be a setting for it in Style Settings. Best to change it there so it doesn’t look funky with light/dark themes. If not, this snippet works: color is the text color (commented out here) and background-color is the highlight color.

.cm-s-obsidian span.cm-formatting-highlight, .cm-s-obsidian span.cm-highlight {
  /*color: purple;*/
  background-color: pink;
}

.markdown-preview-view mark { 
  /*color: purple;*/
  background-color: pink;
}
3 Likes

I see. Thanks.

I also want to ask can this snippet be used to change color more “precisely”? I mean, when I typed “red” after the background-color, I found this red is too dark, I want a lighter red, is there a way to do this?

Oh yeah, I just randomly put in pink. It can be a hex of whatever you like:
background-color: #ff6c72; CSS HEX Colors

1 Like

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