Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add light theme #413

Open
joelostblom opened this issue Oct 12, 2022 · 5 comments
Open

Add light theme #413

joelostblom opened this issue Oct 12, 2022 · 5 comments

Comments

@joelostblom
Copy link
Contributor

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
Copy link
Member

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

@joelostblom
Copy link
Contributor Author

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
Copy link
Member

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

@joelostblom
Copy link
Contributor Author

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
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants