comprehensive-rust
comprehensive-rust copied to clipboard
Dark Mode SVG Text Fix
Currently, SVG text in many of the diagrams appears as black on dark blue in dark mode. The SVG text
elements currently receive the default color, black:
Light mode:
Dark mode:
This PR suggests a one-liner CSS fix to apply the foreground css variable (var(--fg)
) to the svg text element to make svg text legible and accessible. This is bundled into the output using the additional-css
property in mdbook's config book.toml
.
This is probably something that could be fixed upstream in mdbook
/mdbook-svgbob
sometime, but this patch would fix it for current usability.
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
View this failed invocation of the CLA check for more information.
For the most up to date status, view the checks section at the bottom of the pull request.
Hi @nofurtherinformation, thanks a lot for looking into this!
This PR suggests a one-liner CSS fix to apply the foreground css variable (
var(--fg)
) to the svg text element to make svg text legible and accessible.
Super nice! I definitely want the different themes to be legible so this is important to fix. Could you update the PR description with an image showing how it looks after your fix? (I can check it out myself, but it'll be useful for others to see what the fix does).
I agree that we should file an issue upstream (probably mdbook-svgbob) about this. I'll be happy to do that after we merge this.
Apologies for the slow reply here @mgeisler (I was a bit offline for the holidays) and thanks for merging this in! For posterity, here is a screenshot of the new styling.
No worries at all, I was also out myself :smile: Thanks for the elegant fix, it would have taken me a while to figure this out myself!
I reported it upstream now, I hope the fix can be included there somehow: https://github.com/boozook/mdbook-svgbob/issues/22.