mdbook-svgbob icon indicating copy to clipboard operation
mdbook-svgbob copied to clipboard

Diagrams don't use theme colors

Open mgeisler opened this issue 2 years ago • 2 comments

I got a PR from @nofurtherinformation to fix the diagram colors when a dark theme is used in mdbook: https://github.com/google/comprehensive-rust/pull/48.

The problem is that the diagrams use black as the text color — even when the background color is very dark.

The fix is simply to include a style sheet with

svg text {
  fill: var(--fg);
}

I'm not sure where the right place is to add such a CSS rule since mdbook-svgbob is a preprocessor. Perhaps it could be a style="fill: var(--fg)" attribute instead somewhere on the generated SVG?

mgeisler avatar Jan 05 '23 18:01 mgeisler

Hey @mgeisler, I have verified that adding style="fill: var(--fg)" in svgbob.rs does the job. Can we go ahead with that?

hmn53 avatar Sep 22 '23 05:09 hmn53

Sounds great, thanks @hmn53 for digging into this!

mgeisler avatar Sep 22 '23 08:09 mgeisler