lonboard icon indicating copy to clipboard operation
lonboard copied to clipboard

[BUG] Map overrides theme in VSC interactive display.

Open deanm0000 opened this issue 1 year ago • 5 comments

Context

When using lonboard in VSC jupyter interactive in dark mode, once I display a Map, the output for everything carries the theme of the Map of white background. Before running a map it looks like: image

Resulting behaviour, error message or logs

After having run a map it looks like this:

image

Environment

Platform: Linux-5.15.153.1-microsoft-standard-WSL2-x86_64-with-glibc2.35 Python: 3.12.2 (main, Feb 25 2024, 16:35:05) [GCC 11.4.0]

  • Lonboard Version: '0.10.3' VSC: 1.93.1 Chromium: 124.0.6367.243

Steps to reproduce the bug

Using VSC with dark theme. Make a map then all cells get the Map's style, at least for background and font.

deanm0000 avatar Oct 29 '24 14:10 deanm0000

I don't particularly understand CSS styling and what's happening here. But it's also quite difficult to provide CSS that works as expected in every environment, when Jupyter/JupyterLab/Colab/vscode etc are all implemented in different ways. Happy to accept a PR or maybe @vgeorge has time at some point to look into this. (but lower priority than some bugs in the last release like https://github.com/developmentseed/lonboard/issues/675)

kylebarron avatar Oct 29 '24 19:10 kylebarron

Hello @kylebarron and @vgeorge I'm experiencing a similar issue with VSC and am wondering if there is any room to make a contribution on this? WSL2 ubuntu 22.04 - lonboard 0.10.3 - python 3.11.10

eKerney avatar Nov 20 '24 20:11 eKerney

A fix here would be greatly appreciated!

kylebarron avatar Nov 20 '24 22:11 kylebarron

@kylebarron I haven't found a fix yet, though it is possible that this is an issue with VSCode and ipywidgets, and not necessarily lonboard - See this open ticket from the vscode-jupyter repo

Add support for theming of IPyWidgets #7161

eKerney avatar Dec 09 '24 21:12 eKerney

This does not work with me, anyone else got it to work with lonboard? https://github.com/microsoft/vscode-jupyter/issues/7161#issuecomment-1616627670

edit - having a cell with the following code works for me, change "black" with whatever background colour that is in your vscode theme:

%%html
<style>
html {
   background-color: black !important;
}
</style>

bjornasm avatar Jan 17 '25 09:01 bjornasm

I think this is closed via https://github.com/developmentseed/lonboard/pull/740

kylebarron avatar Jul 17 '25 22:07 kylebarron