Yep, Admonitions are fully customizable/targetable using CSS snippets. For example, if you created a “note” admonition ad-note, the parent element will receive the .admonition-parent.admonition-note-parent CSS classes and the Admonition itself will receive the .admonition.admonition-note CSS classes.
So, if you wanted to globally set the font for all admonition types, you could do:
@valentine.195 I am probably doing something wrong, but can’t figure it for my life…
Essentially trying to tweak the look of .admonition. I’m using the below classes in a snippet but changes are not shown in Obsidian. It is very weird because when I play with the styling in the Inspector it works as expected. Any ideas?
Example: With the below changing the values for the font weight or the margins does not have any effect.
It is likely that you have some styling being applied that is more specific than what you’re trying to do. Applying styles directly to the element in its style attribute (or in the element.style region of the inspector, which is the same thing) will override almost all other styles because it is the most specific CSS you can apply.
I would recommend going to the Computed tab in the inspector and finding the property you’re trying to control - if you hover over it, a small grey arrow will appear that will take you to the CSS definition that is providing the style, and you can see where it is coming from. You’ll likely need to at least match that CSS’s specificity to get what you want.
Is anyone using a UUID with admonitions as part of a research-related workflow? If yes, how are you leveraging the advantage of a unique identifier or ID connected to each admonition? Are there some ways to think about cross-referencing / linking admonitions through the ID, dataview lists, etc.?
I have developed a quite interesting implementation to apply CSS over Admonition blocks. Allows you to use them to place images next to text, or to create up to 3 columns of text on the same note! Perhaps you will find it useful:
I wanted to know whther it is possible to change ht ebackground of the content in admonition call-outs?
For instance the grey background is dark, and I want to change it to something lighter.
I tried using some CSS examples but none of the worked.
I would like to quick convert a text with a header into an admonition block. Where header is the title and the text would be the body of the admonition block. This would make my work much easier instead of building up the admonition and declare title and admonition layout I could just mark the text and press a shortcut and voila the admonition block is build.
In fact, now you can do the opposite thing: converting Obsidian-style admonition to MkDocs-style one IN COMPILE TIME (i.e. it won’t make any change to your original .md file, but rather change all ``` to !!! when compiling markdown to html).