-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Export SVG with CSS responsive Light and Dark themes #3147
Comments
You can manually add a style in the defs section as described here. We're planning to add an option for this in the SVG export dialog in one of the upcoming releases. |
@alderg that is awesome, I just manually inserted that |
We'll update this ticket when it's added. Can't give an ETA. |
@davidjgraph - I've installed the latest version for the last few weeks, I haven't seen it released yet? What commit was it added in? |
The commit was ec5dcc2. The 21.8.0 release. |
@davidjgraph - that doesn't have the |
@davidjgraph, what you've referenced is different than what this issue was talking about. The screenshot from @alderg is the actual thing I was looking for. |
@alderg / @davidjgraph - can I please get an answer regarding this one? because its still not implemented. It was supposed to be in v22 and now v23 is here, but this feature still isn't. |
@davidjgraph desktop on macOS |
thanks @alderg, that wasn't immediately obvious, I've been checking regularly for it for ages. I've noticed that this setting isn't remembered when you re-open an exported "theme-automatic.drawio.svg", so when you save it (and it automatically syncs the exported SVG), it loses the automatic part. Can it be persisted to exported file's |
Is your feature request related to a problem? Please describe.
I use drawio for a lot of technical documentation in source control. I export to the SVG format and reference the images in markdown files. With the advent of light/dark modes, my diagrams often become unreadable in dark mode. There is no way to have an exported diagram change between light and dark.
Describe the solution you'd like
You've clearly put a lot of work into the light/dark editing in drawio. When I switch between light and dark in the drawio app, the colours used for my diagram invert and I can clearly see the diagram. Could these "alternate themes" be embedded in the SVG file exports with
@media (prefers-color-scheme: dark) { ... }
CSS styles so your colour invertions can come along for the ride when exported, i.e. the SVG changes to dark based on the browser it's being viewed in? It would be very cool.Describe alternatives you've considered
The workaround is to export my diagrams with a solid white background.
Additional context
![light](https://user-images.githubusercontent.com/6822248/199509345-6526a5a1-a6bd-4bac-babe-428ac1ca19eb.png)
![dark](https://user-images.githubusercontent.com/6822248/199509358-d966890d-8012-40e0-b916-219308af6b78.png)
Example screenshots without changing anything about the diagram itself other than switching between light and dark mode.
The text was updated successfully, but these errors were encountered: