How to edit jupyter lab 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
}

Change background of figures to grey to allow axis to be read

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.


  • 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


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

  • install miniconda from here https://docs.conda.io/en/latest/miniconda.html (chose python3.7 one)
  • open Anaconda Terminal, [in windows goto search type Anaconda, select the terminal]
  • then run this conda create -n jupyterlab-ext -c conda-forge --override-channels nodejs jupyterlab cookiecutter git
  • clone jupyterlab from here https://github.com/jupyterlab/jupyterlab.git
  • switch branch with git checkout 0.35.x
  • then jlpm install jlpm build npm run create:theme
  • copy the theme folder to your chosen local theme folder for extension development. Replace tsconfig.json content with the following

{ "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 ..

  • run the following commands jlpm install, jlpm run build , jlpm run build:webpack
  • open another conda terminal, there go to repo folder and run conda activate jupyterlab-ext then jupyter labextension install .
  • in a conda terminal conda activate jupyterlab-ext then, jupyter lab --watch

For version 1.0 , this cookie cutter could be used ... https://github.com/jupyterlab/theme-cookiecutter