How to : Change search highlight colour?

This is the one that I use:

  .backlink-pane .search-result-file-matched-text,
  .workspace-leaf-content[data-type="search"] .search-result-file-matched-text,
  .internal-query .search-result-file-matched-text {
    background: none;
    color: var(--text-accent);
  }

It removes the background and gives the text your accent colour, which is what I prefer.
The snippet is for the global search, inline search queries & the backlinks pane, if you only want this to apply to the global search then just remove the other two selectors:

  .workspace-leaf-content[data-type="search"] .search-result-file-matched-text {
    background: none;
    color: var(--text-accent);
  }

I hope this helps.

2 Likes