Allow CSS styling of SVG embeds

A cool property of SVG images is that they can be styled using CSS. I took advantage of this in Obsidian to make diagrams that automatically match dark/light mode:

SVGExample

The same technique can be used to dynamically change fonts, add a background color, etc.

This is not currently possible in Silverbullet because SVGs are rendered as <img src="file.svg"> instead of a fully embedded <svg> in the DOM. Feasible to implement, as a plug or otherwise?

2 Likes