obsidian-diagrams-net icon indicating copy to clipboard operation
obsidian-diagrams-net copied to clipboard

Requesting Dark Mode

Open Hunanbean opened this issue 2 years ago • 4 comments

If possible, please enable dark UI mode.

Thank you for enabling the use of Diagrams.net/draw.io in Obsidian for us.

Hunanbean avatar Dec 06 '22 10:12 Hunanbean

+1 This would also be on top of my list.

Also, big thank you from my side

Mat4m0 avatar Jan 15 '23 07:01 Mat4m0

To get Dark Theme just change the line 20494 in main.js to

const ui = "&ui=dark";

done

alterdaemon avatar Feb 27 '23 00:02 alterdaemon

@alterdaemon this worked, thanks! I tried const ui = "&ui=sketch";. Is it also possible to enable Dark Appearance on top of my selected Sketch Theme? Like the desktop app for draw.io.

mrdotkg avatar Aug 31 '23 18:08 mrdotkg

To get Dark Theme just change the line 20494 in main.js to

const ui = "&ui=dark";

done

Thanks to @alterdaemon 's suggestion. It worked.

But I'd like to add a point: const ui = "&ui=dark"; indeed change the interface display into dark, however it does nothing with the exported svg embedded in the note or canvas.

To let the svg follow theme, additionally we need to focus on the save & export logic from line 20524, and add another line:

_postMessage({
        action: "export",
        format: "svg",
        embedImages: true,
        //add this line
        keepTheme: true,
        exit: false,
      }

This let the exportion always follows the display once you save.

The plugin actually runs as an embedded instance, so I referenced the doc of diagrams.net: https://www.drawio.com/doc/faq/embed-mode#description-of-the-json-protocol With this you can have more customizations.

Oberon-Zheng avatar Sep 23 '23 06:09 Oberon-Zheng