CSS snippets are completely ignored, not applied despite the correct placement, enabling and disabling all plugins in the settings

Hello. I came across a complete malfunction of CSS snippets in Obsidian under Windows 11 (v 1.9.10). No snippet is applied to the interface, although the files are in the correct folder and are displayed in the settings.

Problem:
CSS snippets have no visible effect on the interface.

What I have already checked and done:

Path and files: All CSS files are placed along the path: .obsidian\snippets\

Obsidian Settings: In the settings (Appearance → CSS Snippets) all the added files are visible, and the slider next to each one is enabled.

Reboot: After each change, I completely closed and reopened Obsidian.

Syntax checking: To eliminate errors in complex themes, I created the simplest possible test snippet in order to color the background red.:

Contents of the test.css file:

css
body {
background-color: rgba(255, 0, 0, 0.1);
}
I tried the option with !important and another selector.:

css
.workspace-split.mod-root {
background-color: rgba(255, 0, 0, 0.1) !important;
}
Result: Zero, no changes.

Disabling all third-party stuff: I completely disabled all community plugins and changed the theme to the standard one. The problem persists.

Other: I checked for typos in the folder name.obsidian and snippets. All right.

It seems that Obsidian simply does not read or apply the contents of these CSS files, although it sees their names in the settings. All the standard solutions that are being Googled have already been tested.

What could be the reason? Where else to look?

maybe this

Obsidian 1.9.10 Desktop (Public) - Obsidian.

I only learned about CSS yesterday, and I started using Obsidian the day before yesterday. But the plugin didn’t find anything that could fix it. And the problem remains open to me.

Perhaps the selector “body” is problematic. Try changing it by “div”.

1 Like

You’re headed in the right direction, but body isn’t specific enough here. There are many layers under / within that need to be considered.

Give this a try (a basic example):

.theme-light {
	.workspace-leaf,
	.markdown-source-view.mod-cm6,
	.markdown-preview-view {
    	background-color: rgba(255, 0, 0, 0.1);
	}
}


I’d check out this excellent topic if you haven’t yet:

I inserted your code, and nothing has changed for me anyway

it seems to me that the error is not in the code, or inaccuracies in them. It’s some basic setting that I’ve missed

in your code example, as I did: opened a text file in the snippet folder, inserted your code → changed the format from txt to css. saved-> updated the css list in Obsidian, the file was displayed, and added a checkbox
But nothing happened.

It seems your .css file is malformed in some way. What app are you using to create it?


Give this a try: _test_test.css (174 Bytes)

Be sure to put it in the VAULT-NAME/.obsidian/snippets/ folder and enable it

1 Like

Also, you could try the community plugin:

https://obsidian.md/plugins?id=css-editor

to ensure the .css file is valid, in the correct spot, etc. – all within Obsidian.

1 Like

Everything worked

At first, I created css files incorrectly.
Once again, I was stupid. when I decided to test the red background on a dark theme

All these reasons got mixed up, which led to a series of failures.

Thanks to everyone who wrote