microsoft / vscode-notebook-renderers

MIT License
115 stars 36 forks source link

Unset white background of SVG #192

Open vwkd opened 8 months ago

vwkd commented 8 months ago

Description

Currently, the SVG renderer forces the background to be white which doesn’t play well with dark mode. This is unlike the built-in renderer in VSCode which doesn't set it.

It’s caused by the following rule targeting the wrapping div.

.svgContainerStyle svg {
  background-color: white;
}

Steps To Reproduce

See https://github.com/denoland/deno/issues/22427

Expected Result

expected

Actual Result

actual

Additional Information

Seally commented 8 months ago

I think the white background is intentional given this commit message: https://github.com/microsoft/vscode-notebook-renderers/commit/585e64138283cb420df3f35eb3d926cea81924cc

The main reason is that if you don't want the white background you can use the built-in renderer, otherwise there would be no need to have two renderers for the same content type. Some SVGs simply expect the output to be rendered on a white background.