I want to know if there is a better way to code highlight code in cells in jupyter labs

The default highlight color in jupyterlab is hard to read the code. I want to know if there is a better way to highlight the code in code cells. I have tried using chrome extensions which provide option to change highlighter color but for some reason it doesn’t work inside code cells.
What’s my option?
chrome_yu1O2bpw65

There may well be some other jupyterlab themes you would like better.

Another path: the nickle fix would be something like this, just in e.g. My Theme.ipynb, which would just need to be open in lab tab behind the notebook you’re working on:

%%html
<style>
.CodeMirror-focused .CodeMirror-selected { background: red; } // change to suit
</style>

You could then persist this in:

  • your browser by installing some chrome “user script” or “style manager”
    • can’t really give a particular recommendation, as I don’t know which ones are shady/selling data these days
  • your jupyterlab settings by installing jupyterlab-fonts
    • disclaimer: author
2 Likes

I like the second solution. Thanks.