Changing header and color theme in User's Home Page

Hi everyone, I’d like to know if there’s a way to customize the header and color theme on my users’ home page.

I think you’ll need to look at JupyterLab themes:

It might be sufficient to use custom.css in this case: Interface Customization — JupyterLab 4.3.0 documentation

but for larger customizations a custom theme plugin would be best: Develop Extensions — JupyterLab 4.3.0 documentation

2 Likes

@krassowski I was able to mount the custom .css

Custom CSS is not loaded by default. In the jupyter configuration directory, the ~/.jupyter/custom/custom.css file will not be loaded unless the the application is initialized with the --custom-css flag (LabApp.custom_css config).

Can you tell me where to add this LabApp.custom_css in helm chart?

I am not sure what is the best place to add it in the helm chart. I guess it should be passed the same way as all other traitlets that are given to the single user jupyter-server.

I would defer to @manics or another JupyterHub maintainer here.

Also, this also came up in Custom CSS for jupyterhub-singleuser

1 Like

Maybe this should be in a FAQ for jupyterhub?

Since this is Z2JH the most reliable way is to build it into the image, e.g. in one of the non-user jupyter paths like /etc/jupyter or /optn/conda/etc/jupyter.

Alternatively you can define the content of a file and mount it using singleuser.extraFiles in the Z2JH config:

Maybe this should be in a FAQ for jupyterhub?

Yes, it’s been on my (ever growing) todo list for a while… what I envisaged was an explanation about how the JupyterLab/server configuration is independent of JupyterHub configuration, and to link to the Jupyter Server documentation. Is
https://jupyter-server.readthedocs.io/en/latest/users/configuration.html#configuring-a-jupyter-server
the best place?

2 Likes

@manics I made the required changes to the YAML file:

  extraFiles:
    jupyter_lab_config.json:
      mountPath: /etc/jupyter/jupyter_lab_config.json
      data:   
        LabApp:
          custom_css: true

However, now my user pod is failing. The issue is that I couldn’t find the c.LabApp.custom_css property in the default jupyter_lab_config.py file, even after generating the configuration using the jupyter lab --generate-config command.

Found the soln it was jupyterlab version problem.It works thx .

1 Like

@manics I was also trying to customize the layout of the page. While I was able to do this manually using an extension, I need to automate this process so that it applies for every user, as I am using z2jh.Could you guide me on how to automate this customization for all users?, as i couldn’t find that in extension documentation.

Since you’re using Z2JH you can build a custom singleuser/JupyterLab container image with any extensions and configuration you need