Way to change background color while keeping a theme?

Things I have tried

I didn’t try many things except changing a theme & also searching the forum, to no avail.

What I’m trying to do

I am trying to change the background color of obsidian editor/preview while also keeping the theme I have installed.

For now, themes can change the background color, but the one theme I really like doesn’t change it–keeps it blaring white, which is very irritating on my eyes.

Is there a way to change the background color while also keeping the theme applied? Like, with CSS? Can anyone help me out with this?

Thx

A good overview to change things with css: Getting comfortable with Obsidian CSS
That should allow you to select the background and find the right selector. You can save your changes as a snippet, and they will be applied on top of your theme: Add custom styles - Obsidian Help

And from Discord, Carl the Turtle has this handy recommendation:

Custom CSS lets your completely customize how your Obsidian looks.

To enable custom CSS, go to Settings => Appearance. From there, you can choose among a list of community themes, which appears in settings after you enable the custom CSS plugin.

You can further customize your theme by modifying its file in .obsidian/themes or by using CSS snippets. To use a snippet, simply save it in a CSS file in <your vault root>/.obsidian/snippets/. We recommend editing the CSS file using something like Visual Studio Code or Sublime Text to properly highlight and format it, as invalid CSS will not work.

There’s a wonderful guide on our forum that should get you comfortable with working with CSS, if you’d like to make tweaks yourself: https://forum.obsidian.md/t/getting-comfortable-with-obsidian-css

You can also borrow from existing snippets the community has developed over time here: https://forum.obsidian.md/t/meta-post-common-css-hacks

I believe the solutions posted here should help:

Instead of an image, just specify the color you want.

2 Likes

Wow, thanks a lot @argentum, your help is highly appreciated!

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