A way to access the predefined style values via python

As a notebook writer: sure! It’s your JupyterLab, and you can do whatever you want, as long as it doesn’t keep you from undoing it, and asking for help getting your files back.

As a library author: no, not without further namespacing, as blanket hijacking other people’s CSS is poor form.

So:

/* bad neighbor */
:root {
  --jp-ui-layout-color0: red;
}
.jupyter-button.mod-success {
  background-color: #chucknorris;
}

/* upstanding citizen */
.my-parent-box {
  --jp-ui-layout-color0: red;
}
.my-parent-box .jupyter-button.mod-success {  
  background-color: #chucknorris;
}