Page History

SVG and TiddlyWiki

Mark George edited this page on 16 Mar 2022

Clone this wiki locally

Use alpha channel for making an image usable in both light and dark themes.

Edit the SVG in a text editor, and add the following attribut to the <svg> tag:

style="background:#FFFFFF99"

Having a slightly transparent image that is mostly white, means the background will be white in the light theme, but grey in the dark theme as the white blends with the dark background.

Sizing

Remove the width and height attributes from the <svg> tag to cause the image to fill its container. You can then change the size as desired by sizing the parent container. For example:

<div style="width:500px">{{/some/image.svg}}</div>

Will result in an SVG that is 500px wide.