How to detect dark theme on Atom?

Hi, I’m trying to find a way to detect whether a dark theme (e.g. One Dark) is used in Atom to style some HTML elements when using Nteract/Hydrogen. Would be great if someone can point me in the right direction!

This is to extend dark mode support to Atom for the Python xarray package, of which a solution for VSCode and Google Colab editors is already available. They use a CSS styling like so:

html[theme=theme-one-dark-ui-tabsizing],
body.vscode-dark {
  --xr-font-color0: rgba(255, 255, 255, 1);
  --xr-font-color2: rgba(255, 255, 255, 0.54);
  --xr-font-color3: rgba(255, 255, 255, 0.38);
  --xr-border-color: #1F1F1F;
  --xr-disabled-color: #515151;
  --xr-background-color: #111111;
  --xr-background-color-row-even: #111111;
  --xr-background-color-row-odd: #313131;
}

Currently the element looks like this in Atom:

See related issues at:

Oops, sorry. The css should start with html[theme=dark],, not html[theme=theme-one-dark-ui-tabsizing],, that was my bad attempt at trying to make it work.