vega / vega-themes

Themes for stylized Vega and Vega-Lite visualizations.
https://vega.github.io/vega-themes
BSD 3-Clause "New" or "Revised" License
129 stars 30 forks source link

Add light theme #413

Open joelostblom opened 2 years ago

joelostblom commented 2 years ago

The current default theme is light on light background and dark on dark background. There is currently a dark theme that forces plots to be dark even on light backgrounds, but there doesn't seem to be an equivalent to force a light theme on a dark background. I can make a PR based on https://github.com/vega/vega-themes/blob/next/src/theme-dark.ts if this addition would be welcome. For the three colors needed to be specified, I am thinking it would be the following based on picking colors from the dark and light demo themes:

const lightColor = '#000';
const medColor = '#ddd';

const darkTheme: Config = {
  background: '#fff',
domoritz commented 2 years ago

Wouldn't the light theme just need to set the background color to white instead of transparent?

joelostblom commented 2 years ago

Hmm, the reason I thought that wouldn't be enough is because it seems like the default theme automatically changes the color of gridlines, axes lines, text, and the chart background, when it is used in an editor that has a dark background. At least I noticed this was the case in vs code for one of my students, but not in jupyterlab, and it wasn't possible to force the light version of the default theme to come back:

image

domoritz commented 2 years ago

Huh, the renderer must be adding a config in dark mode then.

joelostblom commented 2 years ago

Does that mean this is a VS Code issue and I should open a ticket with them? Or is adding a light theme a reasonable solution?

domoritz commented 2 years ago

I think this is an issue with vscode. They just import a package from nteract, though, iirc. So you'll probably have more success with the source.