Change Edit background upon selection

Things I have tried:

  1. I searched thru the folder of CSS snippets files compiled by Dmitriy-Shulha on GitHub.
  2. I tried the F1 search on this forum.

What I’m trying to do

In Edit mode when I highlight a phrase to work on, the background changes color very slightly – too little for me to reliably discern.
How can I make selected text change color to be more visible (e.g. to yellow) with a CSS snippet?
Thank you.

Hi @Oran,

There is a css variable that you can change called --text-selection. You can create a CSS Snippet with the following:

.theme-dark {
  --text-selection: yellow;

Then replace yellow with something less ugly, maybe #ffff0040.


(There’s something wrong with that hex. Maybe #fff040?)

1 Like

The last 2 hex digits are the alpha channel (so it’s yellow with 40% opacity)


Oh :woozy_face:

Sorry about that. You just taught me something.

1 Like

Thanks @liam, For the sake of others who might want to make their editing easier to identify, here is my final version:

.theme-dark .cm-s-obsidian {
–text-selection: #3026eb;