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

Diagrams don't use theme colors

Open mgeisler opened this issue 1 year 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