Cssvariable like csslasses in front matter

Part of the fun with obsidian is to customize is and I’ve been playing around some snippet to be able to change the color and feels of the app.

But it’s always on the whole app itself.

I would love to be able to change some cssvariable directly from the frontmatter, that way the ui could change for certain note.

I could get a theme for my research and another one for my travelling journal.

There is a built-in property “cssclasses” that does exactly that.

It adds classes only to the note itself, but you can also use the :has selector to style the whole app when sertain note is opened.

1 Like

I agree with you on cssclasses but it’s only a part of the answer for me cause every time I want to change a color, I would have to write a class in css.

Based on this page

I would love to be able to write in my frontmatter

    —text-normal: red

That way I can customize using the variables obsidian gave us without writing any css.

Could be used in combination with snippet. To me, it seems like powerful design possibility. I would even use them in my digital garden to customize post.