You don’t need to modify the script, but add some lines on your css:
html.dark .d-header {
background: #1c1c1c; /*change it with the hex color you want*/
}
to change the background color
Instead, to change the color of the title (if you need) add somenthing like this:
html.dark .extra-info-wrapper .topic-link {
color: #ffffff; /*change it with the hex color you want*/
}