Open binge6 opened 9 months ago
Hi all,
@HeinrichAD:
One of the reasons is: what theme should be used as default dark theme?
FYI here are some element about dark mode
:
Then a new question will be:
-darkmode
flag to the plantuml-server
?If that can help the topic, Regards, Th.
@The-Lum nice catch. Thank you.
Edit: In this case as a quick fix one could probably use the PLANTUML_PROPERTY_FILE
environment variable. But you would force the complete server to always use the dark mode flag.
- How to propagate the
-darkmode
flag to theplantuml-server
?
Maybe I did not get the point, but to generate an image in "Dark Mode", you have to use the appropriate FileFormatOption.
Using .withColorMapper(ColorMapper.DARK_MODE))
method will switch you to Dark Mode.
For example, if you want to generate some PNG image, you will have:
new FileFormatOption(FileFormat.PNG).withColorMapper(ColorMapper.DARK_MODE))
So you just have to see if the requested URL starts by /dsvg/
or /dpng/
and if it's the case, call this .withColorMapper(ColorMapper.DARK_MODE))
method.
Concerning the theme, as @The-Lum said, you have to use @media (prefers-color-scheme:dark)
in the theme definition, but that's only working for style, not for skinparam.
Hope this help!
@binge6 Do you mind describing exactly what you need?
The official server has a button "dark mode" that switches to /duml
, and then the links become /dsvg
and /dpng
.
Hi. Not as far as I know.
One of the reasons is: what theme should be used as default dark theme?
You can still use
!theme <theme-name>
to select your theme inside your plantuml code or use e.g. thePLANTUML_CONFIG_FILE
environment variable to render all diagrams with a special theme by default.With the second option you could also build something similar like /dpng using Nginx and two plantuml-server docker container. But maybe not the best idea 😅.
Here is a webpage with examples about different plantuml themes: https://the-lum.github.io/puml-themes-gallery/