How to change cursor color in Jupyterhub->Jupyterlab

Hello,

I have a Jupyterlab running on top of Jupyterhub installation.

I really love how UI colors look like with Dark Theme + Dark Reader on top.

However, the cursor color is being replaced with dark grey, which makes it almost invisible on the default black background.

Is there a way to change the cursor color? If it is set to color other than white, then Dark Reader may ignore it. Also I have a CSS extension that can change the CSS on the fly, but nothing along the lines of

.cm-cursor {
    border-left: 2px solid blue; !important;
}

or changing .cm-cursor to .CodeMirror-cursor or div.CodeMirror-cursor worked.

I think you may have more luck with overriding --jp-editor-cursor-color and --jp-code-cursor-width0 CSS variables. I tried setting:

body {
    --jp-editor-cursor-color: red;
    --jp-code-cursor-width0: 5px;
}

in Chrome inspector and this gave me:

Screenshot from 2024-07-13 15-18-38

2 Likes

Wow, this has actually worked. Thank you so much!

Also, to make cursor stand out even with Dark Reader activated, one can add an entry to its Dev Tools → Inversion Fix Editor, like:

================================

your-jupyter-server-ip

NO INVERT
body
.jp-editor-cursor

================================