-
Notifications
You must be signed in to change notification settings - Fork 10
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
Add dark mode support to images #93
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Motivation
The migration to the new docfx modern template brings with it support for dark mode, but the existing images in this repository have not been updated and are unreadable in dark mode.
Proposed solution
Screenshots
Bonsai workflows
Flowcharts
SVGs
In some cases, this can be as simple as adding a style block near the top of the SVG to override inbuilt styles when dark mode is detected. The
!important
tag ensures that this takes precedence over inline styles. No other modifications to the SVG need to be added.Unfortunately in most cases (the reactive operator marble diagrams for instance) the underlying SVG code isn't so clean, and necessitates additional modifications to the SVG to find and group together various paths by surrounding them with a unique
g id
. Its not hard to do (takes a few minutes per graph), just laborious. Then a style such as this can be applied.In the end I chose to do these changes:
Alternatives considered
Invert filter
This was the first option that I tried which inverts the colors. This is easier and faster to apply but it has several drawbacks:
For consistency's sake, I chose to go with the solution outlined above.
External stylesheet
Instead of editing all the SVGs I considered using an external CSS style, but with the variability of all the different SVGs, and the possibility that it might affect future SVGs in unexpected ways, I decided against it.
The text was updated successfully, but these errors were encountered: