51

I tried to apply dark theme by putting a *.css file in the ~/.jupyter/custom/ directory (like here). This changes a theme for a normal jupyter notebook. But no affect on the jupyter lab appearance. I also tried to install a theme using jupyter-theme, but alas, no changes in jupyter lab appearance.

Can someone point me to the how-to guide?

Neal Fultz
  • 9,282
  • 1
  • 39
  • 60
queezz
  • 1,832
  • 2
  • 20
  • 26
  • are you trying to embed the jupyter lab to your website? – iPhoneJavaDev Feb 03 '17 at 09:42
  • No, just to set-up my local jupyter lab. – queezz Feb 04 '17 at 11:01
  • try [jupyter themes](https://github.com/dunovank/jupyter-themes) – IVR Feb 16 '17 at 07:41
  • Actually I tried, and it works. For a notebook. So to say if I run jupyter notebook - the selected theme works. But if I run jupyter lab - it does not. Also jupyter lab has theme settings for the editor, and they work. Notebooks in the lab have a default appearance. – queezz Feb 17 '17 at 07:53
  • Some time passed and I found a github discussion on the topic, started one month before my question: https://github.com/jupyterlab/jupyterlab/issues/1084 And a duplicate discussion (closed): https://github.com/jupyterlab/jupyterlab/issues/2102 – queezz Jun 20 '17 at 08:34

2 Answers2

96

UPDATE 02/03/2018 Now this option is already built in in the settings menu!

enter image description here

Recently this issue was closed on the GitHub, and finally it is possible to edit settings of the jupyter lab. Hurray!

The procedure is described in this pull request.

Just update your jupyter-lab (now it is version 0.27.0) and go to File - Settings, then select Theme tab. And type your theme name in the User Overrides and press the check-mark at the right of the string. I tried several, but only "theme": "JupyterLab Dark" seems to work. Enough for me.

Apply dark theme to jupyter lab

enter image description here

I really appreciate the work the jupyter team is doing. Thank you all!

queezz
  • 1,832
  • 2
  • 20
  • 26
15

I bit the bullet, and figured out how to write a full custom theme as an extension.

The process is:

  1. Copy the Light theme from jupyterlab/packages to your own repository.
  2. Edit the package metadata in package.json and src/index.ts
  3. Edit the CSS stylesheets in styles
  4. Install the theme using jupyter labextensions install .
    • You may need to manually generate dependencies using node

Here is my theme for future reference - https://github.com/nfultz/jupyterlab-theme-simple-extension

EDIT:

There's now a cookiecutter template to make it easier: https://github.com/jupyterlab/theme-cookiecutter

Neal Fultz
  • 9,282
  • 1
  • 39
  • 60