Change specific Text color in Light-mode via css

Could you please help me?
Normaly I use Dark Mode. When switching to Light Mode, I would like to change specific colored Text-parts with a custom-css, i.e. change #ffc00 to #ad0c32 in Light Mode

some words

I know how this works with bold, italics, but not with custom colors.

Thank you very much!

correction (sorry!):

<font color=#ffc000">Some words</font>

I think, it should be something like this but with color (not “–bold-color”):

body.theme-dark {
  --bold-color: black !important;

body.theme-light {
  --bold-color: white !important;

You could try something like this:

body.theme-light :is(.markdown-preview-view, .cm-line .cm-html-embed) span.ccolor {
  color: #ad0c32; }

and in your note, wrap the text you want colored in a span class:

<span class='ccolor'>this text is #ad0c32</span>

Thank you very much! I think, that will do the trick!

Probably obvious, but if anyone comes across this at a later point: if you want to make more of them, you can just make copies and change the ccolor and hex color parts. :+1:t3:

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