javalent / admonitions

Adds admonition block-styled content to Obsidian.md
MIT License
1.07k stars 70 forks source link

multi-column callout snippet does not work with alternate styling of admonition plugin #243

Closed mmfs37 closed 1 year ago

mmfs37 commented 2 years ago

This is a snippet that allowes to use finally multiple columns like notion or other platforms. Looks amazing for dashboards etc

How it should look: image

However I am a fan of alternative styling and I want to preserve that for my other callouts. So if I activate that it looks like this. image

I do know that this happens, and I had multiple custom snippets and its very easy to solve. Its usually solvable by adding it to the admonition callout registry image

-> now it does work image

however as soon as I restart obsidian it completly stops working. It gets invisible. I can't do anything. I can confirm it is still there but it in live preview and reading mode it shows nothing. How can that be? Before the restart everythign was perfect. Now it stops.... image

https://github.com/efemkay/obsidian-modular-css-layout/blob/main/MCL%20Multi%20Column.css <- this is the snippet

That s the example code I used for the screenshots:

[!multi-column]

[!subtle]+ Work your notes or lists here. using markdown formatting

[!advip-subtle]+ Personal your notes or lists here. using markdown formatting

[!subtle]+ Charity your notes or lists here. using markdown formatting

sigrunixia commented 1 year ago

Tested this and its working as intended as far as styling.

Admonitions created callouts inherit their styling from their admonition settings. To fix how the callout styling looks while maintaining the admonition's looks, custom css would be needed to target the .callout[data-callout="name"] and additional.admonition-parent-name` css.

As for why multi-column turns invisible when registered, is due to competing css and styles. The snippet is trying to do one thing (which is fully loaded), and the plugin trying to force the other (which happens upon reload). It results in something that cannot be rendered as it's a mess.

This is not something we'll really be able to fix on the plugin end. We can provide examples over time in our documentation (I have added this to my todo), on how to stylise callouts and admonitions differently, and increase more inter-snippet support with callout versions. That will be for another Github issue.