As described in a previous question, it is now possible to edit the Jupyter Lab theme. However, this theme has a few issues for me personally. For example, it makes plot axes hard to read, since their default color is black. Other users have had similar problems. Consequently, I would like to fork the existing theme and make plot display cells a light grey colour. How does one do this?
I tried to find the corresponding .css
file, but all I could find was /usr/local/share/jupyter/lab/themes/@jupyterlab/theme-dark-extension/
. I understand that I could edit the index.css
to achieve what I want, but how do I instead fork that theme and edit it? How do I let Jupyter Lab know about my custom theme?
To expand on the answer from @Payam Khaninejad once you've forked the Jupyter Lab project you need to find the variables.css
file and make your desired edits.
Then you can join the current (as of posting) issue on Github https://github.com/jupyterlab/jupyterlab/issues/3855 and get help to format your pull request to conform to the style used by the Jupyter Lab project. Info on contributing to the project here.
Here's a reply I wrote another question detailing the steps to make changes to the Jupyter Lab interface:
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.
we are using version 0.35.x ... the following steps worked for me ... it will create a clone of the light theme, would install it in jupyter lab and you would be able to select that from settings menu. you can customize this theme, build it and have the effect in jupyter lab
conda create -n jupyterlab-ext -c conda-forge --override-channels nodejs jupyterlab cookiecutter git
git checkout 0.35.x
jlpm install
jlpm build
npm run create:theme
{ "compilerOptions":
{ "declaration": true,
"lib": ["es2015", "dom"],
"module": "commonjs",
"moduleResolution": "node",
"noEmitOnError": true,
"noUnusedLocals": true,
"outDir": "lib",
"rootDir": "src",
"strict": true,
"strictNullChecks": false,
"target": "es2015",
"types": []
},
"include": ["src/*"]
}
[created by the steps here https://jupyterlab.readthedocs.io/en/stable/developer/xkcd_extension_tutorial.html#xkcd-extension-tutorial]
inside the theme folder ..
jlpm install
, jlpm run build
, jlpm run build:webpack
conda activate jupyterlab-ext then jupyter labextension install .
conda activate jupyterlab-ext
then, jupyter lab --watch
For version 1.0 , this cookie cutter could be used ... https://github.com/jupyterlab/theme-cookiecutter
First fork the Jupyter Lab project, then edit and commit your changes.
Second, go to Jupyter Lab project and ask pull request.
if they like your project they will accept and put your changes on their master branch
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With