How to change cell background colour of a VSCode Jupyter Notebook?

Viewed 3482

I would like to know what is the JSON setting to change the background colour of a VSCode Jupyter Notebook cell.

I found the VSCode Theme colour reference but I can't find the specific setting to do so.

I found the perfect colour theme but I would like to tweak the background colour cell just a bit.

3 Answers

For those interested the setting is:

"editorWidget.background": "#ff0000",

To find it, from the command palette I ran: Developer: Generate Color Theme from Current Settings

This will create a new json document with ALL the elements currently affected by your current theme, from there I search for all the occurrences of the hex colour until I found the matching setting.

UPDATE: Please see Mark's answer below

Mark's answer is not comprehensive enough. Not sure if it is the best, please try.

In the settings.json -- can be found at File(Windows)/Code(Mac)>Preferences>Settings

Adding this into the json will work -- notebook's setting has to be put under the workbench.colorCustomizations.

"workbench.colorCustomizations": {
    "notebook.cellEditorBackground": "#FFFFFF",
  },

The rest of the settings you may follow Mark's guide above.

However, customizing the color background alone at jupyter notebook at vscode is not enough, i need the complete best settings including the font colors. Please share if you found the settings for all under notebook. Or can we change the notebook theme only but leaving the rest of vscode theme untouched?

vscode v1.59 is adding this colorCustomization:

"notebook.cellEditorBackground"

Also available:

"notebook.cellBorderColor"


Previously:

That theme color reference link doesn't seem to be kept up-to-date. See vscode Theme Color reference instead. There are a lot of notebook-related theme colors:

Notebook colors

including:

notebook.focusedCellBackground
notebook.selectedCellBackground

and many more.

Related