CSS to change background of note in sidebar

What I’m trying to do

I have a CSS snippet to change the background color of notes but it doesn’t work when the note is in the sidebar. I’m having trouble finding the right CSS to target.

Things I have tried

These only work when the note is not in the sidebar:

.color {
background-color: #BCF2FD;
}

/* or the two below */

.tint .cm-scroller {
background-color: #BCF2FD;
}

.tint + .markdown-reading-view > .markdown-preview-view {
background-color: #BCF2FD;
}

You have the right info. Your first and second should work in the sidebar. The third wouldn’t work in even the center area.

Since it’s not working for you, things to check:

If you’re testing with multiple notes, then double check that the sidebar note has the cssclasses value for the snippet you’re actively testing, color or tint.

But if the same note when dragged from the center to a sidebar suddenly stops having a background, then try your snippet in a sandbox vault: Sandbox vault - Obsidian Help.

  • If it works in the sandbox, then give this Troubleshooting Guide a go.

  • If it doesn’t work in the sandbox, you could say your operating system, Obsidian version, and installer version so folks can look into it with you.

Thanks. I figured out its a problem with my theme “Typewriter.”