javalent / admonitions

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

Code block admonition color override no longer works #240

Closed mjschwenne closed 2 years ago

mjschwenne commented 2 years ago

Hello!

I am using Admonition 9.0.1 with Obsidian 0.14.2 and I'm having issues with code block admonitions not displaying the overridden color.

Take for example the sample given in the README:

```ad-note
color: 200, 200, 200

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod nulla.

RGB (200,200,200) is a silvery gray but when I paste this into Obsidian it renders as 

![image](https://user-images.githubusercontent.com/19698215/161759263-f8aa1e9b-9492-47d1-b243-654ece975820.png)

with the default blue color.
kempmackay commented 2 years ago

I'm having the same issue, too. I hope this gets fixed; I'm sure it will.

Now we wait...

Azurewren commented 2 years ago

I have experienced this as well. I discovered that the theme I was using was overriding the admonition css, so you may want to check to see if your current theme is doing that. A simple way is to change back to the default obsidian theme and see if that makes a difference.

tingmelvin commented 2 years ago

It seems the problem is that for the changeover to Admonitions 8/9 (can't remember which), --admonition-color was kept in the style attributes. Changing that in the inspector to --callout-color (which is the same syntax used by Callouts in core Obsidian) makes them render perfectly again.


this should work for the moment as a snippet, to set the colours properly

.admonition {
        --callout-color: var(--admonition-color) !important;
}