Font and color for headings based on folder

What I’m trying to do

I created a css in my .obsidian\snippets folder, only I can’t find a guide to obsidian css.
How should I make it so that the titles of the notes in a certain folder (and its subfolders) are in comic sans blue?

Things I have tried

.folder-name .markdown-title {
    color: blue !important;
}

and

[data-path^="X/"] h1, [data-path^="X/"] h2, [data-path^="X/"] h3, [data-path^="X/"] h4, [data-path^="X/"] h5, [data-path^="X/"] h6 {
color: blue;
font-family: "Comic Sans MS", cursive, sans-serif;
font-size: 50px;
}

Here’s a great topic to have a look at:

thank you, but your guide allows you to change the menu, not the note formatting

It’s just a general guide for Obsidian and CSS.

Can you share a screenshot of where you’d like to change? It may help folks give you some suggestions. CSS alone, or maybe a combination of CSS and GitHub - nathonius/obsidian-auto-class: Automatically add CSS classes to notes based on file path. could do it.


In this example I intend to change the style of titles for notes contained in Guides, but not title of notes in other folders

Got it. Are those ## h2 headings?

So, GitHub - nathonius/obsidian-auto-class: Automatically add CSS classes to notes based on file path. seems like it could work for this.

The example CSS:

.h2-comic {
    --h2-font: 'ComicSansMS';
    --h2-color: blue;
}

And the settings in auto-class:

1 Like

Thank you, that was what I was looking for, although complicated to the extreme! :triumph:

Well, is there an editor for graphical css generation?

Not that I know of.

There are some community plugins, for example, to help in making custom tag colors or custom callouts. Those could be useful.