问题
I'd like to edit the JupyterLab Dark Theme, so that axis labels on inline plots can be clearly read. Example of the problem:
To remedy this problem I'd like to change the background colour of output cells which contain an image to a shade of grey. I used Chrome DevTools to insepect the webpage and found the class class="p-Widget jp-RenderedImage jp-mod-trusted jp-OutputArea-output"
.
I've noted that I can workaround this problem by using the JupyterLab Light Theme or by using a dark plotting theme in matplotlib
, however I'd like to address this issue directly. I welcome all suggestions or directions to resources to read which would help me to understand and fix this. Thanks!
Related issue on GitHub:
- link
Related SO questions:
- link
- link
回答1:
To edit Jupypter Lab themes you need to make changes to the file variables.css which is located in jupyterlab/packages/[THEME NAME]/style/
You can inspect the element of the Jupyter Lab that you'd like to change to find out its class. I used Chrome DevTools ctrl+shift+i
and click on various div classes until I found the one I wanted to alter.
Once you have the name of the div class you'd like to customize, add the changes to the variables.css
file. Here's what I changed and the result.
.jp-RenderedImage {
background-color: #A4A4A4
}
You can use this gist (where the code in the first cell comes from) created by one of the JupyterLab contributors to experiment with changes you made to the variables.css
file.
来源:https://stackoverflow.com/questions/51191993/how-to-edit-a-jupyterlab-theme