Easy CSS change : colored bolding

First, search the help docs and this forum. Maybe your question has been answered! The debugging steps can help, too. Still stuck? Delete this line and proceed.

What I’m trying to do

I am using a lot the “bold” function with the use of double star or underscore before and after words.
With the same double star or underscore using, could I have it my bold to be colored instead of black (for instance blue and bold), with an easy CSS instruction.
Until all the basic CSS changes I have tried have failed (like having colored headers)

Things I have tried

I have no succeeded CSS experience in obsidian
For instance to have colored headers, I have created an obsidian.css file in the “vault/.obsidian/snippets” file, and in this file I have instructed as below:

code {
h1 { color: blue; }
h2 { color: red; }
h3 { color: cyan; }
}

Then back in Obsidian I have activated the obsidian.css snippet, but this does not work

All this to expose my current Obsidian knowledge level and limits, in order to receive the most appropriated help.

Best regards

To change the bold font color in editing and reading modes, you could use:

:root body {
  --bold-color: orange;
}

This may or may not work with your theme and/or other changes you may have made.

it works, thanks a lot :slight_smile:

Could you also please advise how, the same way, I could have a colored underlining ?

Thank you in advance

Underlining isn’t a standard feature of Markdown or Obsidian (outside of links).

For underlining normal text, I would look at a plugin like GitHub - PKM-er/obsidian-editing-toolbar: An obsidian toolbar plugin, modified from the Cmenu plugin for something like that.

Thank you

This will not change the bold color universally. Bold text inside blockquote, and possibly elsewhere, will not change color.

This snippet from the AnuPpuccin theme can change the bold color in blockquotes too. I added “strong” at the start to make it apply to reading view too:

strong, .cm-s-obsidian span.cm-formatting-strong, .cm-s-obsidian span.cm-strong {
  color:  orange;
}
2 Likes

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