Open matevz opened 2 years ago
Possible solution would be the following:
myimage.png
filename for light themes. For dark themes, check, if myimage_dark.png
exists and use it instead. Otherwise keep the original image. So something like the ThemedImage, but automated.drawio.com which we use for most of the hand-drawn diagrams now has theming support for SVG export. Selecting the "Automatic" theme option in the export dialog adds theme-sensitive CSS snippet in the SVG. This, and enabling transparent background gives best results in our docs.
Final result: | Light | Dark |
---|---|---|
oasis-sdk
https://github.com/oasisprotocol/oasis-sdk/pull/2068/filessapphire-paratime
https://github.com/oasisprotocol/sapphire-paratime/pull/457docs
https://github.com/oasisprotocol/docs/pull/1024
Go through all diagrams and check that they are readable in the dark theme:
Transparent PNGs (do we have any?) should either be redrawn/reexported in SVG or designed in such a way that the text is readable regardless of the background. Non-transparent PNGs and JPEGs could maybe use Docuaurus' themed images in the future?